c671507
%{!?_initdir:%define _initdir /etc/rc.d/init.d}
c671507
c671507
Name:           rpcbind
c671507
Version:        0.1.4
5f6118a
Release: 		12%{?dist}
970296b
Summary:        Universal Addresses to RPC Program Number Mapper
c671507
Group:          System Environment/Daemons
c671507
License:        GPL
0f1e0e3
URL:            http://nfsv4.bullopensource.org
c671507
c671507
BuildRoot:      %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
c671507
Source0:        http://nfsv4.bullopensource.org/tarballs/rpcbind/rpcbind-0.1.4.tar.bz2
c671507
Source1: rpcbind.init
c671507
cd28606
Requires: glibc-common >= 2.5.90-20 
b031d84
Requires: setup >= 2.6.4-1
445e49e
Conflicts: man-pages < 2.43-12
c671507
BuildRequires: automake, autoconf, libtool
e5d0656
BuildRequires: libtirpc-devel, quota, tcp_wrappers-devel
4d36567
Requires(pre): /usr/sbin/groupadd  /usr/sbin/groupdel
4d36567
Requires(pre): /usr/sbin/useradd  /usr/sbin/userdel
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
Patch1: rpcbind-0.1.4-compile.patch
c671507
Patch2: rpcbind-0.1.4-debug.patch
c671507
Patch3: rpcbind-0.1.4-warmstarts.patch
5af042e
Patch4: rpcbind-0.1.4-rpcuser.patch
bb33986
Patch5: rpcbind-0.1.4-iff_up.patch
f4e8f18
Patch6: rpcbind-0.1.4-libwrap.patch
5f6118a
Patch7: rpcbind-0.1.4-localaddr.patch
c671507
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
c671507
c671507
%patch1 -p1
c671507
%patch2 -p1
c671507
%patch3 -p1
d16c7a4
%patch4 -p1
bb33986
# 240873: rpcbind segfaults on startup - ipv6 related
bb33986
%patch5 -p1
f4e8f18
# 248284: rpcbind ignores libwrap files
f4e8f18
%patch6 -p1
5f6118a
# 358621: rpcbind-0.1.4-8.fc7 breaks NFS
5f6118a
%patch7 -p1
5f6118a
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
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
c671507
cd28606
install -m 755 src/rpcbind ${RPM_BUILD_ROOT}/sbin
cd28606
install -m 755 src/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}
cd28606
install -m 644 man/rpcbind.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
cd28606
install -m 644 man/rpcinfo.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
c671507
install -m 755 ${RPM_SOURCE_DIR}/rpcbind.init ${RPM_BUILD_ROOT}%{_initdir}/rpcbind
c671507
c671507
%clean
0f1e0e3
rm -rf %{buildroot}
c671507
cd28606
%pre
cd28606
# if the rpc uid and gid is left over from the portmapper
cd28606
# remove both of them.
cd28606
/usr/sbin/userdel  rpc 2> /dev/null || :
cd28606
/usr/sbin/groupdel rpc 2> /dev/null || : 
cd28606
cd28606
# Now re-add the rpc uid/gid
cd28606
/usr/sbin/groupadd -g 32 rpc > /dev/null 2>&1
cd28606
/usr/sbin/useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind -g 32 \
cd28606
    -M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1
cd28606
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/*
c671507
%config %{_initdir}/rpcbind
c671507
cd28606
%dir %attr(700,rpc,rpc) /var/lib/rpcbind
cd28606
c671507
%changelog
5f6118a
* Mon Dec 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-12
5f6118a
- Changed is_loopback() and check_access() see if the calling
5f6118a
  address is an address on a local interface, just not a loopback
5f6118a
  address (bz 358621).
5f6118a
df25bb3
* Wed Oct 17 2007 Steve Dickson <steved@redhat.com> 0.1.4-11
df25bb3
- Reworked logic in initscript so the correct exit is 
df25bb3
  used when networking does not exist or is set up
df25bb3
  incorrectly.
df25bb3
1d31309
* Tue Oct 16 2007 Steve Dickson <steved@redhat.com> 0.1.4-10
1d31309
- Corrected a typo in the initscript from previous 
1d31309
  commit.
1d31309
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