SPECS: clamav.spec - simplify triggers - use addusertogroup macro

blues blues at pld-linux.org
Mon Feb 16 10:18:39 CET 2009


Author: blues                        Date: Mon Feb 16 09:18:39 2009 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- simplify triggers - use addusertogroup macro

---- Files affected:
SPECS:
   clamav.spec (1.253 -> 1.254) 

---- Diffs:

================================================================
Index: SPECS/clamav.spec
diff -u SPECS/clamav.spec:1.253 SPECS/clamav.spec:1.254
--- SPECS/clamav.spec:1.253	Mon Dec  8 16:06:43 2008
+++ SPECS/clamav.spec	Mon Feb 16 10:18:33 2009
@@ -200,39 +200,18 @@
 rm -rf $RPM_BUILD_ROOT
 
 %triggerin -- amavis-ng
-AMAVIS=$(/usr/bin/getgid amavis)
-RESULT=$?
-if [ $RESULT -eq 0 ]; then
-	echo "Adding clamav to amavis group GID=$AMAVIS"
-	/usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
-fi
+%addusertogroup clamav amavis
 
 %triggerin -- amavisd-new
-AMAVIS=$(/usr/bin/getgid amavis)
-RESULT=$?
-if [ $RESULT -eq 0 ]; then
-	echo "Adding clamav to amavis group GID=$AMAVIS"
-	/usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
-fi
+%addusertogroup clamav amavis
 
 %triggerin -- amavisd
-AMAVIS=$(/usr/bin/getgid amavis)
-RESULT=$?
-if [ $RESULT -eq 0 ]; then
-	echo "Adding clamav to amavis group GID=$AMAVIS"
-	/usr/sbin/usermod -G amavis clamav 1>&2
-fi
+%addusertogroup clamav amavis
 
 %pre
 %groupadd -g 43 clamav
 %useradd -u 43 -d /tmp -s /bin/false -c "Clam Anti Virus Checker" -g clamav clamav
-
-# FIXME: check this. is it proper after useradd macro?
-# TODO: use addusertogroup macro?
-if [ -n "`/usr/bin/getgid amavis`" ]; then
-	echo "Adding clamav to amavis group"
-	/usr/sbin/usermod -G amavis clamav 1>&2
-fi
+%addusertogroup clamav amavis
 
 %post
 /sbin/chkconfig --add clamd
@@ -361,6 +340,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.254  2009/02/16 09:18:33  blues
+- simplify triggers - use addusertogroup macro
+
 Revision 1.253  2008/12/08 15:06:43  blues
 - security note
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/clamav.spec?r1=1.253&r2=1.254&f=u



More information about the pld-cvs-commit mailing list