blob: 3f9720e406fbb6a7fbf000e80418e3807a31e09f [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 \
Andrew Geissler4ed12e12020-06-05 18:00:41 -050013 file://a4b6d9ce64f132e463b9091d0536913ddaf11516.patch \
14 file://dab16a5fd4efde8ef569b358e19b1fcbc7d0d938.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050015 file://init \
16 file://default \
17 file://rngd.service \
18"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050019SRCREV = "0be82200a66d9321451e0a0785bfae350b9cffdc"
Andrew Geissler82c905d2020-04-13 13:39:40 -050020
21S = "${WORKDIR}/git"
22
23inherit autotools update-rc.d systemd pkgconfig
24
Andrew Geissler4ed12e12020-06-05 18:00:41 -050025EXTRA_OECONF = "--without-rtlsdr"
26
27PACKAGECONFIG ??= "libjitterentropy"
Andrew Geissler82c905d2020-04-13 13:39:40 -050028PACKAGECONFIG_libc-musl = "libargp libjitterentropy"
29
30PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
Andrew Geissler82c905d2020-04-13 13:39:40 -050031PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy"
32PACKAGECONFIG[libp11] = "--with-pkcs11,--without-pkcs11,libp11 openssl"
33PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl"
34
35INITSCRIPT_NAME = "rng-tools"
36INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ."
37
38SYSTEMD_SERVICE_${PN} = "rngd.service"
39
40# Refer autogen.sh in rng-tools
41do_configure_prepend() {
42 cp ${S}/README.md ${S}/README
43}
44
45do_install_append() {
46 install -Dm 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
47 install -Dm 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
48 install -Dm 0644 ${WORKDIR}/rngd.service \
49 ${D}${systemd_system_unitdir}/rngd.service
50 sed -i \
51 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
52 -e 's,@SBINDIR@,${sbindir},g' \
53 ${D}${sysconfdir}/init.d/rng-tools \
54 ${D}${systemd_system_unitdir}/rngd.service
55
56 if [ "${@bb.utils.contains('PACKAGECONFIG', 'nistbeacon', 'yes', 'no', d)}" = "yes" ]; then
57 sed -i \
58 -e '/^IPAddressDeny=any/d' \
59 -e '/^RestrictAddressFamilies=/ s/$/ AF_INET AF_INET6/' \
60 ${D}${systemd_system_unitdir}/rngd.service
61 fi
62}