SPECS: cancd.spec - added user and logdir - use pld initscript/sys...

glen glen at pld-linux.org
Fri Jan 6 21:18:08 CET 2006


Author: glen                         Date: Fri Jan  6 20:18:08 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- added user and logdir
- use pld initscript/sysconfig

---- Files affected:
SPECS:
   cancd.spec (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SPECS/cancd.spec
diff -u SPECS/cancd.spec:1.1 SPECS/cancd.spec:1.2
--- SPECS/cancd.spec:1.1	Fri Jan  6 20:59:17 2006
+++ SPECS/cancd.spec	Fri Jan  6 21:18:03 2006
@@ -2,17 +2,27 @@
 Summary:	The CA NetConsole Daemon
 Name:		cancd
 Version:	0.1.0
-Release:	0.1
+Release:	0.4
 License:	GPL
 Group:		Applications/File
 Source0:	http://oss.oracle.com/projects/cancd/dist/files/source/%{name}-%{version}.tar.gz
 # Source0-md5:	3eb4a75cfa4d1a860ea547fdc76c6d4d
+Source1:	%{name}.init
+Source2:	%{name}.sysconfig
 Patch0:		%{name}-make.patch
 URL:		http://oss.oracle.com/projects/cancd/
 BuildRequires:	rpmbuild(macros) >= 1.228
 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:	/sbin/chkconfig
 Requires:	rc-scripts
+Provides:	group(cancd)
+Provides:	user(cancd)
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -30,15 +40,20 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig}
+install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},/var/log/cancd}
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-> $RPM_BUILD_ROOT/etc/sysconfig/cancd
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/cancd
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/cancd
 
 %clean
 rm -rf "$RPM_BUILD_ROOT"
 
+%pre
+%groupadd -g 162 cancd
+%useradd -u 162 -c "CA NetConsole Daemon" -g cancd cancd
+
 %post
 /sbin/chkconfig --add cancd
 %service cancd restart
@@ -49,11 +64,18 @@
 	/sbin/chkconfig --del cancd
 fi
 
+%postun
+if [ "$1" = "0" ]; then
+	%userremove cancd
+	%groupremove cancd
+fi
+
 %files
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_sbindir}/cancd
 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/cancd
 %attr(754,root,root) %config /etc/rc.d/init.d/cancd
+%attr(770,root,cancd) %dir /var/log/cancd
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -61,6 +83,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.2  2006/01/06 20:18:03  glen
+- added user and logdir
+- use pld initscript/sysconfig
+
 Revision 1.1  2006/01/06 19:59:17  glen
 - new (based on bundled spec)
-
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/cancd.spec?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list