SPECS: clamav.spec - addusertogroup with optional group support

glen glen at pld-linux.org
Thu Mar 26 12:53:03 CET 2009


Author: glen                         Date: Thu Mar 26 11:53:03 2009 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- addusertogroup with optional group support

---- Files affected:
SPECS:
   clamav.spec (1.256 -> 1.257) 

---- Diffs:

================================================================
Index: SPECS/clamav.spec
diff -u SPECS/clamav.spec:1.256 SPECS/clamav.spec:1.257
--- SPECS/clamav.spec:1.256	Wed Mar 25 21:42:30 2009
+++ SPECS/clamav.spec	Thu Mar 26 12:52:58 2009
@@ -9,7 +9,7 @@
 Summary(pl.UTF-8):	Narzędzie antywirusowe dla Uniksów
 Name:		clamav
 Version:	0.95
-Release:	0.1
+Release:	0.2
 Epoch:		0
 License:	GPL v2+
 Group:		Applications
@@ -32,7 +32,7 @@
 %{?with_milter:BuildRequires:	libmilter-devel}
 BuildRequires:	libtool
 %{?with_milter:BuildRequires:	libwrap-devel}
-BuildRequires:	rpmbuild(macros) >= 1.268
+BuildRequires:	rpmbuild(macros) >= 1.514
 BuildRequires:	zlib-devel
 Requires(post,preun):	/sbin/chkconfig
 Requires(postun):	/usr/sbin/groupdel
@@ -195,39 +195,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 -q 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 -q 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 -q 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 -q clamav amavis
 
 %post
 /sbin/chkconfig --add clamd
@@ -358,6 +337,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.257  2009/03/26 11:52:58  glen
+- addusertogroup with optional group support
+
 Revision 1.256  2009/03/25 20:42:30  adamg
 - revert 1.254:
   Upgrading...
================================================================

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



More information about the pld-cvs-commit mailing list