summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/nis
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
commit1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch)
tree0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking/recipes-support/nis
downloadmeta-openembedded-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking/recipes-support/nis')
-rw-r--r--meta-networking/recipes-support/nis/files/libdl.patch12
-rw-r--r--meta-networking/recipes-support/nis/files/no-selinux.patch16
-rw-r--r--meta-networking/recipes-support/nis/files/ypbind-yocto.init99
-rw-r--r--meta-networking/recipes-support/nis/nis.inc31
-rw-r--r--meta-networking/recipes-support/nis/yp-tools/domainname.service12
-rw-r--r--meta-networking/recipes-support/nis/yp-tools_2.12.bb31
-rw-r--r--meta-networking/recipes-support/nis/ypbind-mt/ypbind.service14
-rw-r--r--meta-networking/recipes-support/nis/ypbind-mt_1.36.bb52
8 files changed, 267 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/nis/files/libdl.patch b/meta-networking/recipes-support/nis/files/libdl.patch
new file mode 100644
index 0000000000..605af319f9
--- /dev/null
+++ b/meta-networking/recipes-support/nis/files/libdl.patch
@@ -0,0 +1,12 @@
1--- pwdutils-2.6/configure.in.orig 2005-04-19 20:22:36.603052192 -0700
2+++ pwdutils-2.6/configure.in 2005-04-19 21:09:45.308023672 -0700
3@@ -178,6 +178,9 @@
4 AC_CHECK_LIB(ldap, main, LDAP_LIBS="-lldap $LDAP_LIBS" found_ldap_lib=yes,,$LDAP_LIBS)
5 fi
6
7+ dnl this always needs dl
8+ AC_CHECK_LIB(dl, dlopen, LDAP_LIBS="$LDAP_LIBS -ldl")
9+
10 if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then
11 AC_CHECK_LIB(ldap50, main, LDAP_LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4" found_ldap_lib=yes need_pthread=true,, -lpthread)
12 fi
diff --git a/meta-networking/recipes-support/nis/files/no-selinux.patch b/meta-networking/recipes-support/nis/files/no-selinux.patch
new file mode 100644
index 0000000000..71da3e3931
--- /dev/null
+++ b/meta-networking/recipes-support/nis/files/no-selinux.patch
@@ -0,0 +1,16 @@
1--- pwdutils-2.6/lib/copy_xattr.c.orig 2005-04-16 17:15:52.916660880 -0700
2+++ pwdutils-2.6/lib/copy_xattr.c 2005-04-16 17:18:10.345768480 -0700
3@@ -127,8 +127,11 @@
4
5 if (lsetxattr (to, name, value, size, 0) != 0)
6 {
7- if (strcmp (name, "security.selinux") == 0 &&
8- is_selinux_enabled() == 0)
9+ if (strcmp (name, "security.selinux") == 0
10+#if defined(WITH_SELINUX)
11+ && is_selinux_enabled() == 0
12+#endif
13+ )
14 fprintf (stderr,
15 _("SELinux not enabled, ignore attribute %s for `%s'.\n"),
16 name, to);
diff --git a/meta-networking/recipes-support/nis/files/ypbind-yocto.init b/meta-networking/recipes-support/nis/files/ypbind-yocto.init
new file mode 100644
index 0000000000..5f50a530e7
--- /dev/null
+++ b/meta-networking/recipes-support/nis/files/ypbind-yocto.init
@@ -0,0 +1,99 @@
1#! /bin/sh
2# Copyright (c) 2004 Author: Thorsten Kukuk <kukuk@suse.de>
3#
4# /etc/init.d/ypbind
5#
6# and symbolic its link
7#
8# /usr/sbin/rcypbind
9#
10# System startup script for the ypbind daemon
11#
12### BEGIN INIT INFO
13# Provides: ypbind
14# Required-Start: $remote_fs $portmap
15# Should-Start: ypserv slpd
16# Required-Stop: portmap
17# Default-Start: 3 5
18# Default-Stop: 0 1 2 6
19# Short-Description: Start ypbind (necessary for a NIS client)
20# Description: ypbind finds the server for NIS domains and maintains
21# the NIS binding information.
22### END INIT INFO
23
24YPBIND_BIN=/usr/sbin/ypbind
25pidfile=/var/run/ypbind.pid
26
27[ -f /etc/default/ypbind ] && . /etc/default/ypbind
28
29case "$1" in
30 start)
31 echo -n "Starting ypbind"
32 ## If the domainname is not set, skip starting of ypbind
33 ## and return with "program not configured"
34 /bin/ypdomainname &> /dev/null
35 if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then
36 if [ -f /etc/defaultdomain ]; then
37 XDOMAINNAME=`cat /etc/defaultdomain`
38 /bin/ypdomainname "$XDOMAINNAME"
39 fi
40 /bin/ypdomainname &> /dev/null
41 if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then
42 # Tell the user this has skipped
43 echo -n " . . . . . . . . . . No domainname set"
44 # service is not configured
45 exit 1
46 fi
47 fi
48
49 ## If we don't have a /etc/yp.conf file, skip starting of
50 ## ypbind and return with "program not configured"
51 ## if you add the -broadcast Option later, comment this out.
52 if [ ! -f /etc/yp.conf -a "$YPBIND_BROADCAST" != "yes" ] ; then
53 # Tell the user this has skipped
54 echo -n " . . . . . . . . . . ${attn}/etc/yp.conf not found${norm}"
55 # service is not configured
56 exit 1
57 fi
58
59 # evaluate the OPTIONS for ypbind-mt
60 OPTIONS=""
61 test "$YPBIND_LOCAL_ONLY" = "yes" && OPTIONS="-local-only $OPTIONS"
62 test "$YPBIND_BROADCAST" = "yes" && OPTIONS="-broadcast $OPTIONS"
63 test "$YPBIND_BROKEN_SERVER" = "yes" && OPTIONS="-broken-server $OPTIONS"
64
65 start-stop-daemon --start --quiet --pidfile $pidfile --exec $YPBIND_BIN -- $YPBIND_OPTIONS $OPTIONS
66 if [ $? -eq 0 ]; then
67 notfound=1
68 for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
69 ypwhich &>/dev/null && { notfound=0 ; break; };
70 echo -n " ."
71 sleep 1;
72 done
73 if [ $notfound -eq 1 ]; then
74 echo -n " ${warn}No NIS server found${norm}";
75 fi
76 else
77 exit 1
78 fi
79 ;;
80 stop)
81 echo -n "Shutting down ypbind"
82 start-stop-daemon --stop --quiet --pidfile $pidfile
83 # Remove static data, else glibc will continue to use NIS
84 rm -f /var/yp/binding/* /var/run/ypbind.pid
85 ;;
86 restart)
87 $0 stop
88 sleep 1
89 $0 start
90 ;;
91 reload | force-reload)
92 echo -n "Reload service ypbind"
93 start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile
94 ;;
95 *)
96 echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
97 exit 1
98 ;;
99esac
diff --git a/meta-networking/recipes-support/nis/nis.inc b/meta-networking/recipes-support/nis/nis.inc
new file mode 100644
index 0000000000..075d2756d9
--- /dev/null
+++ b/meta-networking/recipes-support/nis/nis.inc
@@ -0,0 +1,31 @@
1# This include file contains global definitions for the
2# various NIS packages.
3#
4# These packages will only function correctly with glibc -
5# the rpcsvc functionality is not present in uclibc
6DESCRIPTION = "NIS Server and Tools"
7HOMEPAGE = "http://www.linux-nis.org/nis/"
8SECTION = "console/network"
9LICENSE = "GPL-2.0"
10LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
11
12inherit autotools gettext pkgconfig
13
14# install is broken because src/Makefile heroically adds '-s'
15# to the install flags - passing -s to the build /usr/bin/install!
16# install-strip gets it right but installs ypbind -m <default>,
17# not -m 555. In an OE build this is not, so far as I can see,
18# a security problem (and this fix to the build problem is *much*
19# easier and more maintainable.)
20do_install() {
21 oe_runmake 'DESTDIR=${D}' install-strip
22}
23
24# An attempt to build on uclibc will fail, causing annoyance,
25# so force the package to be skipped here (this will cause a
26# 'nothing provides' error)
27python () {
28 os = bb.data.getVar("TARGET_OS", d, 1)
29 if os == "linux-uclibc":
30 raise bb.parse.SkipPackage("NIS functionality requires rpcsvc/yp.h, uClibC does not provide this")
31}
diff --git a/meta-networking/recipes-support/nis/yp-tools/domainname.service b/meta-networking/recipes-support/nis/yp-tools/domainname.service
new file mode 100644
index 0000000000..21aa92cb36
--- /dev/null
+++ b/meta-networking/recipes-support/nis/yp-tools/domainname.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=NIS Domainname
3
4[Service]
5Type=oneshot
6EnvironmentFile=/etc/nisdomainname
7ExecStart=/usr/bin/domainname $NISDOMAINNAME
8RemainAfterExit=true
9
10[Install]
11WantedBy=multi-user.target
12
diff --git a/meta-networking/recipes-support/nis/yp-tools_2.12.bb b/meta-networking/recipes-support/nis/yp-tools_2.12.bb
new file mode 100644
index 0000000000..0017845508
--- /dev/null
+++ b/meta-networking/recipes-support/nis/yp-tools_2.12.bb
@@ -0,0 +1,31 @@
1# This package builds tools to manage NIS
2# The source package is utils/net/NIS/yp-tools
3#
4PR = "r3"
5DESCRIPTION="\
6Network Information Service tools. \
7This package contains ypcat, ypmatch, ypset, \
8ypwhich, yppasswd, domainname, nisdomainname \
9and ypdomainname."
10
11require nis.inc
12SRC_URI = "http://www.linux-nis.org/download/yp-tools/${BP}.tar.bz2 \
13 file://domainname.service \
14"
15
16SRC_URI[md5sum] = "ce1e06d86caa285fa8cd76fdf103f51e"
17SRC_URI[sha256sum] = "6ae8321666eea7837da343eea90ea30273fb74943ad111d5a4befd2afb252063"
18
19CACHED_CONFIGUREVARS += "ac_cv_prog_STRIP=/bin/true"
20
21inherit systemd
22
23RPROVIDES_${PN} += "${PN}-systemd"
24RREPLACES_${PN} += "${PN}-systemd"
25RCONFLICTS_${PN} += "${PN}-systemd"
26SYSTEMD_SERVICE_${PN} = "domainname.service"
27
28do_install_append() {
29 install -d ${D}${systemd_unitdir}/system
30 install -m 0644 ${WORKDIR}/domainname.service ${D}${systemd_unitdir}/system
31}
diff --git a/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service b/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service
new file mode 100644
index 0000000000..1f8df42af5
--- /dev/null
+++ b/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=YP Bind
3Requires=domainname.service
4After=domainname.service network.target
5Before=systemd-user-sessions.service
6
7[Service]
8Type=forking
9PIDFile=/var/run/ypbind.pid
10ExecStart=/usr/sbin/ypbind
11
12[Install]
13WantedBy=multi-user.target
14
diff --git a/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb b/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb
new file mode 100644
index 0000000000..35ef16a89a
--- /dev/null
+++ b/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb
@@ -0,0 +1,52 @@
1# This package builds the NIS ypbind daemon
2# The source package is utils/net/NIS/ypbind-mt
3#
4PR = "r3"
5DESCRIPTION="\
6Multithreaded NIS bind service (ypbind-mt). \
7ypbind-mt is a complete new implementation of a NIS \
8binding daemon for Linux. It has the following \
9features. Supports ypbind protocol V1 and V2. \
10Uses threads for better response. Supports multiple \
11domain bindings. Supports /var/yp/binding/* file \
12for Linux libc 4/5 and glibc 2.x. Supports a list \
13of known secure NIS server (/etc/yp.conf) Binds to \
14the server which answered as first."
15HOMEPAGE="http://www.linux-nis.org/nis/ypbind-mt/index.html"
16
17require nis.inc
18
19LIC_FILES_CHKSUM = "file://COPYING;md5=082c9a0886c7c3db1bc862b5b62ffe08"
20
21SRC_URI = "http://www.linux-nis.org/download/ypbind-mt/${BP}.tar.bz2 \
22 file://ypbind-yocto.init \
23 file://ypbind.service \
24"
25SRC_URI[md5sum] = "135834db97d78ff6d79fdee2810b4056"
26SRC_URI[sha256sum] = "0eff76c1849f4b38ea1a60280d8397c4240369c641fe5402ce57edf1a90958c7"
27
28# ypbind-mt now provides all the functionality of ypbind
29# and is used in place of it.
30PROVIDES += "ypbind"
31
32CACHED_CONFIGUREVARS = "ac_cv_prog_STRIP=/bin/true"
33
34do_install_append () {
35 install -d ${D}${sysconfdir}/init.d
36 install -d ${D}${sysconfdir}/rcS.d
37
38 install -m 0755 ${WORKDIR}/ypbind-yocto.init ${D}${sysconfdir}/init.d/ypbind
39
40 # TODO, use update-rc.d
41 ln -s ../init.d/ypbind ${D}${sysconfdir}/rcS.d/S44ypbind
42
43 install -d ${D}${systemd_unitdir}/system
44 install -m 0644 ${WORKDIR}/ypbind.service ${D}${systemd_unitdir}/system
45}
46
47inherit systemd
48
49RPROVIDES_${PN} += "${PN}-systemd"
50RREPLACES_${PN} += "${PN}-systemd"
51RCONFLICTS_${PN} += "${PN}-systemd"
52SYSTEMD_SERVICE_${PN} = "ypbind.service"