Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | SUMMARY = "Random number generator daemon" |
| 2 | LICENSE = "GPLv2" |
| 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=0b6f033afe6db235e559456585dc8cdc" |
| 4 | |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 5 | SRC_URI = "${SOURCEFORGE_MIRROR}/gkernel/${BP}.tar.gz \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 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 \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 9 | file://rng-tools-5-fix-textrels-on-PIC-x86.patch \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 10 | file://read_error_msg.patch \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 11 | file://init \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | file://default \ |
| 13 | file://rngd.service \ |
| 14 | " |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 15 | |
| 16 | SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68" |
| 17 | SRC_URI[sha256sum] = "60a102b6603bbcce2da341470cad42eeaa9564a16b4490e7867026ca11a3078e" |
| 18 | |
| 19 | # As the recipe doesn't inherit systemd.bbclass, we need to set this variable |
| 20 | # manually to avoid unnecessary postinst/preinst generated. |
| 21 | python () { |
| 22 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
| 23 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") |
| 24 | } |
| 25 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 26 | inherit autotools update-rc.d systemd |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 27 | |
| 28 | PACKAGECONFIG = "libgcrypt" |
| 29 | PACKAGECONFIG_libc-musl = "libargp" |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 30 | PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone," |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 31 | PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt," |
| 32 | |
| 33 | do_install_append() { |
| 34 | # Only install the init script when 'sysvinit' is in DISTRO_FEATURES. |
| 35 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
| 36 | install -d "${D}${sysconfdir}/init.d" |
| 37 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rng-tools |
| 38 | sed -i -e 's,/etc/,${sysconfdir}/,' -e 's,/usr/sbin/,${sbindir}/,' \ |
| 39 | ${D}${sysconfdir}/init.d/rng-tools |
| 40 | |
| 41 | install -d "${D}${sysconfdir}/default" |
| 42 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/rng-tools |
| 43 | fi |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 44 | |
| 45 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 46 | install -d ${D}${systemd_unitdir}/system |
| 47 | install -m 644 ${WORKDIR}/rngd.service ${D}${systemd_unitdir}/system |
| 48 | sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/rngd.service |
| 49 | fi |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | INITSCRIPT_NAME = "rng-tools" |
| 53 | INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 6 1 ." |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 54 | |
| 55 | SYSTEMD_SERVICE_${PN} = "rngd.service" |