blob: fb2fd63c5dd213bc69d3979cb624eb648dfd547f [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Random number generator daemon"
2DESCRIPTION = "Check and feed random data from hardware device to kernel"
3AUTHOR = "Philipp Rumpf, Jeff Garzik <jgarzik@pobox.com>, \
4 Henrique de Moraes Holschuh <hmh@debian.org>"
5HOMEPAGE = "https://github.com/nhorman/rng-tools"
6BUGTRACKER = "https://github.com/nhorman/rng-tools/issues"
7LICENSE = "GPLv2"
8LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
Andrew Geissler4ed12e12020-06-05 18:00:41 -05009DEPENDS = "sysfsutils openssl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050010
11SRC_URI = "\
12 git://github.com/nhorman/rng-tools.git \
13 file://init \
14 file://default \
15 file://rngd.service \
16"
Andrew Geissler09036742021-06-25 14:25:14 -050017SRCREV = "d8dac0e8bede73e42b3d59f3b48c662ad0032e8c"
Andrew Geissler82c905d2020-04-13 13:39:40 -050018
19S = "${WORKDIR}/git"
20
21inherit autotools update-rc.d systemd pkgconfig
22
Andrew Geissler4ed12e12020-06-05 18:00:41 -050023EXTRA_OECONF = "--without-rtlsdr"
24
25PACKAGECONFIG ??= "libjitterentropy"
Andrew Geissler82c905d2020-04-13 13:39:40 -050026PACKAGECONFIG_libc-musl = "libargp libjitterentropy"
27
28PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
Andrew Geissler82c905d2020-04-13 13:39:40 -050029PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy"
30PACKAGECONFIG[libp11] = "--with-pkcs11,--without-pkcs11,libp11 openssl"
31PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl"
32
33INITSCRIPT_NAME = "rng-tools"
34INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ."
35
36SYSTEMD_SERVICE_${PN} = "rngd.service"
37
38# Refer autogen.sh in rng-tools
39do_configure_prepend() {
40 cp ${S}/README.md ${S}/README
41}
42
43do_install_append() {
44 install -Dm 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
45 install -Dm 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
46 install -Dm 0644 ${WORKDIR}/rngd.service \
47 ${D}${systemd_system_unitdir}/rngd.service
48 sed -i \
49 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
50 -e 's,@SBINDIR@,${sbindir},g' \
51 ${D}${sysconfdir}/init.d/rng-tools \
52 ${D}${systemd_system_unitdir}/rngd.service
53
54 if [ "${@bb.utils.contains('PACKAGECONFIG', 'nistbeacon', 'yes', 'no', d)}" = "yes" ]; then
55 sed -i \
56 -e '/^IPAddressDeny=any/d' \
57 -e '/^RestrictAddressFamilies=/ s/$/ AF_INET AF_INET6/' \
58 ${D}${systemd_system_unitdir}/rngd.service
59 fi
60}