]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- introduce %systemd_reload macro auto/th/rpm-build-macros-1_626-1
authorArtur Frysiak <artur@frysiak.net>
Sun, 4 Dec 2011 17:22:56 +0000 (17:22 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- move try-restart to %systemd_post
- drop %systemd_postun macro

Changed files:
    rpm-build-macros.spec -> 1.306
    rpm.macros -> 1.626

rpm-build-macros.spec
rpm.macros

index 558219c53640a01fbda250027f1ad7ea5d54c94b..ae61b62ada9ab7a660768545395ae2b1440f2ce6 100644 (file)
@@ -1,4 +1,4 @@
-%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
index d41f57b696487a62410fc098924d1f9e5b9a5c8f..5875e026e475689e6515047b6bc8927b67d532ed 100644 (file)
@@ -2045,56 +2045,45 @@ else: \
 # Author: Bartlomiej Zimon <uzi18@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
 
This page took 0.076311 seconds and 4 git commands to generate.