Remove systemd-units and systemd-sysv requirements

Clean-up SysV init conversion code
Clean-up systemd preset macros compatibility code
This commit is contained in:
Honza Horák 2013-07-29 18:07:09 +02:00
parent c387ac8088
commit d389cb01f9
1 changed files with 22 additions and 53 deletions

View File

@ -4,7 +4,7 @@ Summary: The NIS (Network Information Service) server
Url: http://www.linux-nis.org/nis/ypserv/index.html
Name: ypserv
Version: 2.31
Release: 3%{?dist}
Release: 4%{?dist}
License: GPLv2
Group: System Environment/Daemons
Source0: http://www.linux-nis.org/download/ypserv/ypserv-%{version}.tar.bz2
@ -16,10 +16,9 @@ Source5: yppasswdd-pre-setdomain
Requires: gawk, make, portmap, bash >= 2.0
Requires: tokyocabinet
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
Requires(post): systemd-sysv
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Patch0: ypserv-2.5-redhat.patch
Patch1: ypserv-2.21-path.patch
@ -34,7 +33,7 @@ Patch9: ypserv-2.29-relro.patch
Patch10: ypserv-2.31-netgrprecur.patch
BuildRequires: tokyocabinet-devel
BuildRequires: systemd-units
BuildRequires: systemd
BuildRequires: autoconf, automake
BuildRequires: systemd-devel
@ -127,54 +126,19 @@ EOF
install -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{_libexecdir}/rpc.yppasswdd.env
%post
%if 0%{?systemd_post:1}
%systemd_post ypserv.service
%systemd_post ypxfrd.service
%systemd_post yppasswdd.service
%else
# Package with native systemd unit file is installed for the first time
if [ $1 -eq 1 ]; then
# Package install, not upgrade
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%endif
%triggerun -- ypserv < 2.25-2
if /sbin/chkconfig --level 3 ypserv ; then
/bin/systemctl --no-reload enable ypserv.service >/dev/null 2>&1 || :
fi
if /sbin/chkconfig --level 3 ypxfrd ; then
/bin/systemctl --no-reload enable ypxfrd.service >/dev/null 2>&1 || :
fi
if /sbin/chkconfig --level 3 yppasswdd ; then
/bin/systemctl --no-reload enable yppasswdd.service >/dev/null 2>&1 || :
fi
%systemd_post ypserv.service
%systemd_post ypxfrd.service
%systemd_post yppasswdd.service
%preun
%if 0%{?systemd_preun:1}
%systemd_preun ypserv.service
%systemd_preun ypxfrd.service
%systemd_preun yppasswdd.service
%else
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl stop ypserv.service ypxfrd.service yppasswdd.service >/dev/null 2>&1 || :
/bin/systemctl --no-reload disable ypserv.service ypxfrd.service yppasswdd.service >/dev/null 2>&1 || :
fi
%endif
%systemd_preun ypserv.service
%systemd_preun ypxfrd.service
%systemd_preun yppasswdd.service
%postun
%if 0%{?systemd_postun_with_restart:1}
%systemd_postun_with_restart ypserv.service
%systemd_postun_with_restart ypxfrd.service
%systemd_postun_with_restart yppasswdd.service
%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ "$1" -ge "1" ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart ypserv.service ypxfrd.service yppasswdd.service >/dev/null 2>&1 || :
fi
%endif
%systemd_postun_with_restart ypserv.service
%systemd_postun_with_restart ypxfrd.service
%systemd_postun_with_restart yppasswdd.service
%if 0%fedora>=18
@ -258,6 +222,11 @@ fi
%{_includedir}/*/*
%changelog
* Mon Jul 29 2013 Honza Horak <hhorak@redhat.com> - 2.31-4
- Remove systemd-units and systemd-sysv requirements
- Clean-up SysV init conversion code
- Clean-up systemd preset macros compatibility code
* Mon May 27 2013 Honza Horak <hhorak@redhat.com> - 2.31-3
- Fix crash when netgroups include recursive dependency
@ -372,15 +341,15 @@ fi
- Update to new upstream version
Simplified systemd snippets in spec file
* Wed Jun 14 2011 Honza Horak <hhorak@redhat.com> - 2.25-3
* Tue Jun 14 2011 Honza Horak <hhorak@redhat.com> - 2.25-3
- Adjust yppush man page and add a comment how to assign options
to yppush (#712239)
* Wed May 10 2011 Honza Horak <hhorak@redhat.com> - 2.25-2
* Tue May 10 2011 Honza Horak <hhorak@redhat.com> - 2.25-2
- Add systemd native services files for ypserv, ypxfrd and yppasswdd
(#696903)
* Wed May 10 2011 Honza Horak <hhorak@redhat.com> - 2.25-1
* Tue May 10 2011 Honza Horak <hhorak@redhat.com> - 2.25-1
- Update to new upstream version, which contains .staticanal patch
* Fri May 06 2011 Honza Horak <hhorak@redhat.com> - 2.24-4