SPECS: natmonitor.spec - added user and group natmonitor, changed ...

charles charles at pld-linux.org
Wed Oct 12 20:42:54 CEST 2005


Author: charles                      Date: Wed Oct 12 18:42:54 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- added user and group natmonitor, changed perms to /var/lib/natmonitor
- added %ghost /var/lib/natmonitor/natmonitor.dat

---- Files affected:
SPECS:
   natmonitor.spec (1.22 -> 1.23) 

---- Diffs:

================================================================
Index: SPECS/natmonitor.spec
diff -u SPECS/natmonitor.spec:1.22 SPECS/natmonitor.spec:1.23
--- SPECS/natmonitor.spec:1.22	Wed Oct 12 18:05:14 2005
+++ SPECS/natmonitor.spec	Wed Oct 12 20:42:49 2005
@@ -16,6 +16,8 @@
 BuildRequires:	gtk+2-devel >= 1:2.0.0
 BuildRequires:	libpcap-devel
 BuildRequires:	pkgconfig
+BuildRequires:	sed >= 4.0
+Requires:	rpmbuild(macros) >= 1.202
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -49,6 +51,7 @@
 %patch1 -p1
 
 %build
+%{__sed} -i 's,USER.*,USER natmonitor,' natmonitord.conf
 %{__make} \
 	CC="%{__cc}" \
 	CFLAGS="%{rpmcflags}" \
@@ -71,9 +74,18 @@
 install %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
 install %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/natmonitord
 
+cat > $RPM_BUILD_ROOT/var/lib/natmonitor/natmonitor.dat <<EOF
+MINS SAMPLES 0
+HOURS SAMPLES 0
+EOF
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%pre -n natmonitord
+%groupadd -g 159 natmonitor
+%useradd -u 159 -d %{_var}/lib/natmonitor -c "NAT Monitor" -g natmonitor natmonitor
+
 %post -n natmonitord
 /sbin/chkconfig --add natmonitord
 if [ -f /var/lock/subsys/natmonitord ]; then
@@ -90,6 +102,12 @@
         /sbin/chkconfig --del natmonitord
 fi
 
+%postun -n natmonitord
+if [ "$1" = "0" ]; then
+	%userremove natmonitor
+	%groupremove natmonitor
+fi
+
 %files
 %defattr(644,root,root,755)
 %doc CHANGELOG README BUGS TODO
@@ -104,7 +122,8 @@
 %attr(755,root,root) %{_sbindir}/natmonitord
 %attr(754,root,root) %{_initrddir}/natmonitord
 %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/natmonitord.conf
-%attr(750,nobody,nobody) /var/lib/natmonitor
+%attr(750,natmonitor,natmonitor) %dir /var/lib/natmonitor
+%attr(644,natmonitor,natmonitor) %ghost /var/lib/natmonitor/natmonitor.dat
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -112,6 +131,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.23  2005/10/12 18:42:49  charles
+- added user and group natmonitor, changed perms to /var/lib/natmonitor
+- added %ghost /var/lib/natmonitor/natmonitor.dat
+
 Revision 1.22  2005/10/12 16:05:14  charles
 - added -etc.patch (read {HOME_ETC,/etc}/natmonitor.conf)
 - fixed natmonitord.init
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/natmonitor.spec?r1=1.22&r2=1.23&f=u




More information about the pld-cvs-commit mailing list