Blob Blame Raw
%{!?_initdir:%define _initdir /etc/rc.d/init.d}

Name:           rpcbind
Version:        0.1.4
Release: 6%{?dist}
Summary:        Universal Addresses to RPC Program Number Napper
Group:          System Environment/Daemons
License:        GPL

BuildRoot:      %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
Source1: rpcbind.init

Requires: glibc-common >= 2.5.90-20 
Requires: setup >= 2.6.4-1
Conflicts: man-pages < 2.43-12
BuildRequires: automake, autoconf, libtool
BuildRequires: libtirpc-devel quota
Requires(post): /sbin/chkconfig
Requires(post): /sbin/chkconfig

Provides: portmap = %{version}-%{release}
Obsoletes: portmap <= 4.0-65.3

Patch1: rpcbind-0.1.4-compile.patch
Patch2: rpcbind-0.1.4-debug.patch
Patch3: rpcbind-0.1.4-warmstarts.patch
Patch4: rpcbind-0.1.4-rpcuser.patch
Patch5: rpcbind-0.1.4-iff_up.patch

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.

%setup -q

%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
# 240873: rpcbind segfaults on startup - ipv6 related
%patch5 -p1

%ifarch s390 s390x
export PIE


autoreconf -fisv
%configure CFLAGS="$CFLAGS" LDFLAGS="-pie" \
    --enable-warmstarts \
    --with-statedir="$RPCBDIR" \
    --with-rpcuser="$RPCBUSR" \

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}%{_mandir}/man8
mkdir -p %{buildroot}/var/lib/rpcbind

install -m 755 src/rpcbind ${RPM_BUILD_ROOT}/sbin
install -m 755 src/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}
install -m 644 man/rpcbind.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
install -m 644 man/rpcinfo.8 ${RPM_BUILD_ROOT}%{_mandir}/man8
install -m 755 ${RPM_SOURCE_DIR}/rpcbind.init ${RPM_BUILD_ROOT}%{_initdir}/rpcbind

rm -rf %{buildroot}

# if the rpc uid and gid is left over from the portmapper
# remove both of them.
/usr/sbin/userdel  rpc 2> /dev/null || :
/usr/sbin/groupdel rpc 2> /dev/null || : 

# Now re-add the rpc uid/gid
/usr/sbin/groupadd -g 32 rpc > /dev/null 2>&1
/usr/sbin/useradd -l -c "Rpcbind Daemon" -d /var/lib/rpcbind -g 32 \
    -M -s /sbin/nologin -u 32 rpc > /dev/null 2>&1

/sbin/chkconfig --add %{name}

if [ $1 -eq 0 ]; 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
if [ "$1" -ge "1" ]; then
    service rpcbind condrestart > /dev/null 2>&1

%config %{_initdir}/rpcbind

%dir %attr(700,rpc,rpc) /var/lib/rpcbind

* Tue May 22 2007 Steve Dickson <> 0.1.4-6
- Fixed an ipv6 related segfault on startup (bz 240873)

* Wed Apr 18 2007 Steve Dickson <> 0.1.4-5
- Added dependency on setup which contains the correct
  rpcbind /etc/service entry which in turns stops 
  rpcbind from haning when NIS is enabled. (bz 236865)

* Wed Apr 11 2007 Jeremy Katz <> - 0.1.4-4
- change man-pages requires into a conflicts as we don't have to have 
  man-pages installed, but if we do, we need the newer version

* Fri Apr  6 2007 Steve Dickson <> 0.1.4-3
- Fixed the Provides and Obsoletes statments to correctly
  obsolete the portmap package.
* Tue Apr  3 2007 Steve Dickson <> 0.1.4-2
- Added dependency on glibc-common which allows the
  rpcinfo command to be installed in the correct place.
- Added dependency on man-pages so the rpcinfo man 
  pages don't conflict.
- Added the creation of /var/lib/rpcbind which will be
  used to store state files.
- Make rpcbind run with the 'rpc' uid/gid when it exists.

* Wed Feb 21 2007 Steve Dickson <> 0.1.4-1
- Initial commit
- Spec reviewed (bz 228894)
- Added the Provides/Obsoletes which should
  cause rpcbind to replace portmapper