diff --git a/.gitignore b/.gitignore index 8d4e9d6..25b9b2d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,11 @@ ypbind-mt-1.32.tar.bz2 +/ypbind-mt-1.33.tar.bz2 +/ypbind-mt-1.35.tar.bz2 +/ypbind-mt-1.36.tar.bz2 +/ypbind-mt-1.37.1.tar.bz2 +/ypbind-mt-1.37.2.tar.bz2 +/ypbind-mt-1.38.tar.bz2 +/ypbind-mt-2.4.tar.gz +/ypbind-mt-2.5.tar.gz +/ypbind-mt-2.6.1.tar.gz +/ypbind-mt-2.7.2.tar.gz diff --git a/nis.sh b/nis.sh index 03cb976..6f37461 100755 --- a/nis.sh +++ b/nis.sh @@ -52,38 +52,34 @@ nis_config() { if [ -n "${new_nis_domain}" ]; then domainname "${new_nis_domain}" save_config_file - let contents=0 echo '# generated by /sbin/dhclient-script' > ${CONF} fix_context ${CONF} if [ -n "${new_nis_servers}" ]; then for i in ${new_nis_servers} ; do echo "domain ${new_nis_domain} server ${i}" >> ${CONF} - let contents=contents+1 done else echo "domain ${new_nis_domain} broadcast" >> ${CONF} - let contents=contents+1 fi - if [ ${contents} -gt 0 ]; then - service ypbind condrestart >/dev/null 2>&1 - fi elif [ -n "${new_nis_servers}" ]; then save_config_file echo '# generated by /sbin/dhclient-script' > ${CONF} fix_context ${CONF} - let contents=0 for i in ${new_nis_servers} ; do echo "ypserver ${i}" >> ${CONF} - let contents=contents+1 done - if [ $contents -gt 0 ]; then - service ypbind condrestart >/dev/null 2>&1 - fi fi + + # dimainname or servers changed, restart ypbind + if [ "${old_nis_domain}" != "${new_nis_domain}" ] \ + || [ "${old_nis_servers}" != "${new_nis_servers}" ] + then + service ypbind condrestart >/dev/null 2>&1 + fi fi } diff --git a/sources b/sources index 6d1741a..69c0d78 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -54100619846ad0f428017bf0cb6de2f9 ypbind-mt-1.32.tar.bz2 +SHA512 (ypbind-mt-2.7.2.tar.gz) = 415013ea003bb3d6162b1dac76462d13d1264a2a0dd3c4de057cf7239b9706a76d1f14ee1e3dcfba697aa48e25e3a972772c8210d87bbf847344e4a6c708a5b4 diff --git a/ypbind-1.11-gettextdomain.patch b/ypbind-1.11-gettextdomain.patch index 2a96820..0891dd5 100644 --- a/ypbind-1.11-gettextdomain.patch +++ b/ypbind-1.11-gettextdomain.patch @@ -1,5 +1,6 @@ ---- ypbind-mt-1.11/po/Makevars.fixit Tue Jun 11 07:19:05 2002 -+++ ypbind-mt-1.11/po/Makevars Tue Jun 11 07:19:07 2002 +diff -up ./po/Makevars.gettextdomain ./po/Makevars +--- ./po/Makevars.gettextdomain 2004-01-14 20:25:25.000000000 +0100 ++++ ./po/Makevars 2013-05-06 19:07:24.961484803 +0200 @@ -1,7 +1,7 @@ # Makefile variables for PO directory in any package using GNU gettext. diff --git a/ypbind-2.5-helpman.patch b/ypbind-2.5-helpman.patch new file mode 100644 index 0000000..1d5c663 --- /dev/null +++ b/ypbind-2.5-helpman.patch @@ -0,0 +1,148 @@ +diff -up ypbind-mt-2.5/man/ypbind.8.xml.helpman ypbind-mt-2.5/man/ypbind.8.xml +--- ypbind-mt-2.5/man/ypbind.8.xml.helpman 2018-06-04 15:30:38.000000000 +0200 ++++ ypbind-mt-2.5/man/ypbind.8.xml 2018-06-07 16:16:56.967024495 +0200 +@@ -39,21 +39,33 @@ + + + ypbind +- -c +- -d -debug +- -verbose +- -n -forground +- -broadcast +- -broken-server +- -ypset +- -ypsetme +- -no-ping ++ ++ -broadcast ++ -ypset ++ -ypsetme ++ + -f configfile ++ -no-ping ++ -broken-server + -local-only +- -ping-interval ping-interval ++ ++ ++ -ping-interval ping-interval ++ -i ping-interval ++ ++ ++ -d -debug ++ -v -verbose ++ -n -foreground ++ -p port + + + ypbind ++ -c ++ -f configfile ++ ++ ++ ypbind + --version + + +@@ -88,6 +100,8 @@ + + Unless the option + ++or ++ + is used, ypbind detaches itself from the controlling terminal and puts + itself into background. + ypbind +@@ -132,6 +146,57 @@ If the file does not exist or if there a + ypbind + exit. + ++ ++In Fedora we use systemd for starting services. We need to finish starting ++process of ypbind service not before service is fully ++started, which means ypbind daemon is prepared to answer. ++There is a test script /usr/libexec/ypbind-post-waitbind ++used in ypbind.service, that waits for ypbind daemon to be ++fully connected to NIS server and waits by default up to 45s. Sometimes this ++is not enough, because network set up can take longer than 45s during boot, so ++starting ypbind.service fails. User can increase the timeout by setting an ++environment variable NISTIMEOUT in /etc/sysconfig/ypbind. ++For example NISTIMEOUT=180 means ypbind will wait up to 180 ++seconds for binding to a NIS server. Another option is to enable ++NetworkManager-wait- online.service, which will make ypbind ++to wait until network is properly set up. ++ ++ ++ ++In case something needs to be changed in the ypbind.service, it is adviced not ++to change the ypbind.service directly, but rather to create a new file under ++/etc/systemd/system/ypbind.service.d/, i.e. if we need to ++start ypbind before service foo.service, we can create file ++/etc/systemd/system/ypbind.service.d/wait-foo.conf with ++the following content: ++ ++ ++ ++ ++[Service] ++Before=foo.service ++ ++ ++ ++If you need to pass other arguments to ypbind daemon withing ++systemd unit file, you can set these arguments as OTHER_YPBIND_OPTS environment ++variable in /etc/sysconfig/ypbind. For example in order to ++set a fixed port ypbind should run on, you can specify ++OTHER_YPBIND_OPTS="-p 876" in /etc/sysconfig/ypbind. ++ ++ ++ ++DHCP client by defualt changes /etc/yp.conf in case DHCP ++server sends NIS configuration in the respond. In that case ++/etc/dhcp/dhclient.d/nis.sh changes ++/etc/yp.conf according such configuration and creates a ++back-up copy of the original configuration file into ++/var/lib/dhclient/nis.conf.predhclient.$interface. In ++order to disable changing /etc/yp.conf by DHCP client, add ++PEERNIS=no into /etc/sysconfig/network. ++ ++ ++ + + + +@@ -256,6 +321,15 @@ With this options another frequency in s + + + ++ port ++ ++Lets ++ypbind ++listen on a specified port number, rather than asking portmapper to assingn a ++port for it. ++ ++ ++ + + + Prints the version number +diff -up ypbind-mt-2.5/man/yp.conf.5.xml.helpman ypbind-mt-2.5/man/yp.conf.5.xml +--- ypbind-mt-2.5/man/yp.conf.5.xml.helpman 2018-06-07 16:29:01.853560699 +0200 ++++ ypbind-mt-2.5/man/yp.conf.5.xml 2018-06-07 16:33:59.302833043 +0200 +@@ -97,6 +97,14 @@ + first the given servers before falling back to broadcasting + for a running server. + ++ ++ Content of /etc/yp.conf can be changed by DHCP client, ++ for more info see ++ ++ ypbind ++ 8 ++ . ++ + + + diff --git a/ypbind-mt-1.32-dbus.patch b/ypbind-mt-1.32-dbus.patch deleted file mode 100644 index 9894556..0000000 --- a/ypbind-mt-1.32-dbus.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -up ypbind-mt-1.32/src/ypbind_dbus_nm.c.dbus ypbind-mt-1.32/src/ypbind_dbus_nm.c ---- ypbind-mt-1.32/src/ypbind_dbus_nm.c.dbus 2011-04-07 14:55:56.251110287 +0200 -+++ ypbind-mt-1.32/src/ypbind_dbus_nm.c 2011-04-07 16:47:17.747108590 +0200 -@@ -42,13 +42,19 @@ - #define NM_DBUS_VPN_SIGNAL_STATE_CHANGE "StateChange" - - typedef enum NMState { -- NM_STATE_UNKNOWN = 0, -- NM_STATE_ASLEEP, -- NM_STATE_CONNECTING, -- NM_STATE_CONNECTED, -- NM_STATE_DISCONNECTED -+ NM_STATE_UNKNOWN = 0, -+ NM_STATE_ASLEEP = 10, -+ NM_STATE_DISCONNECTED = 20, -+ NM_STATE_DISCONNECTING = 30, -+ NM_STATE_CONNECTING = 40, -+ NM_STATE_CONNECTED_LOCAL = 50, -+ NM_STATE_CONNECTED_SITE = 60, -+ NM_STATE_CONNECTED_GLOBAL = 70 - } NMState; - -+/* For backwards compat */ -+#define NM_STATE_CONNECTED NM_STATE_CONNECTED_GLOBAL -+ - #endif - - #define DBUS_MESSAGE_MATCH \ diff --git a/ypbind-mt-1.32-typo.patch b/ypbind-mt-1.32-typo.patch deleted file mode 100644 index be7a4fd..0000000 --- a/ypbind-mt-1.32-typo.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up ypbind-mt-1.32/src/serv_list.c.typo ypbind-mt-1.32/src/serv_list.c ---- ypbind-mt-1.32/src/serv_list.c.typo 2010-11-29 11:28:51.701891385 +0100 -+++ ypbind-mt-1.32/src/serv_list.c 2010-11-29 11:30:29.682891306 +0100 -@@ -830,7 +830,7 @@ ping_all (struct binding *list) - if (s_in.sin_port == 0) - { - if (verbose_flag && list->active == i) -- log_msg (LOG_NOTICE, "NIS server '%s' not repsonding " -+ log_msg (LOG_NOTICE, "NIS server '%s' not responding " - "for domain '%s'", list->server[i].host, list->domain); - - if (debug_flag) diff --git a/ypbind-mt-1.32-typo2.patch b/ypbind-mt-1.32-typo2.patch deleted file mode 100644 index f8f6096..0000000 --- a/ypbind-mt-1.32-typo2.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -up ypbind-mt-1.32/man/ypbind.8.typo2 ypbind-mt-1.32/man/ypbind.8 ---- ypbind-mt-1.32/man/ypbind.8.typo2 2011-03-18 13:13:11.263707644 +0100 -+++ ypbind-mt-1.32/man/ypbind.8 2011-03-18 13:16:59.170866034 +0100 -@@ -313,7 +313,7 @@ versions\&. - \fBypbind\fR - will not check if the binding is alive\&. This option is for use with dialup connections to prevent - \fBypbind\fR --from keeping the connection unnecessarily open or causing autodials\&. -+from keeping the connection unnecessarily open or causing auto-dials\&. - .RE - .PP - \fB\-f\fR configfile -@@ -335,7 +335,7 @@ will only bind to the loopback device an - .RS 4 - The default value for - \fBypbind\fR --to check, if a NIS server is still reacheable, is 20 seconds\&. With this options another frequency in seconds can be specified\&. -+to check, if a NIS server is still reachable, is 20 seconds\&. With this options another frequency in seconds can be specified\&. - .RE - .PP - \fB\-no\-dbus\fR -diff -up ypbind-mt-1.32/man/ypbind.8.xml.typo2 ypbind-mt-1.32/man/ypbind.8.xml ---- ypbind-mt-1.32/man/ypbind.8.xml.typo2 2011-03-18 13:18:01.643651666 +0100 -+++ ypbind-mt-1.32/man/ypbind.8.xml 2011-03-18 13:19:03.137658398 +0100 -@@ -234,7 +234,7 @@ versions. - will not check if the binding is alive. This option is for use with - dialup connections to prevent - ypbind --from keeping the connection unnecessarily open or causing autodials. -+from keeping the connection unnecessarily open or causing auto-dials. - - - -@@ -260,7 +260,7 @@ a remote network. - - The default value for - ypbind --to check, if a NIS server is still reacheable, is 20 seconds. -+to check, if a NIS server is still reachable, is 20 seconds. - With this options another frequency in seconds can be specified. - - diff --git a/ypbind-post-waitbind b/ypbind-post-waitbind new file mode 100755 index 0000000..e3ac27c --- /dev/null +++ b/ypbind-post-waitbind @@ -0,0 +1,57 @@ +#!/bin/sh +# +# ypbind-domain +# +# description: This is part of former ypbind init script, which is used +# to fix problems with the init scripts continuing even when +# we are really not bound yet to a server, and then things +# that need NIS fail. +# + +# NISTIMEOUT should be a multiple of 15 since +# ypwhich has a hardcoded 15sec timeout +[ -z "$NISTIMEOUT" ] && NISTIMEOUT=45 + +logger -t ypbind $"Binding NIS service" + +timeout=$NISTIMEOUT +firsttime=1 +rpcbound=0 +SECONDS=0 +retval=0 +while [ $SECONDS -lt $timeout ] || [ $firsttime -eq 1 ] ; do +firsttime=0 +if /usr/sbin/rpcinfo -p | LC_ALL=C fgrep -q ypbind +then + rpcbound=1 + /usr/bin/ypwhich > /dev/null 2>&1 + retval=$? + if [ $retval -eq 0 ]; then + break; + fi +fi +sleep 2 +done + +logger -t ypbind "Binding took $SECONDS seconds" + +if [ $retval -eq 0 ]; then + if [ $rpcbound -eq 0 ]; then + logger -t ypbind \ + "NIS domain: `domainname`, ypbind not registered with rpcbind." + else + logger -t ypbind \ + "NIS domain: `domainname`, NIS server: `ypwhich 2> /dev/null`" + fi +else + logger -t ypbind \ + "NIS server for domain `domainname` is not responding." + logger -t ypbind \ + "Killing ypbind with PID $MAINPID." + kill -s 15 $MAINPID || : + logger -t ypbind \ + "Try increase NISTIMEOUT in /etc/sysconfig/ypbind" +fi + +exit $retval + diff --git a/ypbind-pre-setdomain b/ypbind-pre-setdomain new file mode 100755 index 0000000..9b22a8c --- /dev/null +++ b/ypbind-pre-setdomain @@ -0,0 +1,44 @@ +#!/bin/sh +# +# ypbind-domain +# +# description: This is part of former ypbind init script, which is used +# to setup proper domainname before starting ypbind daemon +# itself. If $NISDOMAIN is not defined, it reads config file. +# + +TIMEOUT=5 +DOMAINNAME=`domainname` +if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then + echo -n $"Setting NIS domain: " + seconds=0 + while [ $seconds -lt $TIMEOUT ]; do + if [ -n "$NISDOMAIN" ]; then + domainname $NISDOMAIN + echo $"'$NISDOMAIN' (environment variable)" + break + else # See if the domain is set in config file + NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf` + if [ -n "$NISDOMAIN" ]; then + domainname $NISDOMAIN + echo $"'$NISDOMAIN' (/etc/yp.conf)" + break + else + seconds=$(($seconds+1)) + sleep 1 + fi + fi + done + # Give up if NISDOMAIN is still not set + [ -z "$NISDOMAIN" ] && logger -t ypbind $"domain not found" && exit 1 +fi + +#/etc/rpc check +grep ypbind /etc/rpc > /dev/null 2>&1 +if [ $? -ne 0 ]; then + logger -t ypbind $"Error: Missing ypbind entry in /etc/rpc." + exit 1 +fi + +echo + diff --git a/ypbind.init b/ypbind.init deleted file mode 100755 index c42c077..0000000 --- a/ypbind.init +++ /dev/null @@ -1,227 +0,0 @@ -#!/bin/sh -# -# ypbind: Starts the ypbind daemon -# -# Version: @(#) /etc/init.d/ypbind.init 1.3 -# -# chkconfig: - 24 76 -# description: This is a daemon which runs on NIS/YP clients and binds them \ -# to a NIS domain. It must be running for systems based on glibc \ -# to work as NIS clients, but it should not be enabled on systems \ -# which are not using NIS. -# processname: ypbind -# config: /etc/yp.conf -# -# See https://fedoraproject.org/wiki/Packaging:SysVInitScript for -# the guidelines document. -### BEGIN INIT INFO -# Provides: ypbind -# Required-Start: $local_fs $remote_fs $network $rpcbind -# Required-Stop: $local_fs $remote_fs $network $rpcbind -# Default-Start: 3 4 5 -# Default-Stop: 0 1 2 6 -# Short-Description: Starts the ypbind daemon -# Description: This is a daemon which runs on NIS/YP clients and binds them \ -# to a NIS domain. It must be running for systems based on glibc \ -# to work as NIS clients, but it should not be enabled on systems \ -# which are not using NIS. -### END INIT INFO - -OTHER_YPBIND_OPTS="" - -# Source function library. -[ -f /etc/rc.d/init.d/functions ] || exit 0 -. /etc/rc.d/init.d/functions - -# getting the YP domain name -[ -e /etc/sysconfig/network ] && . /etc/sysconfig/network - -# Check for and source configuration file otherwise set defaults -[ -f /etc/sysconfig/ypbind ] && . /etc/sysconfig/ypbind - -# NISTIMEOUT should be a multiple of 15 since -# ypwhich has a hardcoded 15sec timeout -[ -z "$NISTIMEOUT" ] && NISTIMEOUT=45 - -# Check that networking is configured. -[ "${NETWORKING}" = "no" ] && exit 0 - -exec="/usr/sbin/ypbind" -prog="ypbind" -lockfile=/var/lock/subsys/$prog - -selinux_on() { - [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled || return - #echo $"Turning on allow_ypbind SELinux boolean" - setsebool allow_ypbind=1 -} - -selinux_off() { - [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled || return - allow_ypbind=0 - . /etc/selinux/config - if [ -e /etc/selinux/${SELINUXTYPE}/modules/active/booleans.local ]; then - . /etc/selinux/${SELINUXTYPE}/modules/active/booleans.local - fi - if [ $allow_ypbind == 0 ]; then - #echo $"Turning off allow_ypbind SELinux boolean" - setsebool allow_ypbind=$allow_ypbind - fi -} - -start() { - [ $UID -eq 0 ] || exit 4 - [ -x $exec ] || exit 5 - DOMAINNAME=`domainname` - if [ "$DOMAINNAME" = "(none)" -o "$DOMAINNAME" = "" ]; then - echo -n $"Setting NIS domain: " - if [ -n "$NISDOMAIN" ]; then - action $"domain is '$NISDOMAIN' " domainname $NISDOMAIN - else # See if the domain is set in config file - NISDOMAIN=`awk '{ if ($1 == "domain") {print $2; exit} }' /etc/yp.conf` - if [ -n "$NISDOMAIN" ]; then - action $"domain is '$NISDOMAIN' " \ - domainname $NISDOMAIN - else - action $"domain not found" /bin/false - logger -t ypbind $"domain not found" - return 1 - fi - fi - fi - echo -n $"Starting NIS service: " - selinux_on - daemon $exec $OTHER_YPBIND_OPTS - retval=$? - echo - if [ $retval -ne 0 ]; then - #selinux_off - logger -t ypbind "failed to start!" - return $retval - fi - echo -n $"Binding NIS service: " - # the following fixes problems with the init scripts continuing - # even when we are really not bound yet to a server, and then things - # that need NIS fail. - timeout=10 - firsttime=1 - SECONDS=0 - while [ $SECONDS -lt $timeout ]; do - if /usr/sbin/rpcinfo -p | LC_ALL=C fgrep -q ypbind - then - if [ $firsttime -eq 1 ]; then - # reset timeout - timeout=$NISTIMEOUT - firsttime=0 - fi - /usr/bin/ypwhich > /dev/null 2>&1 - retval=$? - if [ $retval -eq 0 ]; then - break; - fi - fi - sleep 2 - echo -n "." - done - if [ $retval -eq 0 ]; then - logger -t ypbind \ - "NIS domain: `domainname`, NIS server: `ypwhich 2> /dev/null`" - touch $lockfile - success - else - logger -t ypbind \ - "NIS server for domain `domainname` is not responding." - failure - #selinux_off - retval=100 - fi - echo - return $retval -} - -stop() { - [ $UID -eq 0 ] || exit 4 - [ -x $exec ] || exit 5 - echo -n $"Shutting down NIS service: " - killproc $prog - retval=$? - echo - if [ $retval -eq 0 ]; then - rm -f $lockfile - # if we used brute force (like kill -9) we don't want those around - if [ x$(domainname) != x ]; then - rm -f /var/yp/binding/$(domainname)* - fi - fi - #selinux_off - return $retval -} - -restart() { - stop - start -} - -reload() { - echo -n $"Reloading NIS service: " - killproc $prog -HUP - retval=$? - echo - return $retval -} - -force_reload() { - restart -} - -rh_status() { - # run checks to determine if the service is running or use generic status - status $prog -} - -rh_status_q() { - rh_status >/dev/null 2>&1 -} - -usage() { - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" -} - -# See how we were called. -case "$1" in - start) - rh_status_q && exit 0 - $1 - retval=$? - if [ $retval -eq 100 ]; then stop; exit 1; fi - exit $retval - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - usage) - $1 - ;; - *) - usage - exit 2 -esac -exit $? diff --git a/ypbind.service b/ypbind.service new file mode 100644 index 0000000..2c45afe --- /dev/null +++ b/ypbind.service @@ -0,0 +1,22 @@ +# For details how to adjust this file or change daemon settings, please, read ypbind(8). +[Unit] +Description=NIS/YP (Network Information Service) Clients to NIS Domain Binder +Requires=rpcbind.service +Wants=nss-user-lookup.target network-online.target +After=syslog.target rpcbind.service ypserv.service +Before=systemd-user-sessions.service +Before=nss-user-lookup.target + +[Service] +Type=notify +NotifyAccess=all +EnvironmentFile=-/etc/sysconfig/network +EnvironmentFile=-/etc/sysconfig/ypbind +ExecStartPre=/usr/libexec/ypbind-pre-setdomain +ExecStartPre=-/bin/bash -c 'selinuxenabled && /usr/sbin/setsebool allow_ypbind=1' +ExecStart=/usr/sbin/ypbind -n $OTHER_YPBIND_OPTS +ExecStartPost=/usr/libexec/ypbind-post-waitbind +PrivateTmp=true + +[Install] +WantedBy=multi-user.target diff --git a/ypbind.spec b/ypbind.spec index abf5cf1..77e5fc6 100644 --- a/ypbind.spec +++ b/ypbind.spec @@ -1,28 +1,42 @@ Summary: The NIS daemon which binds NIS clients to an NIS domain Name: ypbind -Version: 1.32 -Release: 8%{?dist} -License: GPLv2 -Group: System Environment/Daemons -Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2 -Url: http://www.linux-nis.org/nis/ypbind-mt/index.html -Source1: ypbind.init +Epoch: 3 +Version: 2.7.2 +Release: 16%{?dist} +License: GPL-2.0-only +Url: https://www.thkukuk.de/nis/nis/ypbind-mt/ + +Source0: https://github.com/thkukuk/ypbind-mt/archive/v%{version}.tar.gz#/ypbind-mt-%{version}.tar.gz +#Source1: ypbind.init Source2: nis.sh +Source3: ypbind.service +Source4: ypbind-pre-setdomain +Source5: ypbind-post-waitbind + # Fedora-specific patch. Renaming 'ypbind' package to proper # 'ypbind-mt' would allow us to drop it. Patch1: ypbind-1.11-gettextdomain.patch # Not sent to upstream. -Patch2: ypbind-mt-1.32-typo.patch -Patch3: ypbind-mt-1.32-typo2.patch -Patch4: ypbind-mt-1.32-dbus.patch -Requires(post): chkconfig -Requires(preun): chkconfig -# This is for /sbin/service -Requires(preun): initscripts -Requires(postun): initscripts -Requires: rpcbind, yp-tools -Epoch: 3 +Patch2: ypbind-2.5-helpman.patch + +# This is for /bin/systemctl +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +Requires: rpcbind +Requires: yp-tools >= 4.2.2-2 +# New nss_nis package in F25+ +Requires: nss_nis +BuildRequires: make +BuildRequires: gcc BuildRequires: dbus-glib-devel, docbook-style-xsl +BuildRequires: systemd +BuildRequires: systemd-devel +BuildRequires: autoconf, automake +BuildRequires: gettext-devel +BuildRequires: libtirpc-devel +BuildRequires: libnsl2-devel +BuildRequires: libxslt %description The Network Information Service (NIS) is a system that provides @@ -42,52 +56,345 @@ Install the ypbind package on any machines running NIS client programs also need to install the ypserv package to a machine on your network. %prep -%setup -q -n ypbind-mt-%{version} -%patch1 -p1 -b .gettextdomain -%patch2 -p1 -b .typo -%patch3 -p1 -b .typo2 -%patch4 -p1 -b .dbus +%autosetup -p1 -n ypbind-mt-%{version} + +autoreconf -fiv %build -%configure --enable-dbus-nm -make +%ifarch s390 s390x +export CFLAGS="$RPM_OPT_FLAGS -fPIC" +%else +export CFLAGS="$RPM_OPT_FLAGS -fpic" +%endif +export LDFLAGS="$LDFLAGS -pie -Wl,-z,relro,-z,now" + +#export CFLAGS="$CFLAGS -H" + +%configure +%make_build %install -rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT +%make_install -mkdir -p $RPM_BUILD_ROOT/%{_initrddir} $RPM_BUILD_ROOT/var/yp/binding $RPM_BUILD_ROOT/etc/dhcp/dhclient.d/ -install -m 644 etc/yp.conf $RPM_BUILD_ROOT/etc/yp.conf -install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/ypbind -install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/dhcp/dhclient.d/nis.sh +mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/yp/binding +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d +mkdir -p $RPM_BUILD_ROOT%{_unitdir} +mkdir -p $RPM_BUILD_ROOT%{_libexecdir} +install -m 644 etc/yp.conf $RPM_BUILD_ROOT%{_sysconfdir}/yp.conf +install -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d/nis.sh +install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/ypbind.service +install -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/ypbind-pre-setdomain +install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/ypbind-post-waitbind %{find_lang} %{name} %post -/sbin/chkconfig --add ypbind +%systemd_post %{name}.service %preun -if [ $1 = 0 ] ; then - /sbin/service ypbind stop >/dev/null 2>&1 - /sbin/chkconfig --del ypbind -fi +%systemd_preun %{name}.service %postun -if [ "$1" -ge "1" ] ; then - /sbin/service ypbind condrestart >/dev/null 2>&1 || : -fi +%systemd_postun_with_restart %{name}.service %files -f %{name}.lang -%defattr(-,root,root) %{_sbindir}/* %{_mandir}/*/* -%{_initrddir}/* -/etc/dhcp/dhclient.d/* -%config(noreplace) /etc/yp.conf -%dir /var/yp/binding -%doc README NEWS COPYING +%{_libexecdir}/* +%{_unitdir}/* +%{_sysconfdir}/dhcp/dhclient.d/* +%config(noreplace) %{_sysconfdir}/yp.conf +%dir %{_localstatedir}/yp/binding +%doc README NEWS +%license COPYING %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 3:2.7.2-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + +* Sun Jan 19 2025 Fedora Release Engineering - 3:2.7.2-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + +* Sat Jul 20 2024 Fedora Release Engineering - 3:2.7.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Jan 30 2024 Ondrej Sloup - 3:2.7.2-13 +- Update license tag to the SPDX format (GPL-2.0-only) + +* Sat Jan 27 2024 Fedora Release Engineering - 3:2.7.2-12 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jul 22 2023 Fedora Release Engineering - 3:2.7.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Jan 21 2023 Fedora Release Engineering - 3:2.7.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Sat Jul 23 2022 Fedora Release Engineering - 3:2.7.2-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Jan 22 2022 Fedora Release Engineering - 3:2.7.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Nov 12 2021 Björn Esser - 3:2.7.2-7 +- Rebuild(libnsl2) + +* Tue Sep 28 2021 Marek Kulik - 3:2.7.2-6 +- Fix setsebool message in logs, resolves: #1882069 + +* Fri Jul 23 2021 Fedora Release Engineering - 3:2.7.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 3:2.7.2-4 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + +* Thu Jan 28 2021 Fedora Release Engineering - 3:2.7.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 3:2.7.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Apr 20 2020 Filip Januš - 2.7.2-1 +- Update version to 2.7.2 +- Resolves: #1796030 +- Removing obsolete patches + +* Fri Jan 31 2020 Fedora Release Engineering - 3:2.6.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Tue Jul 30 2019 Matej Mužila - 3:2.6.1-1 +- Update to version 2.6.1 +- Resolves: #1668439 + +* Sat Jul 27 2019 Fedora Release Engineering - 3:2.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sun Feb 03 2019 Fedora Release Engineering - 3:2.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sat Jul 14 2018 Fedora Release Engineering - 3:2.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Thu Jun 07 2018 Matej Mužila - 3:2.5-2 +- Fix man pages + +* Tue Jun 05 2018 Matej Mužila - 3:2.5-1 +- Update to version 2.5 + +* Mon Apr 30 2018 Petr Kubat - 3:2.4-8 +- Add the runtime dependency on nss_nis back + +* Fri Feb 09 2018 Igor Gnatenko - 3:2.4-7 +- Escape macros in %%changelog + +* Tue Jan 16 2018 Petr Kubat - 3:2.4-6 +- Temporarily remove nss_nis dependency as it got removed from glibc (#1534599) + +* Thu Sep 21 2017 Matej Mužila - 3:2.4-5 +- Add "Wants" dependency on network-online.target +- Remove "After" dependency on NetworkManager-wait-online.service + +* Thu Aug 03 2017 Fedora Release Engineering - 3:2.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 3:2.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon May 29 2017 Matej Mužila - 3:2.4-2 +- Require yp-tools >= 4.2.2-2 + +* Fri May 19 2017 Matej Mužila - 3:2.4-1 +- Update to version 2.4 supporting IPv6 + +* Wed Mar 29 2017 Petr Kubat - 3:1.38-10 +- Wait a while for dhcp to set up the domain (#1170400) + +* Mon Mar 20 2017 Petr Kubat - 3:1.38-9 +- Add a Wants dependency on nss-user-lookup.target (#1282440) + +* Sat Feb 11 2017 Fedora Release Engineering - 3:1.38-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Nov 23 2016 Ralf Corsépius - 3:1.38-7 +- Remove check for libsystemd-daemon from ypbind-systemdso.patch (RHBZ#1396893). +- Add check for systemd/sd-daemon.h to ypbind-systemdso.patch. +- Spec file cosmetics. +- Add %%license tag. + +* Mon Nov 07 2016 Petr Kubat - 3:1.38-6 +- Add runtime dependency on nss_nis + +* Fri Feb 05 2016 Fedora Release Engineering - 3:1.38-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Jan 25 2016 Matej Muzila 3:1.38-4 +- Do not restart ypbind on dhcp renew if nis domain or nis servers + haven't changed + Resolves: rhbz#1301708 + +* Mon Nov 16 2015 Matej Muzila 3:1.38-3 +- Load ypbind.service before nss-user-lookup.target + Resolves: rhbz#1282440 + +* Fri Jun 19 2015 Fedora Release Engineering - 3:1.38-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Oct 21 2014 Matej Mužila - 3:1.38-1 +- Update to 1.38 + +* Mon Aug 18 2014 Fedora Release Engineering - 3:1.37.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Aug 15 2014 Honza Horak - 3:1.37.2-2 +- link with systemd.so + +* Fri Aug 15 2014 Honza Horak - 3:1.37.2-1 +- Update to 1.37.2 + +* Sat Jun 07 2014 Fedora Release Engineering - 3:1.37.1-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon Nov 18 2013 Honza Horak - 3:1.37.1-9 +- Replace autoreconf with autoconf + +* Mon Nov 18 2013 Honza Horak - 3:1.37.1-8 +- DHCP changes documented + Related: #1031093 + +* Thu Aug 29 2013 Honza Horak - 3:1.37.1-7 +- Add network-online.target dependency + Resolves: #1002295 + +* Mon Aug 19 2013 Honza Horak - 3:1.37.1-6 +- Improve systemd documentation + +* Mon Jul 29 2013 Honza Horak - 3:1.37.1-5 +- Remove SysV init conversion and systemd macros compatible code +- Require systemd instead systemd-units +- Remove systemd-sysv + +* Thu May 09 2013 Honza Horak - 3:1.37.1-3 +- Enable PrivateTmp feature, just for the case + +* Tue May 07 2013 Honza Horak - 3:1.37.1-2 +- Syncing help and man pages + +* Mon May 06 2013 Honza Horak - 3:1.37.1-1 +- Update to new version 1.37.1 + +* Tue Jan 29 2013 Honza Horak - 3:1.36-10 +- Make re-bind interval a tune-able option +- Fixed bogus dates in changelog + +* Wed Dec 19 2012 Honza Horak - 3:1.36-9 +- Check presence of ypbind in /etc/rpc + Related: #888778 + +* Fri Nov 30 2012 Honza Horak - 3:1.36-8 +- Build with full relro + +* Thu Oct 04 2012 Honza Horak - 3:1.36-7 +- Run %%triggerun regardless of systemd_post variable definition + +* Mon Sep 24 2012 Honza Horak - 3:1.36-6 +- Use sdnotify to inform systemd that daemon is ready +- Minor spec file cleanup +- Use new systemd macros + Resolves: #850375 +- Add After: NetworkManager-wait-online.service + Related: #846767 + +* Thu Aug 23 2012 Honza Horak - 3:1.36-5 +- Enhance ypbind(8) with info about NISTIMEOUT +- Add suggestion about extending NISTIMEOUT if ypbind timeouts + +* Mon Jul 23 2012 Honza Horak - 3:1.36-4 +- Add SIGPIPE to proper signal set + Related: #842228 +- Fixed sending TERM signal in ypbind-post-waitbind + +* Sun Jul 22 2012 Fedora Release Engineering - 3:1.36-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jul 11 2012 Honza Horak - 3:1.36-2 +- Minor spec file fixes +- Helper scripts moved to /usr/libexec + +* Wed Jul 11 2012 Honza Horak - 3:1.36-1 +- Update to new version 1.36 + +* Tue Jul 10 2012 Honza Horak - 3:1.35-5 +- consider all 127.0.0.0/8 as localhost addresses + Related: #829487 + +* Mon Jul 09 2012 Honza Horak - 3:1.35-4 +- don't go offline when one of NIS servers is localhost + Related: #829487 + +* Fri Jun 01 2012 Honza Horak - 3:1.35-3 +- fixed kill call in ypbind-post-waitbind script + +* Wed Apr 18 2012 Honza Horak - 3:1.35-2 +- NetworkManager signal name changed + Resolves: #812501 + +* Mon Mar 26 2012 Honza Horak - 3:1.35-1 +- Update to new version with only minor changes + +* Tue Jan 24 2012 Honza Horak - 3:1.33-11 +- Don't fail when killing ypbind after unsuccessfull start fails +- Let ypbind start before systemd-user-sessions.service + Resolves: #783447 + +* Thu Jan 12 2012 Honza Horak - 3:1.33-10 +- Fail to start ypbind service if domainname is not set + +* Wed Nov 16 2011 Honza Horak - 3:1.33-9 +- Fixed ypbind-post-waitbind to stop the service when binding is not success + +* Tue Nov 15 2011 Honza Horak - 3:1.33-8 +- Fixed ypbind-post-waitbind to handle long rpcinfo requests + Resolves: #624688 + +* Mon Sep 26 2011 Honza Horak - 3:1.33-7 +- Don't turn off allow_ypbind SELinux boolean + Resolves: #741141 + +* Thu Sep 15 2011 Honza Horak - 3:1.33-6 +- Fixed systemd unit file +- Log messages when starting ypbind service made more verbose + +* Tue Aug 02 2011 Honza Horak - 3:1.33-5 +- Fixed rpmlint errors +- Fixed systemd unit files packaging + +* Mon Jun 13 2011 Honza Horak - 3:1.33-4 +- Changed -n option for staying in foreground to not overlap + with config-file option + +* Tue Jun 07 2011 Honza Horak - 3:1.33-3 +- Fixed ypbind.service when selinux is disabled + +* Tue May 10 2011 Honza Horak - 3:1.33-2 +- Added /etc/sysconfig/network to systemd service file + +* Tue May 10 2011 Honza Horak - 3:1.33-1 +- Update to new version + +* Fri Apr 29 2011 Honza Horak - 3:1.32-11 +- Removed NM_DBUS_VPN_SIGNAL_STATE_CHANGE, use own constant + NM_DBUS_SIGNAL_STATE_CHANGED. + (rhbz#696629) + +* Thu Apr 28 2011 Honza Horak - 3:1.32-10 +- Made EnvironmentFile in systemd definition optional + (rhbz#632620) + +* Thu Apr 14 2011 Honza Horak - 3:1.32-9 +- Add native systemd unit file. + (rhbz#693873) + * Thu Apr 14 2011 Honza Horak - 3:1.32-8 - Added rpcbind to LSB header in SysV init file. @@ -154,7 +461,7 @@ fi the documentation, and it is also removed from the usage string in this version -* Fri Nov 19 2009 Karel Klic - 3:1.29.91-2 +* Thu Nov 19 2009 Karel Klic - 3:1.29.91-2 - Added signalstate patch, which fixes compilation with NetworkManaged-devel headers installed. Resolves #537064. @@ -236,7 +543,7 @@ fi * Mon Sep 17 2007 Steve Dickson - 3:1.20.4-2 - Fixed a couple of typos in initscript (bz 281951) -* Wed May 3 2007 Steve Dickson - 3:1.20.4-1 +* Thu May 3 2007 Steve Dickson - 3:1.20.4-1 - updated to latest upstream version ypbind-mt-1.20.4 * Tue Apr 17 2007 Steve Dickson - 3:1.19-9 @@ -382,7 +689,7 @@ fi * Sun Jun 24 2001 Elliot Lee - Bump release + rebuild. -* Fri Jun 4 2001 Preston Brown +* Mon Jun 4 2001 Preston Brown - small fixes for initscript. Sometimes had trouble on slower systems (#37463) * Sat Mar 3 2001 Preston Brown