blob: 84dbc7685573e7d03591cfd01c0ed99978444391 [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"
Patrick Williams213cb262021-08-07 19:21:33 -050026PACKAGECONFIG:libc-musl = "libargp libjitterentropy"
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
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
Patrick Williams213cb262021-08-07 19:21:33 -050036SYSTEMD_SERVICE:${PN} = "rngd.service"
Andrew Geissler82c905d2020-04-13 13:39:40 -050037
38# Refer autogen.sh in rng-tools
Patrick Williams213cb262021-08-07 19:21:33 -050039do_configure:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050040 cp ${S}/README.md ${S}/README
41}
42
Patrick Williams213cb262021-08-07 19:21:33 -050043do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050044 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}