]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- updated for 4.4.2: de.po uses UTF-8 now
[packages/rpm.git] / rpm.macros
index 824b82c7df8fc718433464ed258ad6ad19ffc35d..a1aa4b7c80092e1a204d9ab1d1885d60d8aadc8a 100644 (file)
@@ -20,7 +20,7 @@
 
 %debugcflags   -O0 -g -Wall
 %rpmcflags     %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
-%rpmcxxflags   %{rpmcflags} -fvisibility-inlines-hidden
+%rpmcxxflags   %{rpmcflags}
 %rpmldflags    %{nil}
 # %rpmldflags  -Wl,--as-needed
 
@@ -688,7 +688,8 @@ if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d %{__apache_confdir %{-v*}} ]; then\
 fi\
 # reload apache if the config symlink is there\
 if [ -L %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf ]; then\
-       if [ -f /var/lock/subsys/%{__apache_svcname %{-v*}} ]; then\
+       # additionally don't reload if target package (the webserver) is upgraded, as webserver is restarted anyway in %post \
+       if [ "$2" != "2" ] && [ -f /var/lock/subsys/%{__apache_svcname %{-v*}} ]; then\
                /etc/rc.d/init.d/%{__apache_svcname %{-v*}} reload 1>&2\
        fi\
 fi\
@@ -740,3 +741,36 @@ if [ "$1" = "0" ] || [ "$2" = "0" ]; then \
        done ) \
 ) | ( %banner -t 5 -e %{name}-un ); fi; \
 }
+
+# service macro.
+#
+# calls usual service restart on package %post, but skips the restart if
+# administrator has disabled automatic service restarts in either global
+# /etc/sysconfig/rpm or per service /etc/sysconfig/SERVICE file.
+#
+# written by glen@pld-linux.org.
+# All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
+#
+# Usage:
+#   %service [-q] SERVICE ACTION
+#
+#  -q be silent when service isn't started (for postun scriplets)
+#
+%service(q) {{ \
+# we use function, not to globber namespace with useless variables \
+skip_auto_restart() { \
+       . /etc/sysconfig/rpm; # global setting \
+       [ -f /etc/sysconfig/%1 ] && . /etc/sysconfig/%1; # per service setting \
+       echo ${RPM_SKIP_AUTO_RESTART:-no}; \
+}; \
+if [ -f /var/lock/subsys/%1 ]; then \
+       if [ $(skip_auto_restart) = no ]; then \
+               /etc/rc.d/init.d/%1 %2 1>&2; \
+       else \
+               echo 'Run "/etc/rc.d/init.d/%1 %2" to %2 %1 service.'; \
+       fi \
+else \
+       %{!-q:echo 'Run "/etc/rc.d/init.d/%1 start" to start %1 service.';} \
+       %{-q::;} \
+fi }; }
+
This page took 0.035884 seconds and 4 git commands to generate.