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 \ |
| 13 | file://init \ |
| 14 | file://default \ |
| 15 | file://rngd.service \ |
| 16 | " |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame^] | 17 | SRCREV = "d8dac0e8bede73e42b3d59f3b48c662ad0032e8c" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | |
| 19 | S = "${WORKDIR}/git" |
| 20 | |
| 21 | inherit autotools update-rc.d systemd pkgconfig |
| 22 | |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 23 | EXTRA_OECONF = "--without-rtlsdr" |
| 24 | |
| 25 | PACKAGECONFIG ??= "libjitterentropy" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 26 | PACKAGECONFIG_libc-musl = "libargp libjitterentropy" |
| 27 | |
| 28 | PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 29 | PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy" |
| 30 | PACKAGECONFIG[libp11] = "--with-pkcs11,--without-pkcs11,libp11 openssl" |
| 31 | PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl" |
| 32 | |
| 33 | INITSCRIPT_NAME = "rng-tools" |
| 34 | INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ." |
| 35 | |
| 36 | SYSTEMD_SERVICE_${PN} = "rngd.service" |
| 37 | |
| 38 | # Refer autogen.sh in rng-tools |
| 39 | do_configure_prepend() { |
| 40 | cp ${S}/README.md ${S}/README |
| 41 | } |
| 42 | |
| 43 | do_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 | } |