]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blobdiff - rpm.macros
- typo
[packages/rpm-pld-macros.git] / rpm.macros
index c419c2232718fb6791f19644872d2d572f718151..d1d468a73ec15e2b1b832e4b92eec1477219307b 100644 (file)
@@ -560,7 +560,7 @@ if [ -d "$RPM_BUILD_ROOT" ]; then \
                        modulecount=$(echo "$modulelist" | wc -l); \
                        printf "Stripping %d kernel modules..." $modulecount; \
                        echo "$modulelist" | xargs -l512 chmod u+w; \
-                       echo "$modulelist" | xargs -l512 %{__strip} --strip-unneeded --remove-section=.comment --remove-section=.note.GNU-stack; \
+                       echo "$modulelist" | xargs -l512 %{__strip} -g --remove-section=.comment --remove-section=.note.GNU-stack; \
                        echo "DONE"; \
                fi; \
        fi; \
@@ -2045,50 +2045,49 @@ 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.622
-# Requires:     rc-scripts >= ...
+# BuildRequires: rpmbuild(macros) >= 1.627
+# Requires:     systemd-units >= 37-0.10
 
-%systemd_enable() \
-       if [ $1 -eq 1 ]; then  \
-               /bin/systemctl enable %1 >/dev/null 2>&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 \
+       /bin/systemd_booted && /bin/systemctl --quiet daemon-reload || : \
        if [ $1 -eq 1 ]; then \
-               /bin/systemctl daemon-reload >/dev/null 2>&1 || : \
-       fi
+               /bin/systemctl --quiet enable %{*} || : \
+       fi \
+       if [ $1 -gt 1 ] && [ -z "$NORESTART" ]; then \
+               /bin/systemctl --quiet try-restart %{*} || : \
+       fi \
+%{nil}
 
 %systemd_preun() \
        if [ $1 -eq 0 ]; then \
-               /bin/systemctl --no-reload disable %1 > /dev/null 2>&1 || : \
-               /bin/systemctl stop %1 > /dev/null 2>&1 || : \
-       fi
-
-%systemd_postun() \
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || : \
-    if [ $1 -ge 1 ]; then \
-               /bin/systemctl try-restart %1 >/dev/null 2>&1 || : \
-       fi
+               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 \
+       fi \
+%{nil}
 
 %systemdunitdir /lib/systemd/system
 
This page took 0.072035 seconds and 4 git commands to generate.