56a319
Name:           rpcbind
56a319
Version:        0.2.0
e7076c
Release:        32%{?dist}
56a319
Summary:        Universal Addresses to RPC Program Number Mapper
56a319
Group:          System Environment/Daemons
56a319
License:        BSD
56a319
URL:            http://nfsv4.bullopensource.org
56a319
56a319
BuildRoot:      %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
56a319
Source0:        http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
56a319
Source1: rpcbind.service
56a319
Source2: rpcbind.socket
56a319
Source3: rpcbind.sysconfig
e7076c
Source4: rpcbind.conf
56a319
56a319
Patch001: rpcbind-0_2_1-rc4.patch
23402f
Patch002: rpcbind-0.2.0-warnings.patch
23402f
Patch003: rpcbind-0.2.0-rpcinfo-mantypo.patch
e7076c
#
e7076c
# RHEL7.2
e7076c
#
e7076c
Patch004: rpcbind-0.2.0-configure.ac.patch
e7076c
Patch005: rpcbind-0.2.0-nss-altfiles.patch
e7076c
Patch006: rpcbind-0.2.0-systemd-socket.patch
e7076c
Patch007: rpcbind-0.2.0-good-term.patch
e7076c
Patch008: rpcbind-0.2.0-warmstart-noerror.patch
56a319
56a319
Requires: glibc-common setup
56a319
Conflicts: man-pages < 2.43-12
56a319
BuildRequires: automake, autoconf, libtool, systemd-units
e7076c
BuildRequires: libtirpc-devel, quota-devel, tcp_wrappers-devel, systemd-devel
56a319
Requires(pre): coreutils shadow-utils
56a319
Requires(post): chkconfig systemd-units systemd-sysv
56a319
Requires(preun): systemd-units
56a319
Requires(postun): systemd-units coreutils
56a319
56a319
Provides: portmap = %{version}-%{release}
56a319
Obsoletes: portmap <= 4.0-65.3
56a319
56a319
%description
56a319
The rpcbind utility is a server that converts RPC program numbers into
56a319
universal addresses.  It must be running on the host to be able to make
56a319
RPC calls on a server on that machine.
56a319
56a319
%prep
56a319
%setup -q
56a319
%patch001 -p1
23402f
# 884165 - Package rpcbind-0.2.0-16.el7 failed RHEL7 RPMdiff testing
23402f
%patch002 -p1
23402f
# 963512 - Cmd rpcinfo usage info is not correct
23402f
%patch003 -p1
e7076c
# 1171291 - Add nss-altfiles to rpcbind user lookup path
e7076c
%patch004 -p1
e7076c
%patch005 -p1
e7076c
# 1203820 - First nfs mount command taking long time after every reboot
e7076c
%patch006 -p1
e7076c
# 1174653 - rpcbind does not shutdown cleanly 
e7076c
%patch007 -p1
e7076c
# 1227852 - rpcbind-0.2.0-27.el7 emits error messages after every reboot
e7076c
%patch008 -p1
56a319
56a319
%build
56a319
%ifarch s390 s390x
56a319
PIE="-fPIE"
56a319
%else
56a319
PIE="-fpie"
56a319
%endif
56a319
export PIE
56a319
23402f
RELRO="-Wl,-z,relro,-z,now"
23402f
56a319
RPCBUSR=rpc
e7076c
RPCBDIR=/run/rpcbind
23402f
CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE $RELRO`"
56a319
56a319
autoreconf -fisv
56a319
%configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
56a319
    --enable-warmstarts \
56a319
    --with-statedir="$RPCBDIR" \
56a319
    --with-rpcuser="$RPCBUSR" \
e7076c
    --with-nss-modules="files altfiles" \
56a319
    --enable-libwrap \
56a319
    --enable-debug
56a319
56a319
make all
56a319
56a319
%install
56a319
rm -rf %{buildroot}
56a319
mkdir -p %{buildroot}{/sbin,/usr/sbin,/etc/sysconfig}
56a319
mkdir -p %{buildroot}%{_unitdir}
56a319
mkdir -p %{buildroot}%{_mandir}/man8
e7076c
mkdir -p %{buildroot}%%{_prefix}/lib/tmpfiles.d/
56a319
mkdir -p %{buildroot}/var/lib/rpcbind
56a319
make DESTDIR=$RPM_BUILD_ROOT install
56a319
23402f
mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}%{_sbindir}
56a319
mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}
56a319
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}
56a319
install -m644 %{SOURCE2} %{buildroot}%{_unitdir}
56a319
install -m644 %{SOURCE3} %{buildroot}/etc/sysconfig/rpcbind
e7076c
install -d -m 0755 %{buildroot}%{_prefix}/lib/tmpfiles.d/
e7076c
install -m644 %{SOURCE4} %{buildroot}%{_prefix}/lib/tmpfiles.d/rpcbind.conf
56a319
56a319
%clean
56a319
rm -rf %{buildroot}
56a319
56a319
%pre
56a319
56a319
# Check the validity of the rpc uid and gid.
56a319
# If they don't exist, create them
56a319
# If they exist but are the wrong value, remove them 
56a319
#   and recreate them with the correct value
56a319
# If they exist and are the correct value do nothing
56a319
rpcid=`getent passwd rpc | cut -d: -f 3`
56a319
if [ -n "$rpcid" -a "$rpcid" != "32" ]; then
56a319
	/usr/sbin/userdel  rpc 2> /dev/null || :
56a319
	/usr/sbin/groupdel rpc 2> /dev/null || : 
56a319
fi
56a319
if [ -z "$rpcid" -o "$rpcid" != "32" ]; then
56a319
	/usr/sbin/groupadd -o -g 32 rpc > /dev/null 2>&1
56a319
	/usr/sbin/useradd -o -l -c "Rpcbind Daemon" -d /var/lib/rpcbind -g 32 \
56a319
    	-M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
56a319
fi
56a319
%post
56a319
if [ $1 -eq 1 ] ; then 
56a319
    # Initial installation
56a319
    /bin/systemctl enable rpcbind.service >/dev/null 2>&1 || :
56a319
fi
56a319
56a319
%preun
56a319
if [ $1 -eq 0 ]; then
56a319
	# Package removal, not upgrade
56a319
	/bin/systemctl --no-reload disable rpcbind.service >/dev/null 2>&1 || :
56a319
	/bin/systemctl stop rpcbind.service >/dev/null 2>&1 || :
56a319
	/usr/sbin/userdel  rpc 2>/dev/null || :
56a319
	/usr/sbin/groupdel rpc 2>/dev/null || :
56a319
	rm -rf /var/lib/rpcbind
56a319
fi
56a319
56a319
%postun
56a319
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
56a319
if [ $1 -ge 1 ]; then
56a319
	# Package upgrade, not uninstall
56a319
	/bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
56a319
fi
56a319
56a319
%triggerun -- rpcbind < 0.2.0-15
56a319
%{_bindir}/systemd-sysv-convert --save rpcbind >/dev/null 2>&1 ||:
56a319
/bin/systemctl --no-reload enable rpcbind.service >/dev/null 2>&1
56a319
/sbin/chkconfig --del rpcbind >/dev/null 2>&1 || :
56a319
/bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
56a319
e7076c
%triggerun -- rpcbind > 0.2.0-26
e7076c
/bin/systemctl enable rpcbind.socket >/dev/null 2>&1 || :
e7076c
e7076c
%triggerpostun -- rpcbind < 0.2.0-29
e7076c
[ ! -d /run/rpcbind ] && mkdir /run/rpcbind
e7076c
chown rpc:rpc /run/rpcbind
e7076c
[ -f /var/lib/rpcbind/rpcbind.xdr ] && \
e7076c
	mv /var/lib/rpcbind/rpcbind.xdr /run/rpcbind
e7076c
[ -f /var/lib/rpcbind/portmap.xdr ] && \
e7076c
	mv /var/lib/rpcbind/portmap.xdr /run/rpcbind
e7076c
56a319
%files
56a319
%defattr(-,root,root)
56a319
%config(noreplace) /etc/sysconfig/rpcbind
56a319
%doc AUTHORS ChangeLog README
23402f
%{_sbindir}/rpcbind
56a319
%{_sbindir}/rpcinfo
56a319
%{_mandir}/man8/*
56a319
%{_unitdir}/rpcbind.service
56a319
%{_unitdir}/rpcbind.socket
e7076c
%{_prefix}/lib/tmpfiles.d/rpcbind.conf
56a319
%dir %attr(700,rpc,rpc) /var/lib/rpcbind
56a319
56a319
%changelog
e7076c
* Fri Oct  2 2015 Steve Dickson <steved@redhat.com> - 0.2.0-32
e7076c
- Fixed typo in triggerpostu (bz 1268139)
e7076c
e7076c
* Mon Sep 28 2015 Steve Dickson <steved@redhat.com> - 0.2.0-31
e7076c
- Use systemd-tmpfiles to create the warmstart direcory (bz 1240817)
e7076c
e7076c
* Tue Sep 22 2015 Steve Dickson <steved@redhat.com> - 0.2.0-30
e7076c
- Create the warmstart file with the correct uid/gid (bz 1240817)
e7076c
e7076c
* Thu Sep 10 2015 Steve Dickson <steved@redhat.com> - 0.2.0-29
e7076c
- Change RPCBDIR to be /run since that will exist after a
e7076c
  reboot and bindings wil be perserved during upgrades
e7076c
  but not reboots. (bz 1240817)
e7076c
e7076c
* Thu Jul 30 2015 Steve Dickson <steved@redhat.com> - 0.2.0-28
e7076c
- Remove error message on warmstart (bz 1227852)
e7076c
e7076c
* Mon May  4 2015 Steve Dickson <steved@redhat.com> - 0.2.0-27
e7076c
- Add nss-altfiles to rpcbind user lookup path (bz 1171291)
e7076c
- Add support for systemd socket activation (bz 1203820)
e7076c
- Added a tmpfiles.d configuration (bz 1181779)
e7076c
- Shutdown cleanly (bz 1174653)
e7076c
23402f
* Sat Nov 15 2014 Steve Dickson <steved@redhat.com> - 0.2.0-26
23402f
- Moved rpcbind from /sbin to /usr/sbin (bz 1159683)
23402f
23402f
* Mon Sep 22 2014 Steve Dickson <steved@redhat.com> - 0.2.0-25
23402f
- Fixed some warnings in in6_fillscopeid() (bz 884165)
23402f
- Fixed typo in rpcinfo manpage (bz 963512)
23402f
- Removed unnecessary targets from rpcbind.service  (bz 1036791)
23402f
23402f
* Fri Sep 19 2014 Steve Dickson <steved@redhat.com> - 0.2.0-24
23402f
- Added the RELRO CFLAGS (bz 1092513)
23402f
422e45
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 0.2.0-23
422e45
- Mass rebuild 2014-01-24
422e45
422e45
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 0.2.0-22
422e45
- Mass rebuild 2013-12-27
422e45
56a319
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-21
56a319
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
56a319
56a319
* Tue Oct 23 2012 Steve Dickson <steved@redhat.com> - 0.2.0-20
56a319
- Update to the latest upstream release: rpcbind-0_2_1-rc4 (bz 869365)
56a319
56a319
* Tue Oct 16 2012 Steve Dickson <steved@redhat.com> - 0.2.0-19
56a319
- Renamed RPCBINDOPTS to RPCBIND_ARGS for backward compatibility (bz 861025)
56a319
56a319
* Sun Oct 14 2012 Steve Dickson <steved@redhat.com> - 0.2.0-18
56a319
- Fixed typo causing rpcbind to run as root (bz 734598)
56a319
- Added /etc/sysconfig/rpcbind config file (bz 861025)
56a319
56a319
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-17
56a319
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
56a319
56a319
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-16
56a319
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
56a319
56a319
* Mon Sep 12 2011 Steve Dickson <steved@redhat.com> - 0.2.0-15
56a319
- Bumped up the tigger version to this version, 0.2.0-15 (bz 713574)
56a319
56a319
* Fri Sep  9 2011 Tom Callaway <spot@fedoraproject.org> - 0.2.0-14
56a319
- fix scriptlets to enable service by default
56a319
56a319
* Fri Jul  8 2011 Steve Dickson <steved@redhat.com> - 0.2.0-13
56a319
- Spec file clean up
56a319
56a319
* Thu Jul  7 2011 Steve Dickson <steved@redhat.com> - 0.2.0-12
56a319
- Migrated SysV initscripts to systemd (bz 713574)
56a319
56a319
* Thu Mar 17 2011 Steve Dickson <steved@redhat.com> - 0.2.0-11
56a319
- Updated to the latest upstream release: rpcbind-0_2_1-rc3
56a319
56a319
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-10
56a319
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
56a319
56a319
* Mon Dec 13 2010 Steve Dickson <steved@redhat.com> - 0.2.0-9
56a319
- Fixed an incorrect exit code for service rpcbind status (bz 662411)
56a319
56a319
* Tue Nov 30 2010 Steve Dickson <steved@redhat.com> - 0.2.0-8
56a319
- Updated to the latest upstream release: rpcbind-0.2.1-rc2
56a319
56a319
* Fri Jul 16 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 0.2.0-7
56a319
- correct license tag to BSD
56a319
56a319
* Tue Jul 13 2010 Steve Dickson <steved@redhat.com> - 0.2.0-6
56a319
- Made initscript LSB compliant (bz 614193)
56a319
- Added no fork patch
56a319
56a319
* Tue Jul  6 2010 Steve Dickson <steved@redhat.com> - 0.2.0-5
56a319
- Set SO_REUSEADDR on listening sockets (bz 597356)
56a319
56a319
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-4
56a319
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
56a319
56a319
* Mon Jul 06 2009 Adam Jackson <ajax@redhat.com> 0.2.0-3
56a319
- Requires(pre): coreutils for cut(1).
56a319
56a319
* Thu Jun 25 2009 Steve Dickson <steved@redhat.com> - 0.2.0-2
56a319
- Fixed pre scriptle failure during upgrades (bz 507364)
56a319
- Corrected the usage info to match what the rpcbind man
56a319
    page says. (bz 466332)
56a319
- Correct package issues (bz 503508)
56a319
56a319
* Fri May 29 2009 Steve Dickson <steved@redhat.com> - 0.2.0-1
56a319
- Updated to latest upstream release: 0.2.0
56a319
56a319
* Tue May 19 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 0.1.7-3
56a319
- Replace the Sun RPC license with the BSD license, with the explicit permission of Sun Microsystems
56a319
56a319
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
56a319
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
56a319
56a319
* Wed Nov 19 2008 Steve Dickson <steved@redhat.com>  0.1.7-1
56a319
- Update to latest upstream release: 0.1.7
56a319
56a319
* Tue Sep 30 2008 Steve Dickson <steved@redhat.com>  0.1.6-3
56a319
- Fixed a typo in the rpcbind.init script that stop warm starts
56a319
  from happening with conrestarts
56a319
- Fixed scriptlet failure (bz 462533)
56a319
56a319
* Tue Sep 16 2008 Steve Dickson <steved@redhat.com> 0.1.6-2
56a319
- Added usptream patches 01 thru 03 that do:
56a319
    * Introduce helpers for ipprot/netid mapping
56a319
    * Change how we decide on the netids to use for portmap
56a319
    * Simplify port live check in pmap_svc.c
56a319
56a319
* Wed Jul  9 2008 Steve Dickson <steved@redhat.com> 0.1.6-1
56a319
- Updated to latest upstream release 0.1.6
56a319
56a319
* Wed Jul  2 2008 Steve Dickson <steved@redhat.com> 0.1.5-5
56a319
- Fixed SYNOPSIS section in the rpcinfo man page (bz 453729)
56a319
56a319
* Fri Jun 27 2008 Steve Dickson <steved@redhat.com> 0.1.5-4
56a319
- Removed the documentation about the non-existent 
56a319
  '-L' flag (bz 446915)
56a319
56a319
* Fri Jun 27 2008 Steve Dickson <steved@redhat.com> 0.1.5-3
56a319
- Set password and service lookups to be local (bz 447092)
56a319
56a319
* Mon Jun 23 2008 Steve Dickson <steved@redhat.com> 0.1.5-2
56a319
- rpcbind needs to downgrade to non-priviledgied group.
56a319
56a319
* Mon Jun 23 2008 Steve Dickson <steved@redhat.com> 0.1.5-1
56a319
- Updated to latest upstream release 0.1.5
56a319
56a319
* Mon Feb 11 2008 Steve Dickson <steved@redhat.com> 0.1.4-14
56a319
- Fixed a warning in pmap_svc.c
56a319
- Cleaned up warmstarts so uid are longer needed, also
56a319
  changed condrestarts to use warmstarts. (bz 428496)
56a319
56a319
* Thu Jan 24 2008 Steve Dickson <steved@redhat.com> 0.1.4-13
56a319
- Fixed connectivity with Mac OS clients by making sure handle_reply()
56a319
  sets the correct fromlen in its recvfrom() call (bz 244492)
56a319
56a319
* Mon Dec 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-12
56a319
- Changed is_loopback() and check_access() see if the calling
56a319
  address is an address on a local interface, just not a loopback
56a319
  address (bz 358621).
56a319
56a319
* Wed Oct 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-11
56a319
- Reworked logic in initscript so the correct exit is 
56a319
  used when networking does not exist or is set up
56a319
  incorrectly.
56a319
56a319
* Tue Oct 16 2007 Steve Dickson <steved@redhat.com> 0.1.4-10
56a319
- Corrected a typo in the initscript from previous 
56a319
  commit.
56a319
56a319
* Mon Oct 15 2007 Steve Dickson <steved@redhat.com> 0.1.4-9
56a319
- Fixed typo in Summary (bz 331811)
56a319
- Corrected init script (bz 247046)
56a319
56a319
* Sat Sep 15 2007 Steve Dickson <steved@redhat.com> 0.1.4-8
56a319
- Fixed typo in init script (bz 248285)
56a319
- Added autoconf rules to turn on secure host checking
56a319
  via libwrap. Also turned on host check by default (bz 248284)
56a319
- Changed init script to start service in runlevel 2 (bz 251568)
56a319
- Added a couple missing Requires(pre) (bz 247134)
56a319
56a319
* Fri May 25 2007 Steve Dickson <steved@redhat.com> 0.1.4-7
56a319
- Fixed condrestarts (bz 241332)
56a319
56a319
* Tue May 22 2007 Steve Dickson <steved@redhat.com> 0.1.4-6
56a319
- Fixed an ipv6 related segfault on startup (bz 240873)
56a319
56a319
* Wed Apr 18 2007 Steve Dickson <steved@redhat.com> 0.1.4-5
56a319
- Added dependency on setup which contains the correct
56a319
  rpcbind /etc/service entry which in turns stops 
56a319
  rpcbind from haning when NIS is enabled. (bz 236865)
56a319
56a319
* Wed Apr 11 2007 Jeremy Katz <katzj@redhat.com> - 0.1.4-4
56a319
- change man-pages requires into a conflicts as we don't have to have 
56a319
  man-pages installed, but if we do, we need the newer version
56a319
56a319
* Fri Apr  6 2007 Steve Dickson <steved@redhat.com> 0.1.4-3
56a319
- Fixed the Provides and Obsoletes statments to correctly
56a319
  obsolete the portmap package.
56a319
* Tue Apr  3 2007 Steve Dickson <steved@redhat.com> 0.1.4-2
56a319
- Added dependency on glibc-common which allows the
56a319
  rpcinfo command to be installed in the correct place.
56a319
- Added dependency on man-pages so the rpcinfo man 
56a319
  pages don't conflict.
56a319
- Added the creation of /var/lib/rpcbind which will be
56a319
  used to store state files.
56a319
- Make rpcbind run with the 'rpc' uid/gid when it exists.
56a319
56a319
* Wed Feb 21 2007 Steve Dickson <steved@redhat.com> 0.1.4-1
56a319
- Initial commit
56a319
- Spec reviewed (bz 228894)
56a319
- Added the Provides/Obsoletes which should
56a319
  cause rpcbind to replace portmapper