diff options
author | Marek Szuba <marecki@gentoo.org> | 2021-08-17 11:05:49 +0100 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2021-08-17 11:23:13 +0100 |
commit | 19ecf04f943e610dce9bfebf786249ac6979f52b (patch) | |
tree | c97dfe925a34468c0e7a13fb6e8d78533505e148 /sys-apps/rng-tools | |
parent | net-wireless/rtl-sdr: keyword 0.6.0_p2020802 for ~riscv (diff) | |
download | gentoo-19ecf04f943e610dce9bfebf786249ac6979f52b.tar.gz gentoo-19ecf04f943e610dce9bfebf786249ac6979f52b.tar.bz2 gentoo-19ecf04f943e610dce9bfebf786249ac6979f52b.zip |
sys-apps/rng-tools: add support for rtlsdr entropy source
Closes: https://bugs.gentoo.org/803101
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'sys-apps/rng-tools')
-rw-r--r-- | sys-apps/rng-tools/metadata.xml | 3 | ||||
-rw-r--r-- | sys-apps/rng-tools/rng-tools-6.14-r1.ebuild | 69 |
2 files changed, 72 insertions, 0 deletions
diff --git a/sys-apps/rng-tools/metadata.xml b/sys-apps/rng-tools/metadata.xml index 69907447109c..73b2fae1636a 100644 --- a/sys-apps/rng-tools/metadata.xml +++ b/sys-apps/rng-tools/metadata.xml @@ -19,6 +19,9 @@ <flag name="pkcs11"> Enable PKCS11 entropy support </flag> + <flag name="rtlsdr"> + Enable atmospheric-static entropy support with <pkg>net-wireless/rtl-sdr</pkg> + </flag> </use> <upstream> <remote-id type="github">nhorman/rng-tools</remote-id> diff --git a/sys-apps/rng-tools/rng-tools-6.14-r1.ebuild b/sys-apps/rng-tools/rng-tools-6.14-r1.ebuild new file mode 100644 index 000000000000..36f8eebe1057 --- /dev/null +++ b/sys-apps/rng-tools/rng-tools-6.14-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools systemd readme.gentoo-r1 toolchain-funcs + +DESCRIPTION="Daemon to use hardware random number generators" +HOMEPAGE="https://github.com/nhorman/rng-tools" +SRC_URI="https://github.com/nhorman/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~riscv ~x86" +IUSE="jitterentropy nistbeacon pkcs11 rtlsdr selinux" + +DEPEND=" + dev-libs/openssl:0= + jitterentropy? ( app-crypt/jitterentropy:= ) + nistbeacon? ( + dev-libs/jansson + dev-libs/libxml2:2= + net-misc/curl[ssl] + ) + pkcs11? ( dev-libs/libp11:= ) + rtlsdr? ( net-wireless/rtl-sdr ) + elibc_musl? ( sys-libs/argp-standalone )" +RDEPEND="${DEPEND} + selinux? ( sec-policy/selinux-rngd )" +BDEPEND="virtual/pkgconfig" + +src_prepare() { + default + eautoreconf +} + +src_configure() { + local myeconfargs=( + $(use_enable jitterentropy) + $(use_with nistbeacon) + $(use_with pkcs11) + $(use_with rtlsdr) + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + + newinitd "${FILESDIR}"/rngd-initd-6.11 rngd + newconfd "${FILESDIR}"/rngd-confd-6.11 rngd + systemd_dounit rngd.service + + if use pkcs11; then + local DISABLE_AUTOFORMATTING=1 + local DOC_CONTENTS=" +The PKCS11 entropy source may require extra packages (e.g. 'dev-libs/opensc') +to support various smartcard readers. Make sure 'PKCS11_OPTIONS' in: + '${EPREFIX}/etc/conf.d/rngd' +reflects the correct PKCS11 engine path to be used by rngd. +" + readme.gentoo_create_doc + fi +} + +pkg_postinst() { + use pkcs11 && readme.gentoo_print_elog +} |