Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Random number generator daemon" |
| 2 | DESCRIPTION = "Check and feed random data from hardware device to kernel" |
| 3 | AUTHOR = "Philipp Rumpf, Jeff Garzik <jgarzik@pobox.com>, \ |
| 4 | Henrique de Moraes Holschuh <hmh@debian.org>" |
| 5 | HOMEPAGE = "https://github.com/nhorman/rng-tools" |
| 6 | BUGTRACKER = "https://github.com/nhorman/rng-tools/issues" |
| 7 | LICENSE = "GPLv2" |
| 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 9 | DEPENDS = "sysfsutils openssl" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 10 | |
| 11 | SRC_URI = "\ |
| 12 | git://github.com/nhorman/rng-tools.git \ |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 13 | file://a4b6d9ce64f132e463b9091d0536913ddaf11516.patch \ |
| 14 | file://dab16a5fd4efde8ef569b358e19b1fcbc7d0d938.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 15 | file://init \ |
| 16 | file://default \ |
| 17 | file://rngd.service \ |
| 18 | " |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 19 | SRCREV = "0be82200a66d9321451e0a0785bfae350b9cffdc" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
| 23 | inherit autotools update-rc.d systemd pkgconfig |
| 24 | |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 25 | EXTRA_OECONF = "--without-rtlsdr" |
| 26 | |
| 27 | PACKAGECONFIG ??= "libjitterentropy" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 28 | PACKAGECONFIG_libc-musl = "libargp libjitterentropy" |
| 29 | |
| 30 | PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 31 | PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy" |
| 32 | PACKAGECONFIG[libp11] = "--with-pkcs11,--without-pkcs11,libp11 openssl" |
| 33 | PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl" |
| 34 | |
| 35 | INITSCRIPT_NAME = "rng-tools" |
| 36 | INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ." |
| 37 | |
| 38 | SYSTEMD_SERVICE_${PN} = "rngd.service" |
| 39 | |
| 40 | # Refer autogen.sh in rng-tools |
| 41 | do_configure_prepend() { |
| 42 | cp ${S}/README.md ${S}/README |
| 43 | } |
| 44 | |
| 45 | do_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 | } |