blob: ae974f9f6f43d0152938b512e35adcae353e5554 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001SUMMARY = "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 = "GPL-2.0-only"
8LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
9DEPENDS = "sysfsutils openssl"
10
11SRC_URI = "git://github.com/nhorman/rng-tools.git;branch=master;protocol=https \
12 file://init \
13 file://default \
14 file://rngd.service \
15 "
16SRCREV = "381f69828b782afda574f259c1b7549f48f9bb77"
17
18S = "${WORKDIR}/git"
19
20inherit autotools update-rc.d systemd pkgconfig
21
22EXTRA_OECONF = "--without-rtlsdr"
23
24PACKAGECONFIG ??= "libjitterentropy"
25PACKAGECONFIG:libc-musl = "libargp libjitterentropy"
26
27PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
28PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy"
29PACKAGECONFIG[libp11] = "--with-pkcs11,--without-pkcs11,libp11 openssl"
30PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl"
31
32INITSCRIPT_NAME = "rng-tools"
33INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ."
34
35SYSTEMD_SERVICE:${PN} = "rngd.service"
36
37# Refer autogen.sh in rng-tools
38do_configure:prepend() {
39 cp ${S}/README.md ${S}/README
40}
41
42do_install:append() {
43 install -Dm 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools
44 install -Dm 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools
45 install -Dm 0644 ${WORKDIR}/rngd.service \
46 ${D}${systemd_system_unitdir}/rngd.service
47 sed -i \
48 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
49 -e 's,@SBINDIR@,${sbindir},g' \
50 ${D}${sysconfdir}/init.d/rng-tools \
51 ${D}${systemd_system_unitdir}/rngd.service
52
53 if [ "${@bb.utils.contains('PACKAGECONFIG', 'nistbeacon', 'yes', 'no', d)}" = "yes" ]; then
54 sed -i \
55 -e '/^IPAddressDeny=any/d' \
56 -e '/^RestrictAddressFamilies=/ s/$/ AF_INET AF_INET6/' \
57 ${D}${systemd_system_unitdir}/rngd.service
58 fi
59}