|
@@ -1,21 +1,32 @@
|
|
|
+%bcond_with systemd
|
|
|
+
|
|
|
%{!?_initddir:%define _initddir /etc/rc.d/init.d}
|
|
|
+%global rpcbind_user_group rpc
|
|
|
|
|
|
%define _unpackaged_files_terminate_build 1
|
|
|
|
|
|
Name: rpcbind
|
|
|
Version: 1.2.5
|
|
|
-Release: 1%{?_dist_release}
|
|
|
+Release: 2%{?_dist_release}%{?with_systemd:.systemd}
|
|
|
Summary: Universal Addresses to RPC Program Number Mapper
|
|
|
Group: System Environment/Daemons
|
|
|
-License: GPL
|
|
|
-URL: http://nfsv4.bullopensource.org
|
|
|
-
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|
|
+Vendor: Project Vine
|
|
|
+Distribution: Vine Linux
|
|
|
+
|
|
|
+License: BSD
|
|
|
+URL: http://nfsv4.bullopensource.org
|
|
|
Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
|
|
|
-Source1: rpcbind.init
|
|
|
-Source2: %{name}.sysconfig
|
|
|
+Source1: rpcbind.init
|
|
|
+Source2: %{name}.sysconfig
|
|
|
|
|
|
-Patch001: rpcbind-1.2.5-rpcinfo-bufoverflow.patch
|
|
|
+Patch001: rpcbind-1.2.5-rpcinfo-bufoverflow.patch
|
|
|
+
|
|
|
+Patch100: rpcbind-0.2.3-systemd-envfile.patch
|
|
|
+Patch101: rpcbind-0.2.3-systemd-tmpfiles.patch
|
|
|
+Patch102: rpcbind-0.2.4-runstatdir.patch
|
|
|
+Patch103: rpcbind-0.2.4-systemd-service.patch
|
|
|
+Patch104: rpcbind-0.2.4-systemd-rundir.patch
|
|
|
|
|
|
Requires: glibc-common setup
|
|
|
Conflicts: man-pages < 2.43-12
|
|
@@ -28,26 +39,46 @@ BuildRequires: tcp_wrappers
|
|
|
Requires(pre): /usr/sbin/groupadd /usr/sbin/groupdel
|
|
|
Requires(pre): /usr/sbin/useradd /usr/sbin/userdel
|
|
|
Requires(pre): coreutils
|
|
|
+Requires(pre): shadow-utils
|
|
|
+%if %{with systemd}
|
|
|
+%global rpcbind_state_dir /run/rpcbind
|
|
|
+BuildRequires: systemd
|
|
|
+BuildRequires: systemd-devel
|
|
|
+%{?systemd_requires}
|
|
|
+Requires(postun): coreutils
|
|
|
+%else
|
|
|
+%global rpcbind_state_dir %{_sharedstatedir}/rpcbind
|
|
|
Requires(post): /sbin/chkconfig
|
|
|
-Requires(post): /sbin/chkconfig
|
|
|
+Requires(post): /sbin/service
|
|
|
+Requires(preun): /sbin/chkconfig
|
|
|
+Requires(preun): /sbin/service
|
|
|
+Requires(postun): /sbin/service
|
|
|
+%endif
|
|
|
|
|
|
#Provides: portmap = %{version}-%{release}
|
|
|
Provides: portmap = 4.0-66%{_dist_release}
|
|
|
Obsoletes: portmap <= 4.0-65.3
|
|
|
|
|
|
-Vendor: Project Vine
|
|
|
-Distribution: Vine Linux
|
|
|
-
|
|
|
%description
|
|
|
The rpcbind utility is a server that converts RPC program numbers into
|
|
|
universal addresses. It must be running on the host to be able to make
|
|
|
RPC calls on a server on that machine.
|
|
|
|
|
|
+
|
|
|
%prep
|
|
|
%setup -q
|
|
|
# 1637562 - rpcinfo: Fix stack buffer overflow
|
|
|
%patch001 -p1
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
+%patch100 -p1
|
|
|
+%patch101 -p1
|
|
|
+%patch102 -p1
|
|
|
+%patch103 -p1
|
|
|
+%patch104 -p1
|
|
|
+%endif
|
|
|
+
|
|
|
+
|
|
|
%build
|
|
|
%ifarch s390 s390x
|
|
|
PIE="-fPIE"
|
|
@@ -56,18 +87,17 @@ PIE="-fpie"
|
|
|
%endif
|
|
|
export PIE
|
|
|
|
|
|
-RPCBUSR=rpc
|
|
|
-RPCBDIR=/var/lib/rpcbind
|
|
|
CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE`"
|
|
|
|
|
|
autoreconf -fisv
|
|
|
%configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
|
|
|
--enable-warmstarts \
|
|
|
- --with-statedir="$RPCBDIR" \
|
|
|
- --with-rpcuser="$RPCBUSR" \
|
|
|
+ --with-statedir="%rpcbind_state_dir" \
|
|
|
+ --with-rpcuser="%rpcbind_user_group" \
|
|
|
--with-nss-modules="files altfiles" \
|
|
|
- --enable-libwrap \
|
|
|
+%if !%{with systemd}
|
|
|
--with-systemdsystemunitdir=no \
|
|
|
+%endif
|
|
|
--enable-debug
|
|
|
|
|
|
make all
|
|
@@ -77,21 +107,33 @@ make all
|
|
|
rm -rf %{buildroot}
|
|
|
mkdir -p %{buildroot}/sbin
|
|
|
mkdir -p %{buildroot}/usr/sbin
|
|
|
-mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
|
|
|
mkdir -p %{buildroot}%{_mandir}/man8
|
|
|
-mkdir -p %{buildroot}/var/lib/rpcbind
|
|
|
+mkdir -p %{buildroot}%{rpcbind_state_dir}
|
|
|
+%if %{with systemd}
|
|
|
+mkdir -p %{buildroot}%{_unitdir}
|
|
|
+mkdir -p %{buildroot}%{_tmpfilesdir}
|
|
|
+%else
|
|
|
+mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
|
|
|
+install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/rpcbind
|
|
|
+%endif
|
|
|
+
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
|
-install -m 755 %{SOURCE1} %{buildroot}%{_initddir}/rpcbind
|
|
|
install -m 644 %{SOURCE2} %{buildroot}/etc/sysconfig/rpcbind
|
|
|
|
|
|
mv %{buildroot}%{_sbindir}/rpcbind %{buildroot}/sbin/
|
|
|
mv %{buildroot}%{_bindir}/rpcinfo %{buildroot}%{_sbindir}/
|
|
|
|
|
|
+%if %{with systemd}
|
|
|
+sed -i -e 's|/usr/sbin/|/sbin/|' %{buildroot}%{_unitdir}/rpcbind.service
|
|
|
+%endif
|
|
|
+
|
|
|
+
|
|
|
%clean
|
|
|
rm -rf %{buildroot}
|
|
|
|
|
|
+
|
|
|
%pre
|
|
|
|
|
|
# Check the validity of the rpc uid and gid.
|
|
@@ -109,34 +151,58 @@ if [ -z "$rpcid" -o "$rpcid" != "32" ]; then
|
|
|
/usr/sbin/useradd -o -l -c "Rpcbind Daemon" -d /var/lib/rpcbind -g 32 \
|
|
|
-M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
|
|
|
fi
|
|
|
+
|
|
|
%post
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_post rpcbind.service rpcbind.socket
|
|
|
+%else
|
|
|
/sbin/chkconfig --add %{name}
|
|
|
+%endif
|
|
|
|
|
|
%preun
|
|
|
-if [ $1 -eq 0 ]; then
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_preun rpcbind.service rpcbind.socket
|
|
|
+%else
|
|
|
+if [ $1 -eq 0 -o -x /bin/systemctl ]; then
|
|
|
service rpcbind stop > /dev/null 2>&1
|
|
|
/sbin/chkconfig --del %{name}
|
|
|
/usr/sbin/userdel rpc 2>/dev/null || :
|
|
|
/usr/sbin/groupdel rpc 2>/dev/null || :
|
|
|
rm -rf /var/lib/rpcbind
|
|
|
fi
|
|
|
+%endif
|
|
|
+
|
|
|
%postun
|
|
|
-if [ "$1" -ge "1" ]; then
|
|
|
+%if %{with systemd}
|
|
|
+%systemd_postun_with_restart rpcbind.service rpcbind.socket
|
|
|
+%else
|
|
|
+if [ "$1" -ge "1" -a ! -x /bin/systemctl ]; then
|
|
|
service rpcbind condrestart > /dev/null 2>&1
|
|
|
fi
|
|
|
+%endif
|
|
|
|
|
|
%files
|
|
|
%defattr(-,root,root)
|
|
|
+%license COPYING
|
|
|
%doc AUTHORS ChangeLog README
|
|
|
/sbin/rpcbind
|
|
|
%{_sbindir}/rpcinfo
|
|
|
%{_mandir}/man8/*
|
|
|
-%config %{_initddir}/rpcbind
|
|
|
%config(noreplace) /etc/sysconfig/rpcbind
|
|
|
+%if %{with systemd}
|
|
|
+%{_unitdir}/%{name}.service
|
|
|
+%{_unitdir}/%{name}.socket
|
|
|
+%{_tmpfilesdir}/%{name}.conf
|
|
|
+%else
|
|
|
+%config %{_initddir}/rpcbind
|
|
|
+%endif
|
|
|
+%attr(0700, %{rpcbind_user_group}, %{rpcbind_user_group}) %dir %{rpcbind_state_dir}
|
|
|
|
|
|
-%dir %attr(700,rpc,rpc) /var/lib/rpcbind
|
|
|
|
|
|
%changelog
|
|
|
+* Tue Apr 14 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.2.5-2
|
|
|
+- added systemd support (disabled as default).
|
|
|
+
|
|
|
* Thu Nov 29 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 1.2.5-1
|
|
|
- updated to 1.2.5.
|
|
|
- added Patch001.
|