sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / sys-apps / rng-tools / rng-tools-6.8.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools systemd readme.gentoo-r1 toolchain-funcs
7
8 DESCRIPTION="Daemon to use hardware random number generators"
9 HOMEPAGE="https://github.com/nhorman/rng-tools"
10 SRC_URI="https://github.com/nhorman/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~riscv ~x86"
15 IUSE="jitterentropy nistbeacon pkcs11 selinux"
16
17 DEPEND="dev-libs/libgcrypt:0
18         dev-libs/libgpg-error
19         sys-fs/sysfsutils
20         jitterentropy? (
21                 app-crypt/jitterentropy:=
22         )
23         nistbeacon? (
24                 net-misc/curl[ssl]
25                 dev-libs/libxml2:2=
26                 dev-libs/openssl:0=
27         )
28         pkcs11? (
29                 dev-libs/libp11:=
30                 dev-libs/openssl:0=
31         )
32         elibc_musl? ( sys-libs/argp-standalone )
33 "
34 RDEPEND="${DEPEND}
35         selinux? ( sec-policy/selinux-rngd )"
36 DEPEND="${DEPEND}
37         nistbeacon? (
38                 virtual/pkgconfig
39         )
40 "
41
42 src_prepare() {
43         echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am || die
44
45         default
46
47         mv README.md README || die
48
49         eautoreconf
50
51         sed -i '/^AR /d' Makefile.in || die
52         tc-export AR
53 }
54
55 src_configure() {
56         local myeconfargs=(
57                 $(use_enable jitterentropy)
58                 $(use_with nistbeacon)
59                 $(use_with pkcs11)
60         )
61
62         econf "${myeconfargs[@]}"
63 }
64
65 src_install() {
66         default
67         newinitd "${FILESDIR}"/rngd-initd-6.7-r1 rngd
68         newconfd "${FILESDIR}"/rngd-confd-6.7 rngd
69         systemd_dounit "${FILESDIR}"/rngd.service
70
71         if use pkcs11; then
72                 local DISABLE_AUTOFORMATTING=1
73                 local DOC_CONTENTS="
74 The PKCS11 entropy source may require extra packages (e.g. 'dev-libs/opensc')
75 to support various smartcard readers. Make sure 'PKCS11_OPTIONS' in:
76         '${EROOT%/}/etc/conf.d/rngd'
77 reflects the correct PKCS11 engine path to be used by rngd.
78 "
79                 readme.gentoo_create_doc
80         fi
81
82 }
83
84 pkg_postinst() {
85         use pkcs11 && readme.gentoo_print_elog
86 }