Преглед изворни кода

package massage: - we have just a single patch, so just use %patch instead of %patch0 - replace direct patch for "configure" with an "shtool subst" approach because patching configure is a maintainance nightmare - OSSP fsl is a link-time library only, so no need to use its CFLAGS - simplify by passing DESTDIR directly on "make install" command line - remove superfluous "-d ${monit_interval}" on rc.monit:%restart - fix OSSP fsl config by matching for just "monit" instead of "monit/.+" - locate monit.log side-by-side to monit.pid under %{l_prefix}/var/monit/ - plus the usual amount of RSE cosmetics ;-)

Ralf S. Engelschall пре 22 година
родитељ
комит
27172bdeb2
5 измењених фајлова са 18 додато и 38 уклоњено
  1. 2 2
      monit/fsl.monit
  2. 0 20
      monit/monit.patch
  3. 13 14
      monit/monit.spec
  4. 1 1
      monit/monitrc
  5. 2 1
      monit/rc.monit

+ 2 - 2
monit/fsl.monit

@@ -2,13 +2,13 @@
 ##  fsl.monit -- OSSP fsl configuration for Monit
 ##
 
-ident (monit/.+)/.+ q{
+ident (monit)/.+ q{
     prefix(
         prefix="%b %d %H:%M:%S %N <%L> $1[%P]: "
     ) 
     -> {
         debug: file(
-            path="@l_prefix@/var/monit/log/monit.log",
+            path="@l_prefix@/var/monit/monit.log",
             append=1, perm=0600
         )
     }

+ 0 - 20
monit/monit.patch

@@ -1,23 +1,3 @@
---- configure.orig	2003-02-18 15:26:03.000000000 +0100
-+++ configure	2003-05-07 10:17:37.000000000 +0200
-@@ -5263,16 +5263,7 @@
- done
- 
- 
--# Find the right directory to put the root-mode PID file in
--echo "$as_me:$LINENO: checking pid file location" >&5
--echo $ECHO_N "checking pid file location... $ECHO_C" >&6
--if test -d "/var/run"
--then
--	piddir="/var/run"
--elif test -d "/etc"
--then
--	piddir="/etc"
--fi
-+piddir="@l_prefix@/var/monit"
- 
- 
- cat >>confdefs.h <<_ACEOF
 --- files.c.orig	2003-02-17 12:42:27.000000000 +0100
 +++ files.c	2003-05-07 10:23:58.000000000 +0200
 @@ -143,7 +143,8 @@

+ 13 - 14
monit/monit.spec

@@ -25,15 +25,15 @@
 
 #   package information
 Name:         monit
-Summary:      Service monitoring daemon
+Summary:      Service Monitoring Daemon
 URL:          http://www.tildeslash.com/monit/
-Vendor:       Jan-Henrik Haukeland and other contributors
+Vendor:       Jan-Henrik Haukeland et al.
 Packager:     The OpenPKG Project
 Distribution: OpenPKG [EVAL]
 Group:        System
 License:      GPL
 Version:      3.2
-Release:      20030507
+Release:      20030508
 
 #   package options
 %option       with_ssl   no
@@ -62,19 +62,21 @@ AutoReqProv:  no
 
 %prep
     %setup -q
-    %patch0 -p0
+    %patch -p0
     %{l_shtool} subst \
         -e 's;@l_prefix@;%{l_prefix};g' \
-        configure \
-        files.c \
-        monit.1
+        files.c monit.1
+    %{l_shtool} subst \
+        -e 's;piddir=;dummy=;' \
+        configure
 
 %build
     CC="%{l_cc}" \
-    CFLAGS="%{l_cflags -O} `%{l_prefix}/bin/fsl-config --all --cflags`" \
-    CPPFLAGS="%{l_cppflags} `%{l_prefix}/bin/fsl-config --all --cflags`" \
+    CFLAGS="%{l_cflags -O}" \
+    CPPFLAGS="%{l_cppflags}" \
     LDFLAGS="%{l_ldflags} `%{l_prefix}/bin/fsl-config --all --ldflags`" \
     LIBS="`%{l_prefix}/bin/fsl-config --all --libs`" \
+    piddir="%{l_prefix}/var/monit" \
     ./configure \
         --prefix=%{l_prefix} \
 %if "%{with_ssl}" == "yes"
@@ -86,10 +88,7 @@ AutoReqProv:  no
 
 %install
     rm -rf $RPM_BUILD_ROOT
-    %{l_shtool} subst -s \
-        -e "s;^\(DESTDIR[ 	]*=\).*$;\1 $RPM_BUILD_ROOT;" \
-        Makefile
-    %{l_make} %{l_mflags} install
+    %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
 
     %{l_shtool} mkdir -f -p -m 755 \
         $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
@@ -110,7 +109,7 @@ AutoReqProv:  no
         %{SOURCE monitrc} $RPM_BUILD_ROOT%{l_prefix}/etc/monit/
 
     %{l_shtool} mkdir -f -p -m 700 \
-        $RPM_BUILD_ROOT%{l_prefix}/var/monit/log
+        $RPM_BUILD_ROOT%{l_prefix}/var/monit
 
     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \
         '%config %attr(0600,%{l_susr},%{l_mgrp}) %{l_prefix}/etc/monit/*' \

+ 1 - 1
monit/monitrc

@@ -16,7 +16,7 @@ ssl disable
 set mailserver 127.0.0.1
 set mail-format { from: monit@localhost }
 
-#   log via syslog (fsl) by default
+#   log via syslog (OSSP fsl) by default
 set logfile syslog
 
 #   example for MySQL 4, see also http://www.tildeslash.com/monit/examples.html

+ 2 - 1
monit/rc.monit

@@ -23,10 +23,11 @@
         kill -TERM `cat @l_prefix@/var/monit/monit.pid`
         rm -f @l_prefix@/var/monit/monit.pid
     fi
-    @l_prefix@/bin/monit -d ${monit_interval}
+    @l_prefix@/bin/monit
 
 %reload -u @l_susr@
     opServiceEnabled monit || exit 0
     if [ -f @l_prefix@/var/monit/monit.pid ]; then
         kill -HUP `cat @l_prefix@/var/monit/monit.pid`
     fi
+