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