1DESCRIPTION = "netkit-rusers includes rusers - Displays who is logged in to machines on local network \
2    rusersd - Logged in users server"
3HOMEPAGE = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
4SECTION = "net"
5LICENSE = "BSD-3-Clause"
6LIC_FILES_CHKSUM = "file://rusers/rusers.c;beginline=2;endline=3;md5=f4fc634a4ce8c569911196b72b10770e"
7DEPENDS = " tcp-wrappers libtirpc rpcbind rpcsvc-proto rpcsvc-proto-native"
8
9SRC_URI = "http://http.debian.net/debian/pool/main/n/${BPN}/${BPN}_${PV}.orig.tar.gz;name=archive \
10           http://http.debian.net/debian/pool/main/n/${BPN}/${BPN}_${PV}-8.diff.gz;name=patch8 \
11           file://rpc.rusersd-Makefile-fix-parallel-build-issue.patch \
12           file://0001-Link-with-libtirpc.patch \
13"
14
15SRC_URI[archive.md5sum] = "dc99a80b9fde2ab427c874f88f1c1602"
16SRC_URI[archive.sha256sum] = "f00138651865ad2dcfec5dedda0cda403cb80c4ab68efcc3bbccafe198c24b6d"
17SRC_URI[patch8.md5sum] = "1ff498113e0f920d92088092e5570bdc"
18SRC_URI[patch8.sha256sum] = "14882dbdda4e37baa84d55b54b46c7e063a20fc9e04d1be1a2807643cd0f3067"
19
20CFLAGS += "-I${STAGING_INCDIR}/tirpc"
21
22EXTRA_OEMAKE = "RUSERSX=${STAGING_INCDIR}/rpcsvc/rusers.x"
23
24do_configure () {
25    ./configure --prefix=${prefix} --installroot=${D} --with-c-compiler="${CC}"
26}
27
28do_install () {
29    install -d ${D}${bindir}
30    install -d ${D}${sbindir}
31    install -d ${D}${mandir}/man1
32    install -d ${D}${mandir}/man8
33    install -d ${D}${sysconfdir}/xinetd.d
34
35    sed -i 's/install -s/install/' rusers/Makefile
36    sed -i 's/install -s/install/' rup/Makefile
37    sed -i 's/install -s/install/' rpc.rusersd/Makefile
38
39    oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
40    'DAEMONMODE=0755' 'MANMODE=0644' \
41    'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
42    'MANDIR=${mandir}' install
43
44    # create the xinetd config file
45    cat >rusersd.conf <<EOF
46 service rusersd
47 {
48    disable     = yes
49    type        = RPC
50    rpc_version = 1-2
51    socket_type = dgram
52    protocol    = udp
53    wait        = yes
54    user        = root
55    server      = ${sbindir}/rpc.rusersd
56 }
57EOF
58    install rusersd.conf ${D}/${sysconfdir}/xinetd.d/rusersd
59}
60
61PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
62FILES:${PN}-client = "${bindir}/*"
63FILES:${PN}-server = "${sbindir}/* ${sysconfdir}"
64FILES:${PN}-doc = "${mandir}"
65FILES:${PN}-dbg = "${prefix}/src/debug \
66            ${bindir}/.debug ${sbindir}/.debug"
67
68RDEPENDS:${PN}-server += "tcp-wrappers xinetd rpcbind"
69
70# http://errors.yoctoproject.org/Errors/Details/186962/
71COMPATIBLE_HOST:libc-musl = 'null'
72SKIP_RECIPE[netkit-rusers] ?= "Fails to build rup.c:51:10: fatal error: rstat.h: No such file or directory"
73