Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | SUMMARY = "Random number generator daemon" |
| 2 | LICENSE = "GPLv2" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 4 | |
| 5 | SRC_URI = "git://github.com/nhorman/rng-tools.git \ |
| 6 | file://0001-If-the-libc-is-lacking-argp-use-libargp.patch \ |
| 7 | file://0002-Add-argument-to-control-the-libargp-dependency.patch \ |
| 8 | file://underquote.patch \ |
| 9 | file://rng-tools-5-fix-textrels-on-PIC-x86.patch \ |
| 10 | file://0001-configure.ac-fix-typo.patch \ |
| 11 | file://init \ |
| 12 | file://default \ |
| 13 | file://rngd.service \ |
| 14 | " |
| 15 | SRCREV = "4ebc21d6f387bb7b4b3f6badc429e27b21c0a6ee" |
| 16 | S = "${WORKDIR}/git" |
| 17 | |
| 18 | inherit autotools update-rc.d systemd pkgconfig |
| 19 | |
| 20 | DEPENDS = " \ |
| 21 | sysfsutils \ |
| 22 | " |
| 23 | |
| 24 | PACKAGECONFIG ??= "libgcrypt libjitterentropy" |
| 25 | PACKAGECONFIG_libc-musl = "libargp libjitterentropy" |
| 26 | PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," |
| 27 | PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt," |
| 28 | PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy" |
| 29 | PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl" |
| 30 | |
| 31 | # Refer autogen.sh in rng-tools |
| 32 | do_configure_prepend() { |
| 33 | cp ${S}/README.md ${S}/README |
| 34 | } |
| 35 | |
| 36 | do_install_append() { |
| 37 | # Only install the init script when 'sysvinit' is in DISTRO_FEATURES. |
| 38 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 39 | install -d "${D}${sysconfdir}/init.d" |
| 40 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools |
| 41 | sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \ |
| 42 | ${D}${sysconfdir}/init.d/rng-tools |
| 43 | |
| 44 | install -d "${D}${sysconfdir}/default" |
| 45 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools |
| 46 | fi |
| 47 | |
| 48 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 49 | install -d ${D}${systemd_unitdir}/system |
| 50 | install -m 644 ${WORKDIR}/rngd.service ${D}${systemd_unitdir}/system |
| 51 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/rngd.service |
| 52 | fi |
| 53 | } |
| 54 | |
| 55 | INITSCRIPT_NAME = "rng-tools" |
| 56 | INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ." |
| 57 | |
| 58 | SYSTEMD_SERVICE_${PN} = "rngd.service" |