blob: b3c9fd97455767b71d3bb77225feb5ce44bc0585 [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "Random number generator daemon"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=0b6f033afe6db235e559456585dc8cdc"
4
Brad Bishop37a0e4d2017-12-04 01:01:44 -05005SRC_URI = "${SOURCEFORGE_MIRROR}/gkernel/${BP}.tar.gz \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05006 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 Bishopd7bf8c12018-02-25 22:55:05 -05009 file://rng-tools-5-fix-textrels-on-PIC-x86.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040010 file://read_error_msg.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050011 file://init \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012 file://default \
13 file://rngd.service \
14"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050015
16SRC_URI[md5sum] = "6726cdc6fae1f5122463f24ae980dd68"
17SRC_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.
21python () {
22 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
23 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
24}
25
Brad Bishopd7bf8c12018-02-25 22:55:05 -050026inherit autotools update-rc.d systemd
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050027
28PACKAGECONFIG = "libgcrypt"
29PACKAGECONFIG_libc-musl = "libargp"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050030PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050031PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
32
33do_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 Bishopd7bf8c12018-02-25 22:55:05 -050044
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 Williamsd8c66bc2016-06-20 12:57:21 -050050}
51
52INITSCRIPT_NAME = "rng-tools"
53INITSCRIPT_PARAMS = "start 30 2 3 4 5 . stop 30 0 6 1 ."
Brad Bishopd7bf8c12018-02-25 22:55:05 -050054
55SYSTEMD_SERVICE_${PN} = "rngd.service"