rpms/milter-regex/devel milter-regex.conf, NONE, 1.1 .cvsignore, 1.2, 1.3 milter-regex-initscript, 1.1, 1.2 milter-regex.spec, 1.3, 1.4 sources, 1.2, 1.3

Paul Howarth (pghmcfc) fedora-extras-commits at redhat.com
Mon Aug 6 14:48:40 UTC 2007


Author: pghmcfc

Update of /cvs/pkgs/rpms/milter-regex/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14431

Modified Files:
	.cvsignore milter-regex-initscript milter-regex.spec sources 
Added Files:
	milter-regex.conf 
Log Message:
* Mon Aug  6 2007 Paul Howarth <paul at city-fan.org> - 1.7-1
- update to 1.7 (sendmail macro filtering support added)
- tarball now includes a versioned directory name
- split milter-regex.conf out from being a here document in the spec and have
  it as a separate source file instead
- unexpand tabs 
- use the standard scriptlet for user/group creation in %pre
- use %{_initrddir} rather than %{_sysconfdir}/rc.d/init.d for initscript
- use %{__install} rather than %{__cp} in %install
- drop scriptlet dependencies on /sbin/service by calling initscript directly
- LSB-ize initscript (#246983)



--- NEW FILE milter-regex.conf ---
# Insert here Your milter-regex rules.
# See manpage milter-regex for details.
# You don't need to reload config; milter-regex reloads it when it changes.



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/milter-regex/devel/.cvsignore,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- .cvsignore	25 May 2006 17:09:36 -0000	1.2
+++ .cvsignore	6 Aug 2007 14:48:08 -0000	1.3
@@ -1 +1 @@
-milter-regex-1.6.tar.gz
+milter-regex-1.7.tar.gz


Index: milter-regex-initscript
===================================================================
RCS file: /cvs/pkgs/rpms/milter-regex/devel/milter-regex-initscript,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- milter-regex-initscript	25 May 2006 17:09:36 -0000	1.1
+++ milter-regex-initscript	6 Aug 2007 14:48:08 -0000	1.2
@@ -7,13 +7,22 @@
 # processname: milter-regex
 # config: /etc/mail/milter-regex.conf /etc/sysconfig/milter-regex
 
+### BEGIN INIT INFO
+# Provides: milter-regex
+# Required-Start: $local_fs $network $syslog $named
+# Required-Stop: $local_fs $network $syslog $named
+# Short-Description: Start or stop Regex Milter
+# Description: Milter-regex allows regular expression based filtering of mail
+#	messages as they arrive in sendmail
+### END INIT INFO
+
 # Source function library.
 . /etc/rc.d/init.d/functions
 
 # Source options file
 [ -f /etc/sysconfig/milter-regex ] && . /etc/sysconfig/milter-regex
 
-[ -f /usr/sbin/milter-regex ] || exit 0
+[ -x /usr/sbin/milter-regex ] || exit 5
 
 prog="milter-regex"
 
@@ -21,9 +30,13 @@
     echo -n $"Starting $prog: " 
     daemon $prog $OPTIONS
     RETVAL=$? 
-    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/milter-regex
     echo
-    return $RETVAL
+    if [ $RETVAL -eq 0 ]; then
+        touch /var/lock/subsys/milter-regex
+    else
+        exit 7
+    fi
+    return 0
 }
 
 stop() {
@@ -34,7 +47,11 @@
     fi
     RETVAL=$?
     rm -f /var/lock/subsys/milter-regex
-    return $RETVAL
+    if test "x`pidof milter-regex`" = x; then
+        return 0
+    else
+        return 1
+    fi
 }
 
 case "$1" in
@@ -44,25 +61,27 @@
 	stop)
 	    stop
 	    ;;
-	
 	status)
 	    status milter-regex
 	    ;;
-	restart)
-	    stop
+	reload)
+	    # milter-regex reloads configuration automatically if the config
+	    # file has changed, so the reload action is a no-op
+	    exit 0
+	    ;;
+	force-reload|restart)
+	    if test "x`pidof milter-regex`" != x; then
+	        stop
+	    fi
 	    start
 	    ;;
-	condrestart|reload)
+	condrestart|try-restart)
 	    if test "x`pidof milter-regex`" != x; then
 		stop
 		start
 	    fi
 	    ;;
-	
 	*)
-	    echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
-	    exit 1
-
+	    echo $"Usage: $0 {start|stop|force-reload|restart|try-restart|status}"
+	    exit 2
 esac
-
-exit $RETVAL


Index: milter-regex.spec
===================================================================
RCS file: /cvs/pkgs/rpms/milter-regex/devel/milter-regex.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- milter-regex.spec	18 Apr 2007 09:15:18 -0000	1.3
+++ milter-regex.spec	6 Aug 2007 14:48:08 -0000	1.4
@@ -1,72 +1,72 @@
-Name:           milter-regex
-Version:        1.6
-Release:        7%{?dist}
-Summary:        Sendmail milter plugin for regular expression filtering
-Group:          System Environment/Daemons
-License:        BSD
-URL:            http://www.benzedrine.cx/milter-regex.html
-Source0:        http://www.benzedrine.cx/milter-regex-%{version}.tar.gz
-Source1:        milter-regex-initscript
-Source2:        milter-regex-options
-Patch0:         milter-regex-1.6-gcc.patch
-Buildroot:      %{_tmppath}/%{name}-%{release}-root-%(%{__id_u} -n)
-Buildrequires:  sendmail-devel >= 8.13, byacc, groff
-Requires:       sendmail
-
-Requires(pre):    /usr/sbin/useradd
-Requires(post):   /usr/sbin/useradd
-Requires(preun):  /sbin/chkconfig, /sbin/service
-Requires(postun): /sbin/service
+Name:		milter-regex
+Version:	1.7
+Release:	1%{?dist}
+Summary:	Sendmail milter plugin for regular expression filtering
+Group:		System Environment/Daemons
+License:	BSD
+URL:		http://www.benzedrine.cx/milter-regex.html
+Source0:	http://www.benzedrine.cx/milter-regex-%{version}.tar.gz
+Source1:	milter-regex-initscript
+Source2:	milter-regex-options
+Source3:	milter-regex.conf
+Patch0:		milter-regex-1.6-gcc.patch
+Buildroot:	%{_tmppath}/%{name}-%{release}-root-%(%{__id_u} -n)
+Buildrequires:	sendmail-devel >= 8.13, byacc, groff
+Requires:	sendmail
+
+Requires(pre):	  shadow-utils
+Requires(post):	  /sbin/chkconfig
+Requires(preun):  /sbin/chkconfig
 
 %description
 Milter-regex is a milter based filter that makes it possible to filter
 emails using regular expressions.
 
 %prep
-%setup -q -n %{name}
+%setup -q
 %patch0 -p1 -b .gcc
-%{__sed} -i -e 's+/etc/milter-regex\.conf+%{_sysconfdir}/mail/milter-regex.conf+' milter-regex.[8c]
-%{__sed} -i -e 's+_milter-regex+mregex+' milter-regex.[8c]
+%{__sed} -i -e 's|/etc/milter-regex\.conf|%{_sysconfdir}/mail/milter-regex.conf|;
+		s|_milter-regex|mregex|' milter-regex.[8c]
 /usr/bin/head -n +31 milter-regex.c > LICENSE
 
 %build
 %{__make} %{?_smp_mflags} -f Makefile.linux CFLAGS="%{optflags}"
 
 %install
-%{__rm} -rf   %{buildroot}
-%{__mkdir} -p %{buildroot}%{_sbindir} \
-              %{buildroot}%{_sysconfdir}/{rc.d/init.d,mail,sysconfig} \
-              %{buildroot}%{_mandir}/man8 \
-              %{buildroot}%{_localstatedir}/spool/milter-regex
-%{__cp} -p milter-regex   %{buildroot}%{_sbindir}
-%{__cp} -p milter-regex.8 %{buildroot}%{_mandir}/man8
-%{__install} -p -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/rc.d/init.d/milter-regex
+%{__rm} -rf %{buildroot}
+%{__mkdir} -p \
+	%{buildroot}%{_initrddir} \
+	%{buildroot}%{_localstatedir}/spool/milter-regex \
+	%{buildroot}%{_mandir}/man8 \
+	%{buildroot}%{_sbindir} \
+	%{buildroot}%{_sysconfdir}/{mail,sysconfig}
+%{__install} -p -m 755 milter-regex %{buildroot}%{_sbindir}/
+%{__install} -p -m 644 milter-regex.8 %{buildroot}%{_mandir}/man8/
+%{__install} -p -m 755 %{SOURCE1} %{buildroot}%{_initrddir}/milter-regex
 %{__install} -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/milter-regex
-
-%{__cat} > %{buildroot}%{_sysconfdir}/mail/milter-regex.conf << EOF
-# Insert here Your milter-regex rules.
-# See manpage milter-regex for details.
-# You don't need to reload config; milter-regex reloads it when it changes.
-
-EOF
+%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/mail/milter-regex.conf
 
 # Create a ghost sock file so we can remove it on package deletion
 : > %{buildroot}%{_localstatedir}/spool/milter-regex/sock
 
 %pre
-/usr/sbin/useradd -r -M -d / -s /sbin/nologin -c "Regex Milter" mregex &> /dev/null || :
+/usr/bin/getent group mregex >/dev/null || /usr/sbin/groupadd -r mregex
+/usr/bin/getent passwd mregex >/dev/null || \
+	/usr/sbin/useradd -r -g mregex -d %{_localstatedir}/spool/milter-regex \
+		-s /sbin/nologin -c "Regex Milter" mregex
+exit 0
 
 %post
 /sbin/chkconfig --add milter-regex || :
 
 %preun
 if [ $1 -eq 0 ] ; then
-        /sbin/service milter-regex stop &> /dev/null || :
-        /sbin/chkconfig --del milter-regex || :
+	%{_initrddir}/milter-regex stop &> /dev/null || :
+	/sbin/chkconfig --del milter-regex || :
 fi
 
 %postun
-[ $1 -eq 0 ] && /sbin/service milter-regexp condrestart &> /dev/null || :
+[ $1 -eq 0 ] && %{_initrddir}/milter-regexp try-restart &> /dev/null || :
 
 %clean
 %{__rm} -rf %{buildroot}
@@ -75,7 +75,7 @@
 %defattr(-,root,root,-)
 %doc LICENSE
 %{_sbindir}/milter-regex
-%{_sysconfdir}/rc.d/init.d/milter-regex
+%{_initrddir}/milter-regex
 %config(noreplace) %{_sysconfdir}/sysconfig/milter-regex
 %config(noreplace) %{_sysconfdir}/mail/milter-regex.conf
 %dir %attr(755,mregex,mregex) %{_localstatedir}/spool/milter-regex/
@@ -83,6 +83,18 @@
 %{_mandir}/man8/milter-regex.8*
 
 %changelog
+* Mon Aug  6 2007 Paul Howarth <paul at city-fan.org> - 1.7-1
+- update to 1.7 (sendmail macro filtering support added)
+- tarball now includes a versioned directory name
+- split milter-regex.conf out from being a here document in the spec and have
+  it as a separate source file instead
+- unexpand tabs 
+- use the standard scriptlet for user/group creation in %%pre
+- use %%{_initrddir} rather than %%{_sysconfdir}/rc.d/init.d for initscript
+- use %%{__install} rather than %%{__cp} in %%install
+- drop scriptlet dependencies on /sbin/service by calling initscript directly
+- LSB-ize initscript (#246983)
+
 * Wed Apr 18 2007 Paul Howarth <paul at city-fan.org> - 1.6-7
 - add patch for compile errors on Fedora 7
 - use sed rather than perl for quick scripted edits
@@ -92,8 +104,8 @@
 
 * Thu May 25 2006 Paul Howarth <paul at city-fan.org> - 1.6-5
 - Address issues raised in review (#189611)
--   Add sendmail dependency
--   Honor %%{optflags}
+  - Add sendmail dependency
+  - Honor %%{optflags}
 
 * Fri Apr 21 2006 Paul Howarth <paul at city-fan.org> - 1.6-4
 - Minor cosmetic changes for resubmission for Fedora Extras


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/milter-regex/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	25 May 2006 17:09:36 -0000	1.2
+++ sources	6 Aug 2007 14:48:08 -0000	1.3
@@ -1 +1 @@
-6b5dbc79b0c78cf186f9a19f8d4e3889  milter-regex-1.6.tar.gz
+0bef59aee17d7c87e36d9944b9665947  milter-regex-1.7.tar.gz




More information about the fedora-extras-commits mailing list