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