]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- 1.644 auto/th/rpm-build-macros-1_644-1
authorJan Rękorajski <baggins@pld-linux.org>
Fri, 17 Feb 2012 13:55:48 +0000 (13:55 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- add new and cleanup existing systemd macros

Changed files:
    rpm-build-macros.spec -> 1.323
    rpm.macros -> 1.644

rpm-build-macros.spec
rpm.macros

index c564d83d5f80bc8385aaa53a395e74ab242ecc92..395d219403da3524ced6068791b289c9d14ab489 100644 (file)
@@ -1,4 +1,4 @@
-%define                rpm_macros_rev  1.642
+%define                rpm_macros_rev  1.644
 %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 8240da215cb6aa45495b1184b52c2f9394174728..4b1341801a6caec99b0c00dba5cb3133a4db3349 100644 (file)
@@ -2133,9 +2133,17 @@ fi; \
 # pre/post script for packages supporting systemd units
 #
 # Author: Bartlomiej Zimon <uzi18@o2.pl>
+#                Jan Rękorajski <baggins@mimuw.edu.pl>
 #
 # Usage:
 # %systemd_reload
+# %systemd_service_enable <-f> service_name1.service service_name2.service
+# %systemd_service_disable service_name1.service service_name2.service
+# %systemd_service_start service_name1.service service_name2.service
+# %systemd_service_stop service_name1.service service_name2.service
+# %systemd_service_restart service_name1.service service_name2.service
+# %systemd_trigger service_name1.service service_name2.service
+#
 # %systemd_post service_name1.service service_name2.service
 # %systemd_preun service_name1.service service_name2.service
 # %systend_trigger service_name1.service service_name2.service
@@ -2154,11 +2162,37 @@ fi; \
 # %systemd_trigger %{name}.service
 #
 # Requirements:
-# BuildRequires: rpmbuild(macros) >= 1.627
-# Requires:     systemd-units >= 37-0.10
+# BuildRequires: rpmbuild(macros) >= 1.643
+# Requires:     systemd-units >= 38-1
 
 %systemd_reload /bin/systemd_booted && SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog /bin/systemctl --quiet daemon-reload || :
 
+%systemd_service_enable() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemctl --quiet enable %{*} || : \
+       /bin/systemd_booted && echo 'Run "/bin/systemctl start %{*}" to start %{*}.' || : \
+%{nil}
+
+%systemd_service_disable() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemctl --quiet disable %{*} || : \
+%{nil}
+
+%systemd_service_start() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl --quiet start %{*} || : \
+%{nil}
+
+%systemd_service_stop() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl --quiet stop %{*} || : \
+%{nil}
+
+%systemd_service_restart() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+       /bin/systemd_booted && /bin/systemctl --quiet try-restart %{*} || : \
+%{nil}
+
 %systemd_trigger() \
 want_enable_service() { \
        [ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm \
@@ -2179,19 +2213,19 @@ want_enable_service() { \
        /bin/systemd_booted && /bin/systemctl --quiet daemon-reload || : \
        if [ $1 -eq 1 ]; then \
                /bin/systemctl --quiet enable %{*} || : \
-       fi \
-       if [ $1 -gt 1 ] && [ -z "$NORESTART" ]; then \
-               /bin/systemctl --quiet try-restart %{*} || : \
+               /bin/systemd_booted && echo 'Run "/bin/systemctl start %{*}" to start %{*}.' || : \
+       elif [ -z "$NORESTART" ]; then \
+               /bin/systemd_booted && /bin/systemctl --quiet try-restart %{*} || : \
+       else \
+               /bin/systemd_booted && echo 'Run "/bin/systemctl restart %{*}" to restart %{*}.' || : \
        fi \
 %{nil}
 
 %systemd_preun() \
        if [ $1 -eq 0 ]; then \
-               export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
-               /bin/systemctl --no-reload --quiet disable %{*} || : \
-               if /bin/systemd_booted; then \
-                       /bin/systemctl --quiet stop %{*} || : \
-               fi \
+               export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+               /bin/systemd_booted && /bin/systemctl --quiet stop %{*} || : \
+               /bin/systemctl --quiet disable %{*} || : \
        fi \
 %{nil}
 
This page took 0.055231 seconds and 4 git commands to generate.