Fixed rpmlint errors
Fixed systemd unit files packaging
This commit is contained in:
parent
b2e5f2c05b
commit
345f99166d
@ -1,5 +1,6 @@
|
||||
[Unit]
|
||||
Description=The ypbind daemon which binds NIS/YP clients to NIS domain
|
||||
Requires=rpcbind.service
|
||||
After=syslog.target network.target rpcbind.service
|
||||
|
||||
[Service]
|
||||
@ -8,7 +9,8 @@ EnvironmentFile=-/etc/sysconfig/ypbind
|
||||
ExecStartPre=-/usr/lib/ypbind/ypbind-pre-setdomain
|
||||
ExecStartPre=-/usr/sbin/setsebool allow_ypbind=1
|
||||
ExecStart=/usr/sbin/ypbind -n $OTHER_YPBIND_OPTS
|
||||
ExecStopPost=/usr/sbin/setsebool allow_ypbind=0 ; /usr/lib/ypbind/ypbind-post-waitbind
|
||||
ExecStopPost=-/usr/sbin/setsebool allow_ypbind=0
|
||||
ExecStopPost=/usr/lib/ypbind/ypbind-post-waitbind
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
38
ypbind.spec
38
ypbind.spec
@ -1,7 +1,7 @@
|
||||
Summary: The NIS daemon which binds NIS clients to an NIS domain
|
||||
Name: ypbind
|
||||
Version: 1.33
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Daemons
|
||||
Source0: ftp://ftp.us.kernel.org/pub/linux/utils/net/NIS/ypbind-mt-%{version}.tar.bz2
|
||||
@ -24,8 +24,13 @@ Requires(post): systemd-units
|
||||
Requires(preun): systemd-units
|
||||
Requires(postun): systemd-units
|
||||
Requires: rpcbind, yp-tools
|
||||
Requires(post): systemd-sysv
|
||||
Epoch: 3
|
||||
BuildRequires: dbus-glib-devel, docbook-style-xsl
|
||||
BuildRequires: systemd-units
|
||||
|
||||
# Location where helper scripts are located
|
||||
%define scripts_path /usr/lib/%{name}
|
||||
|
||||
%description
|
||||
The Network Information Service (NIS) is a system that provides
|
||||
@ -60,32 +65,37 @@ make
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/var/yp/binding $RPM_BUILD_ROOT/etc/dhcp/dhclient.d/ $RPM_BUILD_ROOT/lib/systemd/system/ $RPM_BUILD_ROOT/usr/lib/%{name}/
|
||||
mkdir -p $RPM_BUILD_ROOT/var/yp/binding $RPM_BUILD_ROOT/etc/dhcp/dhclient.d/ $RPM_BUILD_ROOT%{_unitdir} $RPM_BUILD_ROOT%{scripts_path}/
|
||||
install -m 644 etc/yp.conf $RPM_BUILD_ROOT/etc/yp.conf
|
||||
install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/dhcp/dhclient.d/nis.sh
|
||||
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT/lib/systemd/system/ypbind.service
|
||||
install -m 755 %{SOURCE4} $RPM_BUILD_ROOT/usr/lib/%{name}/ypbind-pre-setdomain
|
||||
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/%{name}/ypbind-post-waitbind
|
||||
install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_unitdir}/ypbind.service
|
||||
install -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{scripts_path}/ypbind-pre-setdomain
|
||||
install -m 755 %{SOURCE5} $RPM_BUILD_ROOT%{scripts_path}/ypbind-post-waitbind
|
||||
|
||||
%{find_lang} %{name}
|
||||
|
||||
%post
|
||||
# Package install, not upgrade
|
||||
if [ $1 -eq 1 ]; then
|
||||
/bin/systemctl enable %{name}.service || :
|
||||
/bin/systemctl daemon-reload >dev/null || :
|
||||
fi
|
||||
|
||||
# Package with native systemd unit file is installed for the first time
|
||||
%triggerun -- ypbind < 3:1.32-9
|
||||
if /sbin/chkconfig --level 3 ypbind ; then
|
||||
/bin/systemctl --no-reload enable ypbind.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
# Save the current service runlevel info
|
||||
# User must manually run systemd-sysv-convert --apply httpd
|
||||
# to migrate them to systemd targets
|
||||
/usr/bin/systemd-sysv-convert --save ypbind >/dev/null 2>&1 ||:
|
||||
|
||||
# Run these because the SysV package being removed won't do them
|
||||
/sbin/chkconfig --del ypbind >/dev/null 2>&1 || :
|
||||
/bin/systemctl try-restart ypbind.service >/dev/null 2>&1 || :
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
# Package removal, not upgrade
|
||||
/bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
|
||||
/bin/systemctl --no-reload disable %{name}.service >/dev/null 2>&1 || :
|
||||
/bin/systemctl stop %{name}.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
|
||||
%postun
|
||||
@ -99,14 +109,18 @@ fi
|
||||
%defattr(-,root,root)
|
||||
%{_sbindir}/*
|
||||
%{_mandir}/*/*
|
||||
/usr/lib/%{name}/*
|
||||
/lib/systemd/system/*
|
||||
%{scripts_path}/*
|
||||
%{_unitdir}/*
|
||||
/etc/dhcp/dhclient.d/*
|
||||
%config(noreplace) /etc/yp.conf
|
||||
%dir /var/yp/binding
|
||||
%doc README NEWS COPYING
|
||||
|
||||
%changelog
|
||||
* Tue Aug 02 2011 Honza Horak <hhorak@redhat.com> - 3:1.33-5
|
||||
- Fixed rpmlint errors
|
||||
- Fixed systemd unit files packaging
|
||||
|
||||
* Mon Jun 13 2011 Honza Horak <hhorak@redhat.com> - 3:1.33-4
|
||||
- Changed -n option for staying in foreground to not overlap
|
||||
with config-file option
|
||||
|
Loading…
Reference in New Issue
Block a user