blob: 60a8d95b06adf31ec3a49e0a6ac6d9ec2c1c75f0 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001DESCRIPTION = "netkit-rwho includes, ruptime rwho and rwhod (Daemon to maintain data for rwho/ruptime)"
2HOMEPAGE = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
3SECTION = "net"
Brad Bishop2d39a062019-10-28 08:33:36 -04004LICENSE = "BSD-4-Clause"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05005LIC_FILES_CHKSUM = "file://rwho/rwho.c;beginline=2;endline=3;md5=5a85f13c0142d72fc378e00f15da5b9e"
6
7SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-rwho/netkit-rwho_${PV}.orig.tar.gz;name=archive \
8 ${DEBIAN_MIRROR}/main/n/netkit-rwho/netkit-rwho_${PV}-13.debian.tar.gz;name=patch13 \
9 file://rwhod \
10 file://rwhod.default \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050011 file://0001-Add-missing-include-path-to-I-options.patch \
12 file://0002-Fix-build-issues-found-with-musl.patch \
13 "
Patrick Williamsb48b7b42016-08-17 15:04:38 -050014SRC_URI[archive.md5sum] = "0f71620d45d472f89134ba0d74242e75"
15SRC_URI[archive.sha256sum] = "0409e2ce4bfdb2dacb2c193d0fedfc49bb975cb057c5c6b0ffcca603a1188da7"
16SRC_URI[patch13.md5sum] = "82ed5a3c6b0bbf00b36508b9787963b9"
17SRC_URI[patch13.sha256sum] = "53aefa27d98b565bf756db57120c03bd224a238e45699d92076420272a6eba8e"
18
19inherit autotools-brokensep useradd update-rc.d update-alternatives
20
21CFLAGS += " -D_GNU_SOURCE"
22
23debian_do_patch() {
24 cd ${S}
25 while read line; do patch -p1 < ${WORKDIR}/debian/patches/$line; done < ${WORKDIR}/debian/patches/series
26}
27
28python do_patch() {
29 bb.build.exec_func('debian_do_patch', d)
30 bb.build.exec_func('patch_do_patch', d)
31}
32
33do_configure () {
34 ./configure --prefix=${prefix}
35 echo "LDFLAGS=${LDFLAGS}" >> MCONFIG
36}
37
38do_install () {
39 # rwho & ruptime
40 install -d ${D}${bindir}
41 install -d ${D}${mandir}/man1
42 #rwhod
43 install -d ${D}${sbindir}
44 install -d ${D}${mandir}/man8
45 install -d ${D}${sysconfdir}/init.d
46 install -d ${D}${sysconfdir}/default
47 sed -i 's/install -s/install/' rwho/Makefile
48 sed -i 's/install -s/install/' ruptime/Makefile
49 sed -i 's/install -s/install/' rwhod/Makefile
50 oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
51 'DAEMONMODE=0755' 'MANMODE=0644' \
52 'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
53 'MANDIR=${mandir}' install
54
55 install -m 0644 ${WORKDIR}/rwhod.default ${D}${sysconfdir}/default/rwhod
56 install -m 755 ${WORKDIR}/rwhod ${D}${sysconfdir}/init.d
57
58 mkdir -p -m 755 ${D}${localstatedir}/spool/rwho
59 chown -R rwhod ${D}${localstatedir}/spool/rwho
60}
61
62pkg_postinst_${PN}-server() {
63 ${sysconfdir}/init.d/rwhod start
64}
65
66pkg_postrm_${PN}-server() {
67 ${sysconfdir}/init.d/rwhod stop
68}
69
70INITSCRIPT_NAME = "rwhod"
71INITSCRIPT_PARAM = "defaults 85 15"
72
73USERADD_PACKAGES = "${PN}-server"
74GROUPADD_PARAM_${PN}-server = "--system rwhod"
75USERADD_PARAM_${PN}-server = "--system -g rwhod --home-dir ${localstatedir}/spool/rwho \
76 --no-create-home --shell /bin/false rwhod"
77
78INSANE_SKIP_${PN} = "already-stripped"
79
80PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
81FILES_${PN}-client = "${bindir}/*"
82FILES_${PN}-server = "${sbindir}/* ${localstatedir} ${sysconfdir}/default/* ${sysconfdir}/init.d/*"
83FILES_${PN}-doc = "${mandir}"
84FILES_${PN}-dbg = "${prefix}/src/debug \
85 ${bindir}/.debug ${sbindir}/.debug"