added my Recipes
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
#! /bin/sh
|
||||
# Copyright (c) 2004 Author: Thorsten Kukuk <kukuk@suse.de>
|
||||
#
|
||||
# /etc/init.d/ypbind
|
||||
#
|
||||
# and symbolic its link
|
||||
#
|
||||
# /usr/sbin/rcypbind
|
||||
#
|
||||
# System startup script for the ypbind daemon
|
||||
#
|
||||
### BEGIN INIT INFO
|
||||
# Provides: ypbind
|
||||
# Required-Start: $remote_fs $portmap
|
||||
# Should-Start: ypserv slpd
|
||||
# Required-Stop: portmap
|
||||
# Default-Start: 3 5
|
||||
# Default-Stop: 0 1 2 6
|
||||
# Short-Description: Start ypbind (necessary for a NIS client)
|
||||
# Description: ypbind finds the server for NIS domains and maintains
|
||||
# the NIS binding information.
|
||||
### END INIT INFO
|
||||
|
||||
# Need to use status function
|
||||
. /etc/init.d/functions
|
||||
|
||||
YPBIND_BIN=/usr/sbin/ypbind
|
||||
pidfile=/var/run/ypbind.pid
|
||||
YPDOMAINNAME_bin=/usr/bin/ypdomainname
|
||||
|
||||
[ -f /etc/default/ypbind ] && . /etc/default/ypbind
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting ypbind"
|
||||
## If the domainname is not set, skip starting of ypbind
|
||||
## and return with "program not configured"
|
||||
$YPDOMAINNAME_bin >/dev/null 2>&1
|
||||
if [ $? -ne 0 -o -z "`$YPDOMAINNAME_bin 2>/dev/null`" ]; then
|
||||
if [ -f /etc/defaultdomain ]; then
|
||||
XDOMAINNAME=`cat /etc/defaultdomain`
|
||||
$YPDOMAINNAME_bin "$XDOMAINNAME"
|
||||
fi
|
||||
$YPDOMAINNAME_bin >/dev/null 2>&1
|
||||
if [ $? -ne 0 -o -z "`$YPDOMAINNAME_bin 2>/dev/null`" ]; then
|
||||
# Tell the user this has skipped
|
||||
echo -n " . . . . . . . . . . No domainname set"
|
||||
# service is not configured
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
## If we don't have a /etc/yp.conf file, skip starting of
|
||||
## ypbind and return with "program not configured"
|
||||
## if you add the -broadcast Option later, comment this out.
|
||||
if [ ! -f /etc/yp.conf -a "$YPBIND_BROADCAST" != "yes" ] ; then
|
||||
# Tell the user this has skipped
|
||||
echo -n " . . . . . . . . . . ${attn}/etc/yp.conf not found${norm}"
|
||||
# service is not configured
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# evaluate the OPTIONS for ypbind-mt
|
||||
OPTIONS=""
|
||||
test "$YPBIND_LOCAL_ONLY" = "yes" && OPTIONS="-local-only $OPTIONS"
|
||||
test "$YPBIND_BROADCAST" = "yes" && OPTIONS="-broadcast $OPTIONS"
|
||||
test "$YPBIND_BROKEN_SERVER" = "yes" && OPTIONS="-broken-server $OPTIONS"
|
||||
|
||||
start-stop-daemon --start --quiet --pidfile $pidfile --exec $YPBIND_BIN -- $YPBIND_OPTIONS $OPTIONS
|
||||
if [ $? -eq 0 ]; then
|
||||
notfound=1
|
||||
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
|
||||
ypwhich >/dev/null 2>&1 && { notfound=0 ; break; };
|
||||
echo -n " ."
|
||||
sleep 1;
|
||||
done
|
||||
if [ $notfound -eq 1 ]; then
|
||||
echo -n " ${warn}No NIS server found${norm}";
|
||||
fi
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo -n "Shutting down ypbind"
|
||||
start-stop-daemon --stop --quiet --pidfile $pidfile
|
||||
# Remove static data, else glibc will continue to use NIS
|
||||
rm -f /var/yp/binding/* /var/run/ypbind.pid
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
reload | force-reload)
|
||||
echo -n "Reload service ypbind"
|
||||
start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile
|
||||
;;
|
||||
status)
|
||||
echo -n "Checking for ypbind: "
|
||||
status $YPBIND_BIN
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,22 @@
|
||||
# This include file contains global definitions for the
|
||||
# various NIS packages.
|
||||
#
|
||||
# These packages will only function correctly with glibc -
|
||||
# the rpcsvc functionality is not present in uclibc
|
||||
DESCRIPTION = "NIS Server and Tools"
|
||||
HOMEPAGE = "http://www.linux-nis.org/nis/"
|
||||
SECTION = "net"
|
||||
LICENSE = "GPL-2.0-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
|
||||
|
||||
inherit autotools gettext pkgconfig
|
||||
|
||||
# install is broken because src/Makefile heroically adds '-s'
|
||||
# to the install flags - passing -s to the build /usr/bin/install!
|
||||
# install-strip gets it right but installs ypbind -m <default>,
|
||||
# not -m 555. In an OE build this is not, so far as I can see,
|
||||
# a security problem (and this fix to the build problem is *much*
|
||||
# easier and more maintainable.)
|
||||
do_install() {
|
||||
oe_runmake 'DESTDIR=${D}' install-strip
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=NIS Domainname
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
EnvironmentFile=/etc/nisdomainname
|
||||
ExecStart=/usr/bin/domainname $NISDOMAINNAME
|
||||
RemainAfterExit=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# This package builds tools to manage NIS
|
||||
# The source package is utils/net/NIS/yp-tools
|
||||
#
|
||||
require nis.inc
|
||||
|
||||
SUMMARY = "NIS client programs"
|
||||
DESCRIPTION = " \
|
||||
Network Information Service tools. \
|
||||
This package contains ypcat, ypmatch, ypset, \
|
||||
ypwhich, yppasswd, domainname, nisdomainname \
|
||||
and ypdomainname. \
|
||||
\
|
||||
This is the final IPv4-only version of yp-tools. \
|
||||
"
|
||||
|
||||
SRC_URI = "http://www.linux-nis.org/download/yp-tools/${BP}.tar.bz2 \
|
||||
file://domainname.service \
|
||||
"
|
||||
SRC_URI[md5sum] = "ba1f121c17e3ad65368be173b977cd13"
|
||||
SRC_URI[sha256sum] = "d01f70fadc643a55107a0edc47c6be99d0306bcc4f66df56f65e74238b0124c9"
|
||||
|
||||
inherit systemd
|
||||
SYSTEMD_SERVICE:${PN} = "domainname.service"
|
||||
|
||||
RPROVIDES:${PN} += "${PN}-systemd"
|
||||
RREPLACES:${PN} += "${PN}-systemd"
|
||||
RCONFLICTS:${PN} += "${PN}-systemd"
|
||||
|
||||
CACHED_CONFIGUREVARS += "ac_cv_prog_STRIP=/bin/true"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/domainname.service ${D}${systemd_unitdir}/system
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
# This package builds tools to manage NIS
|
||||
# The source package is utils/net/NIS/yp-tools
|
||||
#
|
||||
require nis.inc
|
||||
|
||||
SUMMARY = "NIS client programs"
|
||||
DESCRIPTION = " \
|
||||
Network Information Service tools. \
|
||||
This package contains ypcat, ypmatch, ypset, \
|
||||
ypwhich, yppasswd, domainname, nisdomainname \
|
||||
and ypdomainname. \
|
||||
"
|
||||
|
||||
# v4.2.3
|
||||
SRCREV = "1bfda29c342a81b97cb1995ffd9e8da5de63e7ab"
|
||||
|
||||
SRC_URI = "git://github.com/thkukuk/yp-tools;branch=master;protocol=https \
|
||||
file://domainname.service \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
DEPENDS = "libtirpc libnsl2 virtual/crypt"
|
||||
|
||||
inherit autotools systemd
|
||||
SYSTEMD_SERVICE:${PN} = "domainname.service"
|
||||
|
||||
RPROVIDES:${PN} += "${PN}-systemd"
|
||||
RREPLACES:${PN} += "${PN}-systemd"
|
||||
RCONFLICTS:${PN} += "${PN}-systemd"
|
||||
|
||||
CACHED_CONFIGUREVARS += "ac_cv_prog_STRIP=/bin/true"
|
||||
|
||||
EXTRA_OECONF = " \
|
||||
--disable-rpath --disable-domainname \
|
||||
"
|
||||
CFLAGS:append:libc-musl = " -Wno-error=cpp"
|
||||
|
||||
FILES:${PN} += " ${libdir}/yp-nis/*.so.*.* ${libdir}/yp-nis/pkgconfig/"
|
||||
FILES:${PN}-dbg += " ${libdir}/yp-nis/.debug"
|
||||
FILES:${PN}-dev += " ${libdir}/yp-nis/*.so ${libdir}/yp-nis/*.so.[12] ${libdir}/yp-nis/*.la"
|
||||
FILES:${PN}-staticdev += " ${libdir}/yp-nis/*.a"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/domainname.service ${D}${systemd_unitdir}/system
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
From 5452961750275b1e3f7c95e9528338f0ee0357ad Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Thu, 14 Sep 2017 09:17:35 -0700
|
||||
Subject: [PATCH] dns_hosts: Fix build with musl
|
||||
|
||||
Add NETDB_* defines which are not available in musl
|
||||
remove need for sys/cdefs.h by remove __P
|
||||
Add _GNU_SOURCE for missing u_char definition
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
Upstream-Status: Pending
|
||||
|
||||
lib/Makefile.am | 2 +-
|
||||
lib/dns_hosts.c | 9 ++++++++-
|
||||
2 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/Makefile.am b/lib/Makefile.am
|
||||
index 977a8db..35cb5b3 100644
|
||||
--- a/lib/Makefile.am
|
||||
+++ b/lib/Makefile.am
|
||||
@@ -8,7 +8,7 @@
|
||||
noinst_LIBRARIES = libcompat.a
|
||||
noinst_HEADERS = ypbind3_binding.h
|
||||
|
||||
-AM_CFLAGS = -D_REENTRANT=1 @WARNFLAGS@
|
||||
+AM_CFLAGS = -D_GNU_SOURCE -D_REENTRANT=1 @WARNFLAGS@
|
||||
AM_CPPFLAGS = -I$(srcdir) @TIRPC_CFLAGS@ @NSL_CFLAGS@ -DLOCALEDIR=\"$(localedir)\"
|
||||
|
||||
libcompat_a_SOURCES = dns_hosts.c res_options.h ypbind3_binding_dup.c \
|
||||
diff --git a/lib/dns_hosts.c b/lib/dns_hosts.c
|
||||
index fd421fd..6067879 100644
|
||||
--- a/lib/dns_hosts.c
|
||||
+++ b/lib/dns_hosts.c
|
||||
@@ -64,6 +64,7 @@
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/socket.h>
|
||||
+#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <arpa/nameser.h>
|
||||
@@ -84,6 +85,12 @@ extern struct hostent *_gethtbyaddr(const char *, int, int);
|
||||
#ifndef LOG_AUTH
|
||||
# define LOG_AUTH 0
|
||||
#endif
|
||||
+#ifndef NETDB_SUCCESS
|
||||
+# define NETDB_SUCCESS 0
|
||||
+#endif
|
||||
+#ifndef NETDB_INTERNAL
|
||||
+# define NETDB_INTERNAL -1
|
||||
+#endif
|
||||
|
||||
#define MULTI_PTRS_ARE_ALIASES 1 /* XXX - experimental */
|
||||
|
||||
@@ -101,7 +108,7 @@ static char hostbuf[8*1024];
|
||||
static struct in_addr host_addr;
|
||||
|
||||
#ifdef RESOLVSORT
|
||||
-static void addrsort __P((char **, int));
|
||||
+static void addrsort (char **, int);
|
||||
#endif
|
||||
|
||||
#if PACKETSZ > 1024
|
||||
--
|
||||
2.14.1
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=YP Bind
|
||||
Requires=domainname.service
|
||||
After=domainname.service network.target
|
||||
Before=systemd-user-sessions.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
PIDFile=/var/run/ypbind.pid
|
||||
ExecStart=/usr/sbin/ypbind
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# This package builds the NIS ypbind daemon
|
||||
# The source package is utils/net/NIS/ypbind-mt
|
||||
#
|
||||
require nis.inc
|
||||
|
||||
DESCRIPTION = " \
|
||||
Multithreaded NIS bind service (ypbind-mt). \
|
||||
ypbind-mt is a complete new implementation of a NIS \
|
||||
binding daemon for Linux. It has the following \
|
||||
features. Supports ypbind protocol V1 and V2. \
|
||||
Uses threads for better response. Supports multiple \
|
||||
domain bindings. Supports /var/yp/binding/* file \
|
||||
for Linux libc 4/5 and glibc 2.x. Supports a list \
|
||||
of known secure NIS server (/etc/yp.conf) Binds to \
|
||||
the server which answered as first. \
|
||||
\
|
||||
This is the final IPv4-only version of ypbind-mt. \
|
||||
"
|
||||
HOMEPAGE = "https://github.com/thkukuk/ypbind-mt/"
|
||||
DEPENDS = " \
|
||||
yp-tools \
|
||||
${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
|
||||
"
|
||||
DEPENDS:append:libc-musl = " bsd-headers nss"
|
||||
RDEPENDS:${PN} += "yp-tools"
|
||||
|
||||
# ypbind-mt now provides all the functionality of ypbind
|
||||
# and is used in place of it.
|
||||
PROVIDES += "ypbind"
|
||||
|
||||
SRC_URI = "https://github.com/thkukuk/ypbind-mt/releases/download/v${PV}/${BPN}-${PV}.tar.xz \
|
||||
file://0001-dns_hosts-Fix-build-with-musl.patch \
|
||||
file://ypbind.init \
|
||||
file://ypbind.service \
|
||||
"
|
||||
SRC_URI[sha256sum] = "064f2f185673c5493df83f6400b799f3a359de56118b6ba37c4327111f2fcd8b"
|
||||
|
||||
inherit systemd update-rc.d
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "ypbind.service"
|
||||
INITSCRIPT_NAME = "ypbind"
|
||||
INITSCRIPT_PARAMS = "start 44 3 5 . stop 70 0 1 2 6 ."
|
||||
|
||||
CACHED_CONFIGUREVARS = "ac_cv_prog_STRIP=/bin/true"
|
||||
|
||||
CFLAGS:append = " -I${STAGING_INCDIR}/nss3 -I${STAGING_INCDIR}/nspr"
|
||||
|
||||
do_install:append () {
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -d ${D}${sysconfdir}/rcS.d
|
||||
|
||||
install -m 0755 ${WORKDIR}/ypbind.init ${D}${sysconfdir}/init.d/ypbind
|
||||
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/ypbind.service ${D}${systemd_unitdir}/system
|
||||
}
|
||||
|
||||
# uses glibc internal APIs e.g. _hostalias
|
||||
COMPATIBLE_HOST:libc-musl = "null"
|
||||
|
||||
RPROVIDES:${PN} += "${PN}-systemd"
|
||||
RREPLACES:${PN} += "${PN}-systemd"
|
||||
RCONFLICTS:${PN} += "${PN}-systemd"
|
||||
Reference in New Issue
Block a user