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 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame^] | 11 | SRC_URI = "git://github.com/nhorman/rng-tools.git;branch=master;protocol=https \ |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 12 | file://init \ |
| 13 | file://default \ |
| 14 | file://rngd.service \ |
| 15 | file://0001-Adding-ability-to-detect-non-posix-extensions-for-pt.patch \ |
| 16 | file://0002-Allow-for-use-of-either-pthread-affinity-set-methods.patch \ |
| 17 | " |
| 18 | SRCREV = "c16176d3800b91f4d016b66733b384493b06f294" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 19 | |
| 20 | S = "${WORKDIR}/git" |
| 21 | |
| 22 | inherit autotools update-rc.d systemd pkgconfig |
| 23 | |
Andrew Geissler | 4ed12e1 | 2020-06-05 18:00:41 -0500 | [diff] [blame] | 24 | EXTRA_OECONF = "--without-rtlsdr" |
| 25 | |
| 26 | PACKAGECONFIG ??= "libjitterentropy" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 27 | PACKAGECONFIG:libc-musl = "libargp libjitterentropy" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 28 | |
| 29 | PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy" |
| 31 | PACKAGECONFIG[libp11] = "--with-pkcs11,--without-pkcs11,libp11 openssl" |
| 32 | PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl" |
| 33 | |
| 34 | INITSCRIPT_NAME = "rng-tools" |
| 35 | INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ." |
| 36 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | SYSTEMD_SERVICE:${PN} = "rngd.service" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 38 | |
| 39 | # Refer autogen.sh in rng-tools |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 40 | do_configure:prepend() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 41 | cp ${S}/README.md ${S}/README |
| 42 | } |
| 43 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 44 | do_install:append() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 45 | install -Dm 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools |
| 46 | install -Dm 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools |
| 47 | install -Dm 0644 ${WORKDIR}/rngd.service \ |
| 48 | ${D}${systemd_system_unitdir}/rngd.service |
| 49 | sed -i \ |
| 50 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 51 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 52 | ${D}${sysconfdir}/init.d/rng-tools \ |
| 53 | ${D}${systemd_system_unitdir}/rngd.service |
| 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/' \ |
| 59 | ${D}${systemd_system_unitdir}/rngd.service |
| 60 | fi |
| 61 | } |