diff --git a/racoon2.spec b/racoon2.spec index dd1730c..8746696 100644 --- a/racoon2.spec +++ b/racoon2.spec @@ -1,6 +1,6 @@ Name: racoon2 Version: 20100526a -Release: 13%{?dist} +Release: 14%{?dist} Summary: An implementation of key management system for IPsec Group: System Environment/Daemons License: BSD @@ -13,11 +13,17 @@ Patch3: %{name}-configfiles.patch BuildRequires: byacc BuildRequires: flex BuildRequires: openssl-devel +Requires(post): pwgen +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 BuildRequires: systemd-units Requires(post): systemd-units -Requires(post): pwgen Requires(preun): systemd-units Requires(postun): systemd-units +%else +Requires(post): chkconfig +Requires(preun): chkconfig +Requires(preun): initscripts +%endif %description The Racoon2 project is a joint effort which provides an implementation of key management system for IPsec. The implementation is called Racoon2, a successor @@ -100,12 +106,18 @@ if [ ! -e "%{_sysconfdir}/%{name}/spmd.pwd" ]; then pwgen > %{_sysconfdir}/%{name}/spmd.pwd chmod 600 %{_sysconfdir}/%{name}/spmd.pwd fi +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl daemon-reload >/dev/null 2>&1 || : fi +%else +/sbin/chkconfig --add %{name}-iked +/sbin/chkconfig --add %{name}-spmd +%endif %preun +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable %{name}-spmd.service > /dev/null 2>&1 || : @@ -113,16 +125,30 @@ if [ $1 -eq 0 ] ; then /bin/systemctl stop %{name}-spmd.service > /dev/null 2>&1 || : /bin/systemctl stop %{name}-iked.service > /dev/null 2>&1 || : fi +%else +if [ $1 -eq 0 ] ; then + /sbin/service %{name}-iked stop >/dev/null 2>&1 + /sbin/service %{name}-spmd stop >/dev/null 2>&1 + /sbin/chkconfig --del %{name}-iked + /sbin/chkconfig --del %{name}-spmd +fi +%endif %postun +%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then # Package upgrade, not uninstall /bin/systemctl try-restart %{name}-spmd.service >/dev/null 2>&1 || : /bin/systemctl try-restart %{name}-iked.service >/dev/null 2>&1 || : fi +%else +%endif %changelog +* Mon Feb 13 2012 Pavel Šimerda - 20100526a-14 +- rebuilt + * Sat Jan 21 2012 Pavel Šimerda - 20100526a-13 - Added rm at the beginning of install section - Changed conditionals to versioned ones