SPECS: motion.spec - create motion user and gorup, rel. 2

darekr darekr at pld-linux.org
Tue Sep 12 20:24:28 CEST 2006


Author: darekr                       Date: Tue Sep 12 18:24:28 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- create motion user and gorup, rel. 2

---- Files affected:
SPECS:
   motion.spec (1.38 -> 1.39) 

---- Diffs:

================================================================
Index: SPECS/motion.spec
diff -u SPECS/motion.spec:1.38 SPECS/motion.spec:1.39
--- SPECS/motion.spec:1.38	Sun Aug  6 22:46:23 2006
+++ SPECS/motion.spec	Tue Sep 12 20:24:23 2006
@@ -1,6 +1,5 @@
 # $Revision$, $Date$
 # TODO:
-# - init subpackage should have own user. Current solution isn't safe.
 # - change default configuration for existing directories
 #
 # Conditional builds:
@@ -12,7 +11,7 @@
 Summary(pl):	Motion - programowy wykrywacz ruchu
 Name:		motion
 Version:	3.2.6
-Release:	1
+Release:	2
 License:	GPL
 Group:		Applications/Graphics
 Source0:	http://dl.sourceforge.net/motion/%{name}-%{version}.tar.gz
@@ -28,6 +27,8 @@
 %{?with_mysql:BuildRequires:    mysql-devel}
 %{?with_pgsql:BuildRequires:	postgresql-devel}
 BuildRequires:	rpmbuild(macros) >= 1.268
+Requires(postun):	/usr/sbin/groupdel
+Requires(postun):	/usr/sbin/userdel
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -47,8 +48,16 @@
 Summary(pl):	Skrypt init dla systemu Motion
 Group:		Applications/System
 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:	%{name} = %{version}-%{release}
 Requires:	rc-scripts
+Provides:	group(motion)
+Provides:	user(motion)
 
 %description init
 Init script for Motion.
@@ -90,6 +99,10 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre init
+%groupadd -g 177 motion
+%useradd -u 177 -g motion motion
+
 %post init
 /sbin/chkconfig --add motion
 %service motion restart
@@ -100,6 +113,12 @@
 	/sbin/chkconfig --del motion
 fi
 
+%postun init
+if [ "$1" = "0" ]; then
+        %userremove motion
+        %groupremove motion
+fi
+
 %triggerpostun -- motion < 3.2.6-1
 if [ -e /etc/motion.conf.rpmsave ]; then
 	cp /etc/motion/motion.conf /etc/motion/motion.conf.rpmnew
@@ -126,6 +145,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.39  2006/09/12 18:24:23  darekr
+- create motion user and gorup, rel. 2
+
 Revision 1.38  2006/08/06 20:46:23  darekr
 - specify motion's release for trigger
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/motion.spec?r1=1.38&r2=1.39&f=u



More information about the pld-cvs-commit mailing list