packages: rpm-build-macros/rpm-build-macros.spec, rpm-build-macros/rpm.macr...

wiget wiget at pld-linux.org
Sun Dec 4 18:23:02 CET 2011


Author: wiget                        Date: Sun Dec  4 17:23:02 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- introduce %systemd_reload macro
- move try-restart to %systemd_post
- drop %systemd_postun macro

---- Files affected:
packages/rpm-build-macros:
   rpm-build-macros.spec (1.305 -> 1.306) , rpm.macros (1.625 -> 1.626) 

---- Diffs:

================================================================
Index: packages/rpm-build-macros/rpm-build-macros.spec
diff -u packages/rpm-build-macros/rpm-build-macros.spec:1.305 packages/rpm-build-macros/rpm-build-macros.spec:1.306
--- packages/rpm-build-macros/rpm-build-macros.spec:1.305	Sun Dec  4 14:26:25 2011
+++ packages/rpm-build-macros/rpm-build-macros.spec	Sun Dec  4 18:22:56 2011
@@ -1,5 +1,5 @@
 # $Revision$, $Date$
-%define		rpm_macros_rev	1.625
+%define		rpm_macros_rev	1.626
 %define		find_lang_rev	1.35
 Summary:	PLD Linux RPM build macros
 Summary(pl.UTF-8):	Makra do budowania pakietów RPM dla Linuksa PLD
@@ -92,6 +92,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.306  2011/12/04 17:22:56  wiget
+- introduce %systemd_reload macro
+- move try-restart to %systemd_post
+- drop %systemd_postun macro
+
 Revision 1.305  2011/12/04 13:26:25  wiget
 - use systemd_booted to check if system is booted using systemd
 - redirect message from systemctl to syslog

================================================================
Index: packages/rpm-build-macros/rpm.macros
diff -u packages/rpm-build-macros/rpm.macros:1.625 packages/rpm-build-macros/rpm.macros:1.626
--- packages/rpm-build-macros/rpm.macros:1.625	Sun Dec  4 14:26:25 2011
+++ packages/rpm-build-macros/rpm.macros	Sun Dec  4 18:22:56 2011
@@ -2045,56 +2045,45 @@
 # Author: Bartlomiej Zimon <uzi18 at o2.pl>
 #
 # Usage:
-# %systemd_post
-# %systemd_enable service_name.service
-# %systemd_preun  service_name.service
-# %systemd_postun service_name.service
+# %systemd_reload
+# %systemd_post service_name1.service service_name2.service
+# %systemd_preun  service_name1.service service_name2.service
 #
 # Sample:
 # %post systemd
-# %systemd_post
+# %systemd_reload
 # or if service must be enabled by default:
 # %post systemd
-# %systemd_post
-# %systemd_enable %{name}
+# %systemd_post %{name}.service
 #
 # %preun systemd
-# %systemd_preun %{name}
+# %systemd_preun %{name}.service
 #
 # %postun systemd
-# %systemd_postun %{name}
+# %systemd_reload
 #
 # Requirements:
-# BuildRequires: rpmbuild(macros) >= 1.625
+# BuildRequires: rpmbuild(macros) >= 1.626
 # Requires:	 systemd-units >= 37-0.10
 
-%systemd_enable() \
-	export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
-	if [ $1 -eq 1 ]; then  \
-		/bin/systemctl --quiet enable %1 || : \
-	fi
+%systemd_reload /bin/systemd_booted && SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog /bin/systemctl --quiet daemon-reload || :
 
 %systemd_post() \
-	export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
-	if [ $1 -eq 1 ] && /bin/systemd_booted; then \
-		/bin/systemctl --quiet daemon-reload || : \
-	fi
+	export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+	/bin/systemd_booted && /bin/systemctl --quiet daemon-reload || : \
+	if [ $1 -eq 1 ]; then \
+		/bin/systemctl --quiet enable %{*} || : \
+	fi \
+	if [ $1 -gt 1 ]; then \
+		/bin/systemctl --quiet try-restart %{*} || : \
+	fi \
 
 %systemd_preun() \
-	export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
 	if [ $1 -eq 0 ]; then \
-		/bin/systemctl --no-reload --quiet disable %1 || : \
+		export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
+		/bin/systemctl --no-reaload --quiet disable %{*} || : \
 		if /bin/systemd_booted; then \
-			/bin/systemctl --quiet stop %1 || : \
-		fi \
-	fi
-
-%systemd_postun() \
-	export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
-	if /bin/systemd_booted; then \
-		/bin/systemctl --quiet daemon-reload || : \
-		if [ $1 -ge 1 ]; then \
-			/bin/systemctl --quiet try-restart %1 || : \
+			/bin/systemctl --quiet stop %{*} || : \
 		fi \
 	fi
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpm-build-macros/rpm-build-macros.spec?r1=1.305&r2=1.306&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/rpm-build-macros/rpm.macros?r1=1.625&r2=1.626&f=u



More information about the pld-cvs-commit mailing list