added my Recipes
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
From 55ab6f1389261edff5f4c942bc3b0d8e695856d7 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 30 Aug 2017 18:11:33 -0700
|
||||
Subject: [PATCH 1/2] Add missing include path to -I options
|
||||
|
||||
Fixes errors like
|
||||
| rwho.c:52:10: fatal error: 'protocols/rwhod.h' file not found
|
||||
| #include <protocols/rwhod.h>
|
||||
| ^~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
rwho/Makefile | 1 +
|
||||
rwhod/Makefile | 2 ++
|
||||
2 files changed, 3 insertions(+)
|
||||
|
||||
diff --git a/rwho/Makefile b/rwho/Makefile
|
||||
index 6f86388..67b28d4 100644
|
||||
--- a/rwho/Makefile
|
||||
+++ b/rwho/Makefile
|
||||
@@ -6,6 +6,7 @@ include ../MRULES
|
||||
rwho: rwho.o
|
||||
$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
|
||||
+CFLAGS += -I../include
|
||||
rwho.o: ../version.h
|
||||
|
||||
install: rwho
|
||||
diff --git a/rwhod/Makefile b/rwhod/Makefile
|
||||
index 772b641..9034218 100644
|
||||
--- a/rwhod/Makefile
|
||||
+++ b/rwhod/Makefile
|
||||
@@ -7,6 +7,8 @@ ifneq ($(USE_GLIBC),1)
|
||||
CFLAGS += -D_GNU_SOURCE
|
||||
endif
|
||||
|
||||
+CFLAGS += -I../include
|
||||
+
|
||||
OBJS = rwhod.o
|
||||
|
||||
rwhod: $(OBJS)
|
||||
--
|
||||
2.14.1
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
From 2108213242638fa355f662382f55495d91301858 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 30 Aug 2017 18:13:17 -0700
|
||||
Subject: [PATCH 2/2] Fix build issues found with musl
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
ruptime/ruptime.c | 1 +
|
||||
rwho/rwho.c | 1 +
|
||||
rwhod/rwhod.c | 5 +++--
|
||||
3 files changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/ruptime/ruptime.c
|
||||
+++ b/ruptime/ruptime.c
|
||||
@@ -53,6 +53,7 @@ char ruptime_rcsid[] =
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
+#include <fcntl.h>
|
||||
|
||||
struct hs {
|
||||
char hs_hostname[MAXHOSTNAMELEN];
|
||||
--- a/rwho/rwho.c
|
||||
+++ b/rwho/rwho.c
|
||||
@@ -49,6 +49,7 @@ char rcsid[] = "$Id: rwho.c,v 1.7 1999/0
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
+#include <fcntl.h>
|
||||
#include <protocols/rwhod.h>
|
||||
|
||||
#include "../version.h"
|
||||
--- a/rwhod/rwhod.c
|
||||
+++ b/rwhod/rwhod.c
|
||||
@@ -76,6 +76,7 @@ char rcsid[] =
|
||||
#include <grp.h>
|
||||
#include <time.h>
|
||||
#include <stdint.h>
|
||||
+#include <fcntl.h>
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
@@ -102,7 +103,7 @@ struct nlist nl[] = {
|
||||
static void broadcaster(void);
|
||||
static int configure(int s);
|
||||
static int verify(const char *name);
|
||||
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
|
||||
+#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2))
|
||||
static int getloadavg(double ptr[3], int n);
|
||||
#endif
|
||||
|
||||
@@ -549,7 +550,7 @@ sendpacket(struct whod *wd)
|
||||
}
|
||||
}
|
||||
|
||||
-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
|
||||
+#if defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2))
|
||||
/*
|
||||
* Taken from:
|
||||
*
|
||||
--- a/include/protocols/rwhod.h
|
||||
+++ b/include/protocols/rwhod.h
|
||||
@@ -37,6 +37,7 @@
|
||||
#ifndef _RWHOD_H_
|
||||
#define _RWHOD_H_
|
||||
|
||||
+#include <stdint.h>
|
||||
/*
|
||||
* rwho protocol packet format.
|
||||
*/
|
||||
@@ -0,0 +1,71 @@
|
||||
#!/bin/sh
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: rwhod
|
||||
# Required-Start: $network $remote_fs $syslog
|
||||
# Required-Stop: $network $remote_fs $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Server for rwho and ruptime services
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/sbin:/bin:/usr/bin:/usr/sbin
|
||||
|
||||
DAEMON=/usr/sbin/rwhod
|
||||
PIDFILE=/var/run/rwhod.pid
|
||||
CONF_FILE="/etc/default/rwhod"
|
||||
DESC="Who daemon "
|
||||
# default options. Change them in /etc/default/rwhod
|
||||
RWHOD_OPTIONS="-b"
|
||||
|
||||
# rwhod init.d script for ntpdc from ntp.isc.org
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
[ -r $CONF_FILE ] && . $CONF_FILE
|
||||
|
||||
startdaemon(){
|
||||
echo -n "Starting $DESC" " rwhod "
|
||||
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON -- $RWHOD_OPTIONS
|
||||
echo "done"
|
||||
}
|
||||
stopdaemon(){
|
||||
echo -n "Stopping $DESC" " rwhod "
|
||||
start-stop-daemon --stop --quiet --oknodo --exec $DAEMON
|
||||
echo "done"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
startdaemon
|
||||
;;
|
||||
stop)
|
||||
stopdaemon
|
||||
;;
|
||||
force-reload)
|
||||
stopdaemon
|
||||
startdaemon
|
||||
;;
|
||||
restart)
|
||||
stopdaemon
|
||||
sleep 1
|
||||
startdaemon
|
||||
;;
|
||||
reload)
|
||||
stopdaemon
|
||||
sleep 1
|
||||
startdaemon
|
||||
;;
|
||||
status)
|
||||
status /usr/sbin/rwhod;
|
||||
exit $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: rwhod { start | stop | status | restart | reload }" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,2 @@
|
||||
#Options for the rwhod daemon.
|
||||
RWHOD_OPTIONS="-b"
|
||||
@@ -0,0 +1,108 @@
|
||||
DESCRIPTION = "netkit-rwho includes, ruptime rwho and rwhod (Daemon to maintain data for rwho/ruptime)"
|
||||
HOMEPAGE = "ftp://ftp.uk.linux.org/pub/linux/Networking/netkit"
|
||||
SECTION = "net"
|
||||
LICENSE = "BSD-4-Clause"
|
||||
LIC_FILES_CHKSUM = "file://rwho/rwho.c;beginline=2;endline=3;md5=5a85f13c0142d72fc378e00f15da5b9e"
|
||||
|
||||
SRC_URI = "${DEBIAN_MIRROR}/main/n/netkit-rwho/netkit-rwho_${PV}.orig.tar.gz;name=archive \
|
||||
${DEBIAN_MIRROR}/main/n/netkit-rwho/netkit-rwho_${PV}-13.debian.tar.gz;subdir=${BP};name=patch13 \
|
||||
file://rwhod \
|
||||
file://rwhod.default \
|
||||
file://0001-Add-missing-include-path-to-I-options.patch \
|
||||
file://0002-Fix-build-issues-found-with-musl.patch \
|
||||
"
|
||||
SRC_URI[archive.md5sum] = "0f71620d45d472f89134ba0d74242e75"
|
||||
SRC_URI[archive.sha256sum] = "0409e2ce4bfdb2dacb2c193d0fedfc49bb975cb057c5c6b0ffcca603a1188da7"
|
||||
SRC_URI[patch13.md5sum] = "82ed5a3c6b0bbf00b36508b9787963b9"
|
||||
SRC_URI[patch13.sha256sum] = "53aefa27d98b565bf756db57120c03bd224a238e45699d92076420272a6eba8e"
|
||||
|
||||
inherit autotools-brokensep useradd update-rc.d update-alternatives
|
||||
|
||||
CFLAGS += " -D_GNU_SOURCE"
|
||||
|
||||
# Unlike other Debian packages, net-tools *.diff.gz contains another series of
|
||||
# patches maintained by quilt. So manually apply them before applying other local
|
||||
# patches. Also remove all temp files before leaving, because do_patch() will pop
|
||||
# up all previously applied patches in the start
|
||||
do_patch[depends] += "quilt-native:do_populate_sysroot"
|
||||
netkit_do_patch() {
|
||||
cd ${S}
|
||||
# it's important that we only pop the existing patches when they've
|
||||
# been applied, otherwise quilt will climb the directory tree
|
||||
# and reverse out some completely different set of patches
|
||||
if [ -d ${S}/patches ]; then
|
||||
# whilst this is the default directory, doing it like this
|
||||
# defeats the directory climbing that quilt will otherwise
|
||||
# do; note the directory must exist to defeat this, hence
|
||||
# the test inside which we operate
|
||||
QUILT_PATCHES=${S}/patches quilt pop -a
|
||||
fi
|
||||
if [ -d ${S}/.pc-${BPN} ]; then
|
||||
rm -rf ${S}/.pc
|
||||
mv ${S}/.pc-${BPN} ${S}/.pc
|
||||
QUILT_PATCHES=${S}/debian/patches quilt pop -a
|
||||
rm -rf ${S}/.pc ${S}/debian
|
||||
fi
|
||||
QUILT_PATCHES=${S}/debian/patches quilt push -a
|
||||
mv ${S}/.pc ${S}/.pc-${BPN}
|
||||
}
|
||||
|
||||
do_unpack[cleandirs] += "${S}"
|
||||
|
||||
python do_patch() {
|
||||
bb.build.exec_func('netkit_do_patch', d)
|
||||
bb.build.exec_func('patch_do_patch', d)
|
||||
}
|
||||
|
||||
do_configure () {
|
||||
./configure --prefix=${prefix}
|
||||
echo "LDFLAGS=${LDFLAGS}" >> MCONFIG
|
||||
}
|
||||
|
||||
do_install () {
|
||||
# rwho & ruptime
|
||||
install -d ${D}${bindir}
|
||||
install -d ${D}${mandir}/man1
|
||||
#rwhod
|
||||
install -d ${D}${sbindir}
|
||||
install -d ${D}${mandir}/man8
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -d ${D}${sysconfdir}/default
|
||||
sed -i 's/install -s/install/' rwho/Makefile
|
||||
sed -i 's/install -s/install/' ruptime/Makefile
|
||||
sed -i 's/install -s/install/' rwhod/Makefile
|
||||
oe_runmake 'INSTALLROOT=${D}' 'BINMODE=0755' \
|
||||
'DAEMONMODE=0755' 'MANMODE=0644' \
|
||||
'BINDIR=${bindir}' 'SBINDIR=${sbindir}' \
|
||||
'MANDIR=${mandir}' install
|
||||
|
||||
install -m 0644 ${WORKDIR}/rwhod.default ${D}${sysconfdir}/default/rwhod
|
||||
install -m 755 ${WORKDIR}/rwhod ${D}${sysconfdir}/init.d
|
||||
|
||||
mkdir -p -m 755 ${D}${localstatedir}/spool/rwho
|
||||
chown -R rwhod ${D}${localstatedir}/spool/rwho
|
||||
}
|
||||
pkg_postinst_ontarget:${PN}-server() {
|
||||
${sysconfdir}/init.d/rwhod start
|
||||
}
|
||||
|
||||
pkg_postrm:${PN}-server() {
|
||||
${sysconfdir}/init.d/rwhod stop
|
||||
}
|
||||
|
||||
INITSCRIPT_NAME = "rwhod"
|
||||
INITSCRIPT_PARAM = "defaults 85 15"
|
||||
|
||||
USERADD_PACKAGES = "${PN}-server"
|
||||
GROUPADD_PARAM:${PN}-server = "--system rwhod"
|
||||
USERADD_PARAM:${PN}-server = "--system -g rwhod --home-dir ${localstatedir}/spool/rwho \
|
||||
--no-create-home --shell /bin/false rwhod"
|
||||
|
||||
INSANE_SKIP:${PN} = "already-stripped"
|
||||
|
||||
PACKAGES = "${PN}-client ${PN}-server ${PN}-doc ${BPN}-dbg"
|
||||
FILES:${PN}-client = "${bindir}/*"
|
||||
FILES:${PN}-server = "${sbindir}/* ${localstatedir} ${sysconfdir}/default/* ${sysconfdir}/init.d/*"
|
||||
FILES:${PN}-doc = "${mandir}"
|
||||
FILES:${PN}-dbg = "${prefix}/src/debug \
|
||||
${bindir}/.debug ${sbindir}/.debug"
|
||||
Reference in New Issue
Block a user