]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- 1.552: %nagios_nrpe with a restart of nrpe daemon on install auto/ac/rpm-build-macros-1_552-1 auto/th/rpm-build-macros-1_552-1 auto/ti/rpm-build-macros-1_552-1
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 18 Mar 2010 10:59:37 +0000 (10:59 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-build-macros.spec -> 1.248
    rpm.macros -> 1.552

rpm-build-macros.spec
rpm.macros

index 8374d6654d252f9c5520e7bfed2a379c7fa2d3ea..51e195f7ec135fffeb2ce22cc999698ac36fb06b 100644 (file)
@@ -1,4 +1,4 @@
-%define                rpm_macros_rev  1.550
+%define                rpm_macros_rev  1.552
 %define                find_lang_rev   1.32
 Summary:       PLD Linux RPM build macros
 Summary(pl.UTF-8):     Makra do budowania pakietów RPM dla Linuksa PLD
index 9c21b92d516257f3f0958f8a1e3f94fe40370122..8e7451c5720ae5ee4877fcb4546c61cf658d4c1f 100644 (file)
@@ -1822,19 +1822,22 @@ else: \
 #
 # Requirements:
 # BuildRequires:       sed >= 4.0
-# BuildRequires:       rpmbuild(macros) >= 1.551
+# BuildRequires:       rpmbuild(macros) >= 1.552
 %nagios_nrpe(a:d:c:f:) {\
+       m=$(md5sum < /etc/nagios/nrpe.cfg); \
        %{-a:# on -a and config exists \
-       if [ "%{-a*}" -a -f /etc/nagios/nrpe.cfg ]; then \
-               if ! grep -q '^command\[%{-a*}\]' /etc/nagios/nrpe.cfg; then \
-                               sed -ne 's/^[ \t]*command_line[ \t]\+\(.\+\)/command[%{-a*}]=\1/p' %{-f*} >> /etc/nagios/nrpe.cfg; \
+       if [ -f /etc/nagios/nrpe.cfg ]; then \
+               if ! %{__grep} -q '^command\[%{-a*}\]' /etc/nagios/nrpe.cfg; then \
+                               %{__sed} -ne 's/^[ \t]*command_line[ \t]\+\(.\+\)/command[%{-a*}]=\1/p' %{-f*} >> /etc/nagios/nrpe.cfg; \
                fi; \
        fi;} \
        %{-d:# on package remove, -d and config exists \
-       if [ "$1" = "0" -a "%{-d*}" -a -f /etc/nagios/nrpe.cfg ]; then \
-               sed -i -e '/^[ \t]*command\[%{-d*}\]/d' /etc/nagios/nrpe.cfg; \
+       if [ "$1" = "0" -a -f /etc/nagios/nrpe.cfg ]; then \
+               %{__sed} -i -e '/^[ \t]*command\[%{-d*}\]/d' /etc/nagios/nrpe.cfg; \
        fi;} \
+       if [ "$m" != "$(md5sum < /etc/nagios/nrpe.cfg)" ]; then \
+               %service -q nrpe restart; \
+       fi; \
 }%{nil}
 
-
 # vim:ts=4 sw=4 noet ft=spec
This page took 0.110958 seconds and 4 git commands to generate.