42c9f95
%{!?_initddir:%define _initddir /etc/rc.d/init.d}
c671507
c671507
Name:           rpcbind
a093c95
Version:        0.2.0
3dd7e69
Release:	11%{?dist}
970296b
Summary:        Universal Addresses to RPC Program Number Mapper
c671507
Group:          System Environment/Daemons
0f199df
License:        BSD
0f1e0e3
URL:            http://nfsv4.bullopensource.org
c671507
c671507
BuildRoot:      %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
d85eb9a
Source0:        http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
c671507
Source1: rpcbind.init
c671507
3dd7e69
Patch001: rpcbind-0_2_1-rc3.patch
7bccfbc
42c9f95
Requires: glibc-common setup
445e49e
Conflicts: man-pages < 2.43-12
c671507
BuildRequires: automake, autoconf, libtool
88c5ca5
BuildRequires: libtirpc-devel, quota-devel, tcp_wrappers-devel
4d36567
Requires(pre): /usr/sbin/groupadd  /usr/sbin/groupdel
4d36567
Requires(pre): /usr/sbin/useradd  /usr/sbin/userdel
dfcb33f
Requires(pre): coreutils
c671507
Requires(post): /sbin/chkconfig
c671507
Requires(post): /sbin/chkconfig
c671507
b026e72
Provides: portmap = %{version}-%{release}
b026e72
Obsoletes: portmap <= 4.0-65.3
ca3cc0f
c671507
%description
c671507
The rpcbind utility is a server that converts RPC program numbers into
c671507
universal addresses.  It must be running on the host to be able to make
c671507
RPC calls on a server on that machine.
c671507
c671507
%prep
c671507
%setup -q
7bccfbc
%patch001 -p1
c671507
c671507
%build
c671507
%ifarch s390 s390x
c671507
PIE="-fPIE"
c671507
%else
c671507
PIE="-fpie"
c671507
%endif
c671507
export PIE
5af042e
d16c7a4
RPCBUSR=rpc
5af042e
RPCBDIR=/var/lib/rpcbind
c671507
CFLAGS="`echo $RPM_OPT_FLAGS $ARCH_OPT_FLAGS $PIE`"
c671507
c671507
autoreconf -fisv
c671507
%configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
434ac98
    --enable-warmstarts \
5af042e
    --with-statedir="$RPCBDIR" \
d16c7a4
    --with-rpcuser="$RPCBUSR" \
f4e8f18
    --enable-libwrap \
434ac98
    --enable-debug
c671507
c671507
make all
c671507
c671507
%install
c671507
rm -rf %{buildroot}
cd28606
mkdir -p %{buildroot}/sbin
cd28606
mkdir -p %{buildroot}/usr/sbin
c671507
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
c671507
mkdir -p %{buildroot}%{_mandir}/man8
cd28606
mkdir -p %{buildroot}/var/lib/rpcbind
7bccfbc
make DESTDIR=$RPM_BUILD_ROOT install
c671507
7bccfbc
mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}/sbin
7bccfbc
mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}
42c9f95
install -m 755 ${RPM_SOURCE_DIR}/rpcbind.init ${RPM_BUILD_ROOT}%{_initddir}/rpcbind
c671507
c671507
%clean
0f1e0e3
rm -rf %{buildroot}
c671507
cd28606
%pre
cd28606
42c9f95
# Check the validity of the rpc uid and gid.
42c9f95
# If they don't exist, create them
42c9f95
# If they exist but are the wrong value, remove them 
42c9f95
#   and recreate them with the correct value
42c9f95
# If they exist and are the correct value do nothing
42c9f95
rpcid=`getent passwd rpc | cut -d: -f 3`
42c9f95
if [ -n "$rpcid" -a "$rpcid" != "32" ]; then
42c9f95
	/usr/sbin/userdel  rpc 2> /dev/null || :
42c9f95
	/usr/sbin/groupdel rpc 2> /dev/null || : 
42c9f95
fi
42c9f95
if [ -z "$rpcid" -o "$rpcid" != "32" ]; then
42c9f95
	/usr/sbin/groupadd -o -g 32 rpc > /dev/null 2>&1
42c9f95
	/usr/sbin/useradd -o -l -c "Rpcbind Daemon" -d /var/lib/rpcbind -g 32 \
42c9f95
    	-M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
42c9f95
fi
c671507
%post 
c671507
/sbin/chkconfig --add %{name}
c671507
c671507
%preun
c671507
if [ $1 -eq 0 ]; then
434ac98
    service rpcbind stop > /dev/null 2>&1
434ac98
    /sbin/chkconfig --del %{name}
cd28606
	/usr/sbin/userdel  rpc 2>/dev/null || :
cd28606
	/usr/sbin/groupdel rpc 2>/dev/null || :
cd28606
	rm -rf /var/lib/rpcbind
c671507
fi
c671507
%postun
c671507
if [ "$1" -ge "1" ]; then
434ac98
    service rpcbind condrestart > /dev/null 2>&1
c671507
fi
c671507
c671507
%files
c671507
%defattr(-,root,root)
c671507
%doc AUTHORS ChangeLog README
cd28606
/sbin/rpcbind
8a2c049
%{_sbindir}/rpcinfo
c671507
%{_mandir}/man8/*
42c9f95
%config %{_initddir}/rpcbind
c671507
cd28606
%dir %attr(700,rpc,rpc) /var/lib/rpcbind
cd28606
c671507
%changelog
3dd7e69
* Thu Mar 17 2011 Steve Dickson <steved@redhat.com> - 0.2.0-11
3dd7e69
- Updated to the latest upstream release: rpcbind-0_2_1-rc3
3dd7e69
bec76d5
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-10
bec76d5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
bec76d5
390a5c7
* Mon Dec 13 2010 Steve Dickson <steved@redhat.com> - 0.2.0-9
390a5c7
- Fixed an incorrect exit code for service rpcbind status (bz 662411)
390a5c7
7bccfbc
* Tue Nov 30 2010 Steve Dickson <steved@redhat.com> - 0.2.0-8
7bccfbc
- Updated to the latest upstream release: rpcbind-0.2.1-rc2
7bccfbc
0f199df
* Fri Jul 16 2010 Tom "spot" Callaway <tcallawa@redhat.com> - 0.2.0-7
0f199df
- correct license tag to BSD
0f199df
940cb45
* Tue Jul 13 2010 Steve Dickson <steved@redhat.com> - 0.2.0-6
940cb45
- Made initscript LSB compliant (bz 614193)
940cb45
- Added no fork patch
940cb45
3c85c93
* Tue Jul  6 2010 Steve Dickson <steved@redhat.com> - 0.2.0-5
3c85c93
- Set SO_REUSEADDR on listening sockets (bz 597356)
3c85c93
1bccd3a
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2.0-4
1bccd3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
1bccd3a
dfcb33f
* Mon Jul 06 2009 Adam Jackson <ajax@redhat.com> 0.2.0-3
dfcb33f
- Requires(pre): coreutils for cut(1).
dfcb33f
42c9f95
* Thu Jun 25 2009 Steve Dickson <steved@redhat.com> - 0.2.0-2
42c9f95
- Fixed pre scriptle failure during upgrades (bz 507364)
42c9f95
- Corrected the usage info to match what the rpcbind man
42c9f95
    page says. (bz 466332)
42c9f95
- Correct package issues (bz 503508)
42c9f95
a093c95
* Fri May 29 2009 Steve Dickson <steved@redhat.com> - 0.2.0-1
a093c95
- Updated to latest upstream release: 0.2.0
a093c95
b60b288
* Tue May 19 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 0.1.7-3
b60b288
- Replace the Sun RPC license with the BSD license, with the explicit permission of Sun Microsystems
b60b288
46b5fac
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.7-2
46b5fac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
46b5fac
208b1ff
* Wed Nov 19 2008 Steve Dickson <steved@redhat.com>  0.1.7-1
208b1ff
- Update to latest upstream release: 0.1.7
208b1ff
d9a0d64
* Tue Sep 30 2008 Steve Dickson <steved@redhat.com>  0.1.6-3
d9a0d64
- Fixed a typo in the rpcbind.init script that stop warm starts
d9a0d64
  from happening with conrestarts
eb199b6
- Fixed scriptlet failure (bz 462533)
d9a0d64
e10053c
* Tue Sep 16 2008 Steve Dickson <steved@redhat.com> 0.1.6-2
e10053c
- Added usptream patches 01 thru 03 that do:
e10053c
    * Introduce helpers for ipprot/netid mapping
e10053c
    * Change how we decide on the netids to use for portmap
e10053c
    * Simplify port live check in pmap_svc.c
e10053c
6a551c2
* Wed Jul  9 2008 Steve Dickson <steved@redhat.com> 0.1.6-1
6a551c2
- Updated to latest upstream release 0.1.6
6a551c2
46da9bb
* Wed Jul  2 2008 Steve Dickson <steved@redhat.com> 0.1.5-5
46da9bb
- Fixed SYNOPSIS section in the rpcinfo man page (bz 453729)
46da9bb
3de7950
* Fri Jun 27 2008 Steve Dickson <steved@redhat.com> 0.1.5-4
3de7950
- Removed the documentation about the non-existent 
3de7950
  '-L' flag (bz 446915)
3de7950
33e86f3
* Fri Jun 27 2008 Steve Dickson <steved@redhat.com> 0.1.5-3
33e86f3
- Set password and service lookups to be local (bz 447092)
33e86f3
33e86f3
* Mon Jun 23 2008 Steve Dickson <steved@redhat.com> 0.1.5-2
27d02e3
- rpcbind needs to downgrade to non-priviledgied group.
27d02e3
27d02e3
* Mon Jun 23 2008 Steve Dickson <steved@redhat.com> 0.1.5-1
d85eb9a
- Updated to latest upstream release 0.1.5
d85eb9a
604a14b
* Mon Feb 11 2008 Steve Dickson <steved@redhat.com> 0.1.4-14
604a14b
- Fixed a warning in pmap_svc.c
604a14b
- Cleaned up warmstarts so uid are longer needed, also
604a14b
  changed condrestarts to use warmstarts. (bz 428496)
604a14b
304cd9a
* Thu Jan 24 2008 Steve Dickson <steved@redhat.com> 0.1.4-13
304cd9a
- Fixed connectivity with Mac OS clients by making sure handle_reply()
304cd9a
  sets the correct fromlen in its recvfrom() call (bz 244492)
304cd9a
491d3c0
* Mon Dec 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-12
491d3c0
- Changed is_loopback() and check_access() see if the calling
491d3c0
  address is an address on a local interface, just not a loopback
491d3c0
  address (bz 358621).
491d3c0
33dfe4f
* Wed Oct 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-11
33dfe4f
- Reworked logic in initscript so the correct exit is 
33dfe4f
  used when networking does not exist or is set up
33dfe4f
  incorrectly.
33dfe4f
b4db9b3
* Tue Oct 16 2007 Steve Dickson <steved@redhat.com> 0.1.4-10
b4db9b3
- Corrected a typo in the initscript from previous 
b4db9b3
  commit.
b4db9b3
970296b
* Mon Oct 15 2007 Steve Dickson <steved@redhat.com> 0.1.4-9
970296b
- Fixed typo in Summary (bz 331811)
970296b
- Corrected init script (bz 247046)
970296b
f4e8f18
* Sat Sep 15 2007 Steve Dickson <steved@redhat.com> 0.1.4-8
e9338cb
- Fixed typo in init script (bz 248285)
f4e8f18
- Added autoconf rules to turn on secure host checking
f4e8f18
  via libwrap. Also turned on host check by default (bz 248284)
6c2c090
- Changed init script to start service in runlevel 2 (bz 251568)
4d36567
- Added a couple missing Requires(pre) (bz 247134)
6c2c090
a9ce663
* Fri May 25 2007 Steve Dickson <steved@redhat.com> 0.1.4-7
a9ce663
- Fixed condrestarts (bz 241332)
a9ce663
bb33986
* Tue May 22 2007 Steve Dickson <steved@redhat.com> 0.1.4-6
bb33986
- Fixed an ipv6 related segfault on startup (bz 240873)
bb33986
b031d84
* Wed Apr 18 2007 Steve Dickson <steved@redhat.com> 0.1.4-5
b031d84
- Added dependency on setup which contains the correct
b031d84
  rpcbind /etc/service entry which in turns stops 
b031d84
  rpcbind from haning when NIS is enabled. (bz 236865)
b031d84
445e49e
* Wed Apr 11 2007 Jeremy Katz <katzj@redhat.com> - 0.1.4-4
445e49e
- change man-pages requires into a conflicts as we don't have to have 
445e49e
  man-pages installed, but if we do, we need the newer version
445e49e
b026e72
* Fri Apr  6 2007 Steve Dickson <steved@redhat.com> 0.1.4-3
b026e72
- Fixed the Provides and Obsoletes statments to correctly
b026e72
  obsolete the portmap package.
f766b07
* Tue Apr  3 2007 Steve Dickson <steved@redhat.com> 0.1.4-2
8a2c049
- Added dependency on glibc-common which allows the
8a2c049
  rpcinfo command to be installed in the correct place.
cd28606
- Added dependency on man-pages so the rpcinfo man 
cd28606
  pages don't conflict.
11b0919
- Added the creation of /var/lib/rpcbind which will be
cd28606
  used to store state files.
5af042e
- Make rpcbind run with the 'rpc' uid/gid when it exists.
8a2c049
434ac98
* Wed Feb 21 2007 Steve Dickson <steved@redhat.com> 0.1.4-1
c671507
- Initial commit
434ac98
- Spec reviewed (bz 228894)
ca3cc0f
- Added the Provides/Obsoletes which should
ca3cc0f
  cause rpcbind to replace portmapper