forked from rpms/rpcbind
Spec file clean up
Signed-off-by: Steve Dickson <steved@redhat.com>
This commit is contained in:
parent
4d358c968f
commit
eb69b46b83
54
rpcbind.spec
54
rpcbind.spec
@ -1,8 +1,6 @@
|
||||
%{!?_initddir:%define _initddir /etc/rc.d/init.d}
|
||||
|
||||
Name: rpcbind
|
||||
Version: 0.2.0
|
||||
Release: 12%{?dist}
|
||||
Release: 13%{?dist}
|
||||
Summary: Universal Addresses to RPC Program Number Mapper
|
||||
Group: System Environment/Daemons
|
||||
License: BSD
|
||||
@ -10,22 +8,19 @@ URL: http://nfsv4.bullopensource.org
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
|
||||
Source0: http://downloads.sourceforge.net/rpcbind/%{name}-%{version}.tar.bz2
|
||||
Source1: rpcbind.init
|
||||
Source2: rpcbind.service
|
||||
Source3: rpcbind.socket
|
||||
%define rpcbind_services %{SOURCE2} %{SOURCE3}
|
||||
Source1: rpcbind.service
|
||||
Source2: rpcbind.socket
|
||||
|
||||
Patch001: rpcbind-0_2_1-rc3.patch
|
||||
|
||||
Requires: glibc-common setup
|
||||
Conflicts: man-pages < 2.43-12
|
||||
BuildRequires: automake, autoconf, libtool
|
||||
BuildRequires: automake, autoconf, libtool, systemd-units
|
||||
BuildRequires: libtirpc-devel, quota-devel, tcp_wrappers-devel
|
||||
Requires(pre): /usr/sbin/groupadd /usr/sbin/groupdel
|
||||
Requires(pre): /usr/sbin/useradd /usr/sbin/userdel
|
||||
Requires(pre): coreutils
|
||||
Requires(post): /sbin/chkconfig
|
||||
Requires(post): /sbin/chkconfig
|
||||
Requires(pre): coreutils shadow-utils
|
||||
Requires(post): chkconfig systemd-units systemd-sysv
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units coreutils
|
||||
|
||||
Provides: portmap = %{version}-%{release}
|
||||
Obsoletes: portmap <= 4.0-65.3
|
||||
@ -63,19 +58,16 @@ make all
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
mkdir -p %{buildroot}{/sbin,/usr/sbin,/lib/systemd/system}
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
|
||||
mkdir -p %{buildroot}{/sbin,/usr/sbin}
|
||||
mkdir -p %{buildroot}%{_unitdir}
|
||||
mkdir -p %{buildroot}%{_mandir}/man8
|
||||
mkdir -p %{buildroot}/var/lib/rpcbind
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcbind ${RPM_BUILD_ROOT}/sbin
|
||||
mv -f ${RPM_BUILD_ROOT}%{_bindir}/rpcinfo ${RPM_BUILD_ROOT}%{_sbindir}
|
||||
install -m 755 ${RPM_SOURCE_DIR}/rpcbind.init ${RPM_BUILD_ROOT}%{_initddir}/rpcbind
|
||||
for service in %{rpcbind_services} ; do
|
||||
install -m 644 $service $RPM_BUILD_ROOT/lib/systemd/system
|
||||
done
|
||||
|
||||
install -m644 %{SOURCE1} %{buildroot}%{_unitdir}
|
||||
install -m644 %{SOURCE2} %{buildroot}%{_unitdir}
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
@ -100,13 +92,13 @@ fi
|
||||
%post
|
||||
if [ $1 -eq 1 ]; then
|
||||
# Package install, not upgrade
|
||||
/bin/systemctl enable rpcbind.service >/dev/null 2>&1 || :
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ]; then
|
||||
# Package removal, not upgrade
|
||||
/bin/systemctl disable rpcbind.service >/dev/null 2>&1 || :
|
||||
/bin/systemctl --no-reload rpcbind.service >/dev/null 2>&1 || :
|
||||
/bin/systemctl stop rpcbind.service >/dev/null 2>&1 || :
|
||||
/usr/sbin/userdel rpc 2>/dev/null || :
|
||||
/usr/sbin/groupdel rpc 2>/dev/null || :
|
||||
@ -114,24 +106,32 @@ if [ $1 -eq 0 ]; then
|
||||
fi
|
||||
%postun
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ "$1" -ge "1" ]; then
|
||||
# Package upgrade, not uninstall
|
||||
if [ $1 -ge 1 ]; then
|
||||
# Package upgrade, not uninstall
|
||||
/bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%triggerun -- rpcbind < 0.2.0-12
|
||||
%{_bindir}/systemd-sysv-convert --save rpcbind >/dev/null 2>&1 ||:
|
||||
/bin/systemctl enable rpcbind.service >/dev/null 2>&1
|
||||
/sbin/chkconfig --del rpcbind >/dev/null 2>&1 || :
|
||||
/bin/systemctl try-restart rpcbind.service >/dev/null 2>&1 || :
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS ChangeLog README
|
||||
/sbin/rpcbind
|
||||
%{_sbindir}/rpcinfo
|
||||
%{_mandir}/man8/*
|
||||
%config %{_initddir}/rpcbind
|
||||
/lib/systemd/system/*.service
|
||||
/lib/systemd/system/*.socket
|
||||
%{_unitdir}/rpcbind.service
|
||||
%{_unitdir}/rpcbind.socket
|
||||
|
||||
%dir %attr(700,rpc,rpc) /var/lib/rpcbind
|
||||
|
||||
%changelog
|
||||
* Fri Jul 8 2011 Steve Dickson <steved@redhat.com> - 0.2.0-13
|
||||
- Spec file clean up
|
||||
|
||||
* Thu Jul 7 2011 Steve Dickson <steved@redhat.com> - 0.2.0-12
|
||||
- Migrated SysV initscripts to systemd (bz 713574)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user