rpms/vnstat/devel .cvsignore, 1.4, 1.5 sources, 1.4, 1.5 vnstat.spec, 1.15, 1.16

Robert Scheck robert at fedoraproject.org
Sat Dec 26 13:26:11 UTC 2009


Author: robert

Update of /cvs/pkgs/rpms/vnstat/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5425

Modified Files:
	.cvsignore sources vnstat.spec 
Log Message:
- Upgrade to 1.9 and make rpmlint more silent
- Make %pre script with useradd more conform to guidelines
- Replace %{_initddir} macro for more easy EPEL support
- Preserve timestamps when using sed to manipulate files



Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/vnstat/devel/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- .cvsignore	9 Nov 2009 10:22:13 -0000	1.4
+++ .cvsignore	26 Dec 2009 13:26:10 -0000	1.5
@@ -1 +1 @@
-vnstat-1.8.tar.gz
+vnstat-1.9.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/vnstat/devel/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- sources	9 Nov 2009 10:22:13 -0000	1.4
+++ sources	26 Dec 2009 13:26:10 -0000	1.5
@@ -1 +1 @@
-99a30716b5013e7e249e500ee6ee2985  vnstat-1.8.tar.gz
+ebaf8352fa3674faea2fe2ce1001a38d  vnstat-1.9.tar.gz


Index: vnstat.spec
===================================================================
RCS file: /cvs/pkgs/rpms/vnstat/devel/vnstat.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -p -r1.15 -r1.16
--- vnstat.spec	19 Nov 2009 10:36:29 -0000	1.15
+++ vnstat.spec	26 Dec 2009 13:26:10 -0000	1.16
@@ -1,13 +1,13 @@
 Summary: Console-based network traffic monitor
 Name: vnstat
-Version: 1.8
-Release: 7%{?dist}
+Version: 1.9
+Release: 1%{?dist}
 
 License: GPLv2
 Group: System Environment/Daemons
 URL: http://humdi.net/vnstat/
 Source: http://humdi.net/vnstat/vnstat-%{version}.tar.gz
-Requires(pre): /usr/sbin/useradd
+Requires(pre): shadow-utils
 Requires(post): chkconfig
 Requires(preun): chkconfig
 Requires(preun): initscripts
@@ -23,13 +23,21 @@ be used without root permissions. See th
 
 %prep
 %setup -q
+
 # disable maximum bandwidth setting
-%{__sed} -i -e "s,MaxBandwidth 100,MaxBandwidth 0,g" cfg/vnstat.conf
+%{__sed} -e "s,MaxBandwidth 100,MaxBandwidth 0,g" \
+  cfg/vnstat.conf > cfg/vnstat.conf.new
+touch -r cfg/vnstat.conf{,.new}
+%{__mv} -f cfg/vnstat.conf{.new,}
+
 # no automatic runlevel
-%{__sed} -i -e "s,chkconfig: 2345 20 50,chkconfig: - 20 50," \
-            -e "s,Default-Start:     2 3 4 5,Default-Start:," \
-            -e "s,Default-Stop:      0 1 6,Default-Stop:," \
-  examples/init.d/fedora/vnstat
+%{__sed} -e "s,chkconfig: 2345 20 50,chkconfig: - 20 50," \
+         -e "s,Default-Start:     2 3 4 5,Default-Start:," \
+         -e "s,Default-Stop:      0 1 6,Default-Stop:," \
+  examples/init.d/fedora/vnstat > examples/init.d/fedora/vnstat.new
+touch -r examples/init.d/fedora/vnstat{,.new}
+%{__mv} -f examples/init.d/fedora/vnstat{.new,}
+
 # Use -p everywhere, -s nowhere
 %{__sed} -i -e "s,install \(-s \)\?,install -p ," Makefile
 
@@ -39,11 +47,12 @@ be used without root permissions. See th
 %install
 %{__rm} -rf $RPM_BUILD_ROOT
 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/cron.d
-%{__mkdir_p} $RPM_BUILD_ROOT%{_initddir}
+%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
 %{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
 
 %{__make} install DESTDIR=$RPM_BUILD_ROOT
-%{__install} -p -m 755 examples/init.d/fedora/vnstat $RPM_BUILD_ROOT%{_initddir}
+%{__install} -p -m 755 examples/init.d/fedora/vnstat \
+  $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d
 %{__rm} -rf examples/init.d
 %{__chmod} 644 examples/vnstat.cgi
 %{__chmod} 644 examples/vnstat.cron
@@ -75,7 +84,7 @@ END
 VNSTAT_CONF=%{_sysconfdir}/sysconfig/%{name}
 
 if [ ! -f $VNSTAT_CONF ]; then
-	exit 0
+  exit 0
 fi
 
 . \$VNSTAT_CONF
@@ -87,8 +96,9 @@ END
 %{__rm} -rf $RPM_BUILD_ROOT
 
 %pre
-%{_sbindir}/useradd -r -s /sbin/nologin -d %{_localstatedir}/lib/%{name} \
-	-M -c "vnStat user" %{name} > /dev/null 2>&1 || :
+getent group %{name} > /dev/null || %{_sbindir}/groupadd -r %{name}
+getent passwd %{name} > /dev/null || %{_sbindir}/useradd -r -g %{name} -M \
+  -d %{_localstatedir}/lib/%{name} -s /sbin/nologin -c "vnStat user" %{name}
 
 %post
 /sbin/chkconfig --add vnstat || :
@@ -109,7 +119,7 @@ fi
 %doc CHANGES COPYING FAQ README INSTALL examples
 %config(noreplace) %{_sysconfdir}/%{name}.conf
 %config(noreplace) %{_sysconfdir}/cron.d/%{name}
-%{_initddir}/vnstat
+%{_sysconfdir}/rc.d/init.d/%{name}
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
 %{_mandir}/man*/*
 %{_bindir}/vnstat
@@ -119,6 +129,12 @@ fi
 %attr(-,vnstat,vnstat)%{_localstatedir}/lib/%{name}
 
 %changelog
+* Sat Dec 26 2009 Robert Scheck <robert at fedoraproject.org> - 1.9-1
+- Upgrade to 1.9 and make rpmlint more silent
+- Make %%pre script with useradd more conform to guidelines
+- Replace %%{_initddir} macro for more easy EPEL support
+- Preserve timestamps when using sed to manipulate files
+
 * Wed Nov 18 2009 Ville Skyttä <ville.skytta at iki.fi> - 1.8-7
 - Prevent upstream build from stripping binaries before rpmbuild does it.
 




More information about the fedora-extras-commits mailing list