packages: mongodb/mongodb.spec - user/group adding macros/deps

glen glen at pld-linux.org
Thu Oct 28 10:49:42 CEST 2010


Author: glen                         Date: Thu Oct 28 08:49:42 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- user/group adding macros/deps

---- Files affected:
packages/mongodb:
   mongodb.spec (1.7 -> 1.8) 

---- Diffs:

================================================================
Index: packages/mongodb/mongodb.spec
diff -u packages/mongodb/mongodb.spec:1.7 packages/mongodb/mongodb.spec:1.8
--- packages/mongodb/mongodb.spec:1.7	Thu Oct 28 10:46:30 2010
+++ packages/mongodb/mongodb.spec	Thu Oct 28 10:49:36 2010
@@ -47,7 +47,15 @@
 Summary:	MongoDB server, sharding server, and support scripts
 Group:		Applications/Databases
 Requires:	%{name} = %{version}-%{release}
+Provides:	group(mongod)
+Provides:	user(mongod)
 Requires(post,preun):	/sbin/chkconfig
+Requires(postun):	/usr/sbin/groupdel
+Requires(postun):	/usr/sbin/userdel
+Requires(pre):	/bin/id
+Requires(pre):	/usr/bin/getgid
+Requires(pre):	/usr/sbin/groupadd
+Requires(pre):	/usr/sbin/useradd
 Requires:	rc-scripts
 
 %description server
@@ -97,8 +105,8 @@
 rm -rf $RPM_BUILD_ROOT
 
 %pre server
-groupadd -r mongod 2>/dev/null || :
-useradd -r -g mongod -d %{_var}/lib/mongo -s /sbin/nologin -c "user for MongoDB Database Server" mongod 2>/dev/null || :
+%groupadd -g xxx -r mongod
+%useradd -u xxx -r -g mongod -d %{_var}/lib/mongo -s /bin/false -c "MongoDB Database Server" mongod
 
 %post server
 /sbin/chkconfig --add mongod
@@ -110,6 +118,12 @@
 	/sbin/chkconfig --del mongod
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+	%userremove mongod
+	%groupremove mongod
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc README GNU-AGPL-3.0.txt
@@ -158,6 +172,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.8  2010/10/28 08:49:36  glen
+- user/group adding macros/deps
+
 Revision 1.7  2010/10/28 08:46:30  glen
 - initscript restart macros
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/mongodb/mongodb.spec?r1=1.7&r2=1.8&f=u



More information about the pld-cvs-commit mailing list