blob: 6796c9be9ee819e13b0b0f381defa06e6d734dcf [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Random number generator daemon"
2LICENSE = "GPLv2"
3LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
4
5SRC_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"
15SRCREV = "4ebc21d6f387bb7b4b3f6badc429e27b21c0a6ee"
16S = "${WORKDIR}/git"
17
18inherit autotools update-rc.d systemd pkgconfig
19
20DEPENDS = " \
21 sysfsutils \
22 "
23
24PACKAGECONFIG ??= "libgcrypt libjitterentropy"
25PACKAGECONFIG_libc-musl = "libargp libjitterentropy"
26PACKAGECONFIG[libargp] = "--with-libargp,--without-libargp,argp-standalone,"
27PACKAGECONFIG[libgcrypt] = "--with-libgcrypt,--without-libgcrypt,libgcrypt,"
28PACKAGECONFIG[libjitterentropy] = "--enable-jitterentropy,--disable-jitterentropy,libjitterentropy"
29PACKAGECONFIG[nistbeacon] = "--with-nistbeacon,--without-nistbeacon,curl libxml2 openssl"
30
31# Refer autogen.sh in rng-tools
32do_configure_prepend() {
33 cp ${S}/README.md ${S}/README
34}
35
36do_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
55INITSCRIPT_NAME = "rng-tools"
56INITSCRIPT_PARAMS = "start 03 2 3 4 5 . stop 30 0 6 1 ."
57
58SYSTEMD_SERVICE_${PN} = "rngd.service"