[iodine] - Step to systemd macroses (#850160)

Pavel Alexeev hubbitus at fedoraproject.org
Tue Jan 7 19:17:53 UTC 2014


commit 26eb04d20129eec77e777be79faf50996f36f0e1
Author: Pavel Alexeev (aka Pahan-Hubbitus) <pahan at hubbitus.info>
Date:   Tue Jan 7 23:17:20 2014 +0400

    - Step to systemd macroses (#850160)

 iodine.spec |   53 +++++++++++++++++------------------------------------
 1 files changed, 17 insertions(+), 36 deletions(-)
---
diff --git a/iodine.spec b/iodine.spec
index 4871809..78f5468 100644
--- a/iodine.spec
+++ b/iodine.spec
@@ -2,7 +2,7 @@
 
 Name:		iodine
 Version:		0.6.0
-Release:		0.rc1.11%{?dist}
+Release:		0.rc1.12%{?dist}
 Summary:		Solution to tunnel IPv4 data through a DNS server
 Summary(ru):	Решение для туннелирования IPv4 трафика через DNS сервер
 Group:		System Environment/Daemons
@@ -34,7 +34,7 @@ Requires(post):	chkconfig
 Requires(preun):	chkconfig, initscripts
 Requires(postun):	initscripts
 
-BuildRequires:	systemd-units
+BuildRequires:	systemd
 
 Requires:		%{name}-client
 Requires:		%{name}-server
@@ -66,9 +66,9 @@ Iodine работает на Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD и Window
 %package client
 Summary:			Client part of solution to tunnel IPv4 data through a DNS server
 Summary(ru):		Клиент для туннелирования IPv4 трафика через DNS сервер
-Requires(post):	systemd-units
-Requires(preun):	systemd-units
-Requires(postun):	systemd-units
+Requires(post):	systemd
+Requires(preun):	systemd
+Requires(postun):	systemd
 # This is actually needed for the %%triggerun script but Requires(triggerun)
 # is not valid. We can use %%post because this particular %%triggerun script
 # should fire just after this package is installed.
@@ -97,9 +97,9 @@ May be needed f.e. on CentOS.
 %package server
 Summary:			Server part of solution to tunnel IPv4 data through a DNS server
 Summary(ru):		Сервер для туннелирования IPv4 трафика через DNS сервер
-Requires(post):	systemd-units
-Requires(preun):	systemd-units
-Requires(postun):	systemd-units
+Requires(post):	systemd
+Requires(preun):	systemd
+Requires(postun):	systemd
 # This is actually needed for the %%triggerun script but Requires(triggerun)
 # is not valid. We can use %%post because this particular %%triggerun script
 # should fire just after this package is installed.
@@ -156,24 +156,13 @@ install -Dp -m 0644 %{SOURCE8} %{buildroot}/%{_unitdir}/%{name}-server.service
 rm -rf %{buildroot}
 
 %post client
-if [ $1 -eq 1 ] ; then
-	# Initial installation
-	/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post %{name}-client.service
 
 %preun client
-if [ $1 -eq 0 ] ; then
-	# Package removal, not upgrade
-	/bin/systemctl --no-reload disable %{name}-client.service > /dev/null 2>&1 || :
-	/bin/systemctl stop %{name}-client.service > /dev/null 2>&1 || :
-fi
+%systemd_preun %{name}-client.service
 
 %postun client
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-	# Package upgrade, not uninstall
-	/bin/systemctl try-restart %{name}-client.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart %{name}-client.service
 
 %post client-sysvinit
 /sbin/chkconfig --add %{name}-client
@@ -188,24 +177,13 @@ if [ $1 = 0 ] ; then
 fi
 
 %post server
-if [ $1 -eq 1 ] ; then
-	# Initial installation
-	/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-fi
+%systemd_post %{name}-server.service
 
 %preun server
-if [ $1 -eq 0 ] ; then
-	# Package removal, not upgrade
-	/bin/systemctl --no-reload disable %{name}-server.service > /dev/null 2>&1 || :
-	/bin/systemctl stop %{name}-server.service > /dev/null 2>&1 || :
-fi
+%systemd_preun %{name}-server.service
 
 %postun server
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
-	# Package upgrade, not uninstall
-	/bin/systemctl try-restart %{name}-server.service >/dev/null 2>&1 || :
-fi
+%systemd_postun_with_restart %{name}-server.service
 
 %preun server-sysvinit
 if [ $1 = 0 ] ; then
@@ -268,6 +246,9 @@ fi
 %{_unitdir}/%{name}-server.service
 
 %changelog
+* Tue Jan 7 2014 Pavel Alexeev <Pahan at Hubbitus.info> - 0.6.0-0.rc1.12
+- Step to systemd macroses (#850160)
+
 * Tue Jan 7 2014 Pavel Alexeev <Pahan at Hubbitus.info> - 0.6.0-0.rc1.11
 - Add Provides: bundled(md5-deutsch) to client and server sub-packages (#1046028)
 


More information about the scm-commits mailing list