SPECS: bigsister.spec - use %service, cleanups

glen glen at pld-linux.org
Sat Apr 15 16:21:07 CEST 2006


Author: glen                         Date: Sat Apr 15 14:21:07 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use %service, cleanups

---- Files affected:
SPECS:
   bigsister.spec (1.62 -> 1.63) 

---- Diffs:

================================================================
Index: SPECS/bigsister.spec
diff -u SPECS/bigsister.spec:1.62 SPECS/bigsister.spec:1.63
--- SPECS/bigsister.spec:1.62	Fri Apr 14 14:08:27 2006
+++ SPECS/bigsister.spec	Sat Apr 15 16:21:02 2006
@@ -1,19 +1,18 @@
 # $Revision$, $Date$
-#TODO
+# TODO
 # - corect path for files and directory in /etc/bigsister/etc/* - Patch5 (FHS)
 # - security for webpage and admin page
 # - subpackages for skins??????
 # - add patch and e-mail to author
-# - corect directory in /etc/bigsister/etc (some files to /usr/share, /var/lib)
-# - check all patch, remove old
+# - correct directory in /etc/bigsister/etc (some files to /usr/share, /var/lib)
+# - check all patches, remove old
 
-#/TODO
 %include	/usr/lib/rpm/macros.perl
 Summary:	The Big Sister Network and System Monitor
 Summary(pl):	Wielka Siostra - monitor sieci i systemów - klon komercyjnego BigBrother
 Name:		bigsister
 Version:	1.02
-Release:	0.1
+Release:	1
 License:	GPL
 Group:		Networking
 Source0:	http://dl.sourceforge.net/bigsister/big-sister-%{version}.tar.gz
@@ -37,7 +36,8 @@
 BuildRequires:	perl-libwww
 #BuildRequires:	post-server-is-broken
 BuildRequires:	rpm-perlprov >= 4.0.2-104
-BuildRequires:	rpmbuild(macros) >= 1.202
+BuildRequires:	rpmbuild(macros) >= 1.268
+BuildRequires:	sed >= 4.0
 Requires(post,preun):	/sbin/chkconfig
 Requires(postun):	/usr/sbin/groupdel
 Requires(postun):	/usr/sbin/userdel
@@ -187,37 +187,31 @@
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,httpd/httpd.conf,cron.weekly},%{_var}/lib/bigsister{/graphs,/www/graphs,/logs}}
 
-%{__make} install-server install-client install-reporting \
+%{__make} -j1 \
+	install-server install-client install-reporting \
 	install-agent install-modules install-doc \
 	DESTDIR=$RPM_BUILD_ROOT
-#install-win32
-
-mv -f	$RPM_BUILD_ROOT%{_sbindir}/* \
-	$RPM_BUILD_ROOT%{_bindir}
-
-rm -rf	$RPM_BUILD_ROOT%{_sbindir}
-rm -rf	$RPM_BUILD_ROOT/etc/init.d
-
-mv -f	$RPM_BUILD_ROOT%{_datadir}/bigsister/etc \
-	$RPM_BUILD_ROOT%{_sysconfdir}/bigsister
 
+mv -f $RPM_BUILD_ROOT%{_sbindir}/* $RPM_BUILD_ROOT%{_bindir}
+rm -rf $RPM_BUILD_ROOT%{_sbindir}
+rm -rf $RPM_BUILD_ROOT/etc/init.d
+mv -f $RPM_BUILD_ROOT%{_datadir}/bigsister/etc $RPM_BUILD_ROOT%{_sysconfdir}/bigsister
 rm -rf	$RPM_BUILD_ROOT%{_datadir}/bigsister/etc
 
 cd $RPM_BUILD_ROOT%{_datadir}/bigsister
-ln -sf	%{_var}/lib/bigsister/www www
-ln -sf	%{_var}/lib/bigsister var
-ln -sf	%{_sysconfdir}/bigsister/etc etc
-
-#correct path in files
-cat $RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/moduleinfo/files | sed -e "s#$RPM_BUILD_ROOT##g" | sed -e "s#%{_datadir}/bigsister/etc#%{_sysconfdir}/bigsister/etc#g" > $RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/moduleinfo/files.new
-rm -rf	$RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/moduleinfo/files
-mv -f	$RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/moduleinfo/files.new \
-	$RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/moduleinfo/files
-
-cat $RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/resources | sed -e "s#%{_datadir}/bigsister/etc#%{_sysconfdir}/bigsister/etc#g" > $RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/resources.new
-rm -rf	$RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/resources 
-mv -f	$RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/resources.new \
-	$RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/resources 
+ln -sf %{_var}/lib/bigsister/www www
+ln -sf %{_var}/lib/bigsister var
+ln -sf %{_sysconfdir}/bigsister/etc etc
+
+# correct path in files
+sed -i -e "
+	s#$RPM_BUILD_ROOT##g
+	s#%{_datadir}/bigsister/etc#%{_sysconfdir}/bigsister/etc#g
+" $RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/moduleinfo/files
+
+sed -i -e '
+	s#%{_datadir}/bigsister/etc#%{_sysconfdir}/bigsister/etc#g
+' $RPM_BUILD_ROOT%{_sysconfdir}/bigsister/etc/resources
 
 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
@@ -228,7 +222,6 @@
 rm -f $RPM_BUILD_ROOT/etc/bigsister/httpd.conf
 rm -f $RPM_BUILD_ROOT/etc/bigsister/etc/mibs.txt
 
-
 install %{SOURCE3} $RPM_BUILD_ROOT/etc/bigsister/etc/bsmon.cfg
 install %{SOURCE4} $RPM_BUILD_ROOT/etc/bigsister/uxmon-net
 install %{SOURCE6} $RPM_BUILD_ROOT/etc/bigsister/uxmon-asroot
@@ -246,17 +239,11 @@
 
 %post
 /sbin/chkconfig --add bigsister
-if [ -f /var/lock/subsys/bigsister ]; then
-	/etc/rc.d/init.d/bigsister restart >&2
-else
-	echo "Run \"/etc/rc.d/init.d/bigsister start\" to start Big Sister." >&2
-fi
+%service bigsister restart "Big Sister"
 
 %preun
 if [ "$1" = "0" ]; then
-	if [ -f /var/lock/subsys/bigsister ]; then
-		/etc/rc.d/init.d/bigsister stop >&2
-	fi
+	%service bigsister stop
 	/sbin/chkconfig --del bigsister
 fi
 
@@ -287,17 +274,11 @@
 	echo "Change this: htpasswd -b /etc/bigsister/password user password"
 fi
 
-if [ -f /var/lock/subsys/bigsister ]; then
-	/etc/rc.d/init.d/bigsister restart >&2
-else
-	echo "Run \"/etc/rc.d/init.d/bigsister start\" to start Big Sister." >&2
-fi
+%service -q bigsister restart
 
 %postun server
-if [ -f /var/lock/subsys/bigsister ]; then
-	/etc/rc.d/init.d/bigsister restart >&2
-else
-	echo "Run \"/etc/rc.d/init.d/bigsister start\" to start Big Sister." >&2
+if [ "$1" = 0 ]; then
+	%service -q bigsister restart
 fi
 
 %files
@@ -521,6 +502,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.63  2006/04/15 14:21:02  glen
+- use %service, cleanups
+
 Revision 1.62  2006/04/14 12:08:27  glen
 - revert
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/bigsister.spec?r1=1.62&r2=1.63&f=u



More information about the pld-cvs-commit mailing list