1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools systemd readme.gentoo-r1 toolchain-funcs
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"
14 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~riscv ~x86"
15 IUSE="jitterentropy nistbeacon pkcs11 selinux"
17 DEPEND="dev-libs/libgcrypt:0
21 app-crypt/jitterentropy:=
31 elibc_musl? ( sys-libs/argp-standalone )
34 selinux? ( sec-policy/selinux-rngd )"
42 "${FILESDIR}"/test-for-argp.patch
43 "${FILESDIR}"/${PN}-5-fix-textrels-on-PIC-x86.patch #469962
47 echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am || die
49 # rngd_pkcs11.c needs to be linked against -lcrypto #684228
50 # See: https://github.com/nhorman/rng-tools/pull/61
52 sed -e '/rngd_pkcs11.c$/ a rngd_LDADD\t+= -lcrypto' \
58 mv README.md README || die
62 sed -i '/^AR /d' Makefile.in || die
68 $(use_enable jitterentropy)
69 $(use_with nistbeacon)
73 econf "${myeconfargs[@]}"
78 newinitd "${FILESDIR}"/rngd-initd-6.7-r1 rngd
79 newconfd "${FILESDIR}"/rngd-confd-6.7 rngd
80 systemd_dounit "${FILESDIR}"/rngd.service
83 local DISABLE_AUTOFORMATTING=1
85 The PKCS11 entropy source may require extra packages (e.g. 'dev-libs/opensc')
86 to support various smartcard readers. Make sure 'PKCS11_OPTIONS' in:
87 '${EROOT%/}/etc/conf.d/rngd'
88 reflects the correct PKCS11 engine path to be used by rngd.
90 readme.gentoo_create_doc
96 use pkcs11 && readme.gentoo_print_elog