[packages/rpcbind] - use upstream systemd units (with patch); real life check wanted - use upstream make install

qboosh qboosh at pld-linux.org
Wed Apr 11 19:50:49 CEST 2018


commit 743aa2864e361cc9aabb9e1365975d257d2ff599
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Apr 11 19:50:57 2018 +0200

    - use upstream systemd units (with patch); real life check wanted
    - use upstream make install

 rpcbind-systemd.patch | 29 +++++++++++++++++++++++++++++
 rpcbind.service       | 13 -------------
 rpcbind.socket        |  8 --------
 rpcbind.spec          | 23 ++++++++++-------------
 4 files changed, 39 insertions(+), 34 deletions(-)
---
diff --git a/rpcbind.spec b/rpcbind.spec
index 5493666..544fe5a 100644
--- a/rpcbind.spec
+++ b/rpcbind.spec
@@ -9,12 +9,11 @@ Source0:	http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
 # Source0-md5:	cf10cd41ed8228fc54c316191c1f07fe
 Source1:	%{name}.init
 Source2:	%{name}.sysconfig
-Source3:	%{name}.service
-Source4:	%{name}.socket
 Patch0:		%{name}-libwrap.patch
 Patch1:		%{name}-syslog.patch
 Patch2:		%{name}-sunrpc.patch
 Patch3:		%{name}-nss.h.patch
+Patch4:		%{name}-systemd.patch
 Patch6:		%{name}-tcp-addrs.patch
 # http://nfsv4.bullopensource.org/doc/tirpc_rpcbind.php
 URL:		http://sourceforge.net/projects/rpcbind/
@@ -57,6 +56,7 @@ wywołania RPC na serwerze na tej maszynie.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 %patch6 -p1
 
 %build
@@ -65,29 +65,26 @@ wywołania RPC na serwerze na tej maszynie.
 %{__autoconf}
 %{__automake}
 %configure \
+	--bindir=/sbin \
 	--enable-libwrap \
 	--enable-warmstarts \
 	--with-statedir=/var/lib/rpcbind \
 	--with-rpcuser=rpc \
-	--with-systemdsystemunitdir=%{%systemdunitdir}
+	--with-systemdsystemunitdir=%{systemdunitdir}
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
-	$RPM_BUILD_ROOT{%{_mandir}/man8,%{_var}/lib/%{name},%{systemdunitdir}}
+install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},/etc/{sysconfig,rc.d/init.d},/var/lib/rpcbind}
 
-install rpcbind $RPM_BUILD_ROOT/sbin
-install rpcinfo $RPM_BUILD_ROOT%{_sbindir}
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
 
-install man/{rpcbind,rpcinfo}.8 $RPM_BUILD_ROOT%{_mandir}/man8
+%{__mv} $RPM_BUILD_ROOT/sbin/rpcinfo $RPM_BUILD_ROOT%{_sbindir}
 
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/rpcbind
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rpcbind
 
-install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/rpcbind.service
-install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/rpcbind.socket
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -115,8 +112,8 @@ fi
 %triggerpostun -- %{name} < 0.2.0-5
 if [ -f /etc/sysconfig/rpcbind ]; then
 	. /etc/sysconfig/rpcbind
-	[ "$RPCBIND_VERBOSE" == "no" ] || RPCBIND_OPTIONS="-l"
-	[ "$RPCBIND_INSECURE" == "yes" ] && RPCBIND_OPTIONS="$RPCBIND_OPTIONS -i"
+	[ "$RPCBIND_VERBOSE" = "no" ] || RPCBIND_OPTIONS="-l"
+	[ "$RPCBIND_INSECURE" = "yes" ] && RPCBIND_OPTIONS="$RPCBIND_OPTIONS -i"
 	for a in $RPCBIND_ADDRESSES ; do
 		RPCBIND_OPTIONS="$RPCBIND_OPTIONS -h $a"
 	done
diff --git a/rpcbind-systemd.patch b/rpcbind-systemd.patch
new file mode 100644
index 0000000..c38ca9c
--- /dev/null
+++ b/rpcbind-systemd.patch
@@ -0,0 +1,29 @@
+--- rpcbind-0.2.4/systemd/rpcbind.service.in.orig	2016-11-28 21:47:28.000000000 +0100
++++ rpcbind-0.2.4/systemd/rpcbind.service.in	2018-04-11 19:41:46.466605338 +0200
+@@ -6,12 +6,13 @@
+ # Make sure we use the IP addresses listed for
+ # rpcbind.socket, no matter how this unit is started.
+ Wants=rpcbind.socket
+-After=rpcbind.socket
++After=rpcbind.socket syslog.target network.target
+ 
+ [Service]
+ Type=notify
+-# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
++EnvironmentFile=-/etc/sysconfig/rpcbind
+ ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
+ 
+ [Install]
+ WantedBy=multi-user.target
++Also=rpcbind.socket
+--- rpcbind-0.2.4/systemd/rpcbind.socket.orig	2016-11-28 21:47:28.000000000 +0100
++++ rpcbind-0.2.4/systemd/rpcbind.socket	2018-04-11 19:43:27.366604185 +0200
+@@ -5,7 +5,7 @@
+ Before=rpcbind.target
+ 
+ [Socket]
+-ListenStream=/run/rpcbind.sock
++ListenStream=/var/run/rpcbind.sock
+ 
+ # RPC netconfig can't handle ipv6/ipv4 dual sockets
+ BindIPv6Only=ipv6-only
diff --git a/rpcbind.service b/rpcbind.service
deleted file mode 100644
index fab7898..0000000
--- a/rpcbind.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=RPC bind service
-Requires=rpcbind.socket
-After=syslog.target network.target
-
-[Service]
-Type=forking
-EnvironmentFile=-/etc/sysconfig/rpcbind
-ExecStart=/sbin/rpcbind -w $RPCBIND_OPTIONS
-
-[Install]
-WantedBy=multi-user.target
-Also=rpcbind.socket
diff --git a/rpcbind.socket b/rpcbind.socket
deleted file mode 100644
index d63c1d9..0000000
--- a/rpcbind.socket
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=RPCbind Server Activation Socket
-
-[Socket]
-ListenStream=/var/run/rpcbind.sock
-
-[Install]
-WantedBy=sockets.target
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpcbind.git/commitdiff/743aa2864e361cc9aabb9e1365975d257d2ff599



More information about the pld-cvs-commit mailing list