[ntop] Merge in el6 bits BZ#845195
jsteffan
jsteffan at fedoraproject.org
Sun Nov 25 20:06:49 UTC 2012
commit 3ce8aebf0a6c4ac1a4f905105c91d530182ce3a6
Author: Jonathan Steffan <jsteffan at fedoraproject.org>
Date: Sun Nov 25 13:06:42 2012 -0700
Merge in el6 bits BZ#845195
ntop.init | 6 +++---
ntop.spec | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
sources | 6 +++---
3 files changed, 53 insertions(+), 11 deletions(-)
---
diff --git a/ntop.init b/ntop.init
index a3811db..81f76e3 100644
--- a/ntop.init
+++ b/ntop.init
@@ -5,7 +5,7 @@
# chkconfig: - 81 19
# description: A network traffic probe similar to the UNIX top command
# processname: ntop
-# pidfile: /var/run/ntop.pid
+# pidfile: /var/lib/ntop/ntop.pid
# config: /etc/ntop.conf
#
### BEGIN INIT INFO
@@ -25,7 +25,7 @@
# Path to the ntop program
prog=ntop
ntop=/usr/sbin/$prog
-pidfile=/var/run/$prog.pid
+pidfile=/var/lib/ntop/ntop.pid
config=/etc/ntop.conf
@@ -77,7 +77,7 @@ case "$1" in
RETVAL=$?
;;
condrestart)
- if [ -f /var/run/$prog.pid ] ; then
+ if [ -f $pidfile ] ; then
stop
start
fi
diff --git a/ntop.spec b/ntop.spec
index d165244..67c6c57 100644
--- a/ntop.spec
+++ b/ntop.spec
@@ -1,7 +1,7 @@
%define _hardened_build 1
Name: ntop
Version: 5.0
-Release: 2%{?dist}
+Release: 4%{?dist}
Summary: A network traffic probe similar to the UNIX top command
Group: Applications/Internet
# Confirmed from fedora legal 488717
@@ -17,6 +17,7 @@ Source5: etter.finger.os.gz
# svn export -r 5614 https://svn.ntop.org/svn/ntop/trunk/nDPI/
# tar -czvf nDPI-svn5614.tar.gz nDPI
Source6: nDPI-svn5614.tar.gz
+Source7: ntop.init
Patch0: ntop-am.patch
Patch1: ntop-running-user.patch
Patch2: ntop-dbfile-default-dir.patch
@@ -27,14 +28,21 @@ BuildRequires: autoconf, automake, pkgconfig, libtool, groff, libpcap-devel wge
BuildRequires: gdbm-devel, gd-devel, rrdtool-devel, openssl-devel
BuildRequires: net-snmp-devel, lm_sensors-devel, pcre-devel, mysql-devel
BuildRequires: tcp_wrappers-devel, perl(ExtUtils::Embed), pam-devel
-BuildRequires: GeoIP-devel, lua-devel, python-devel
-BuildRequires: systemd-units
+BuildRequires: GeoIP-devel, lua-devel, python-devel, python-mako
Requires: initscripts, graphviz
-Requires(post): systemd-sysv
Requires(post): openssl >= 0.9.7f-4, /bin/cat
+%if 0%{?el6}
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Requires(post): /sbin/chkconfig
+Requires(preun):/sbin/chkconfig
+%else
+BuildRequires: systemd-units
+Requires(post): systemd-sysv
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
+%endif
+
%description
ntop is a network traffic probe that shows the network usage, similar to what
@@ -93,9 +101,15 @@ make %{?_smp_mflags}
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
# Now add init, conf
+install -p -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%{_sysconfdir}/ntop.conf
+
+%if 0%{?el6}
+install -d $RPM_BUILD_ROOT/%{_initrddir}
+install -p -m 0755 %SOURCE7 $RPM_BUILD_ROOT/%{_initrddir}/ntop
+%else
install -d $RPM_BUILD_ROOT/%{_unitdir}
install -p -m 0755 %SOURCE1 $RPM_BUILD_ROOT/%{_unitdir}/ntop.service
-install -p -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%{_sysconfdir}/ntop.conf
+%endif
### CLEAN UP ###
# remove libtool archives and -devel type stuff (but leave dlopened modules)
@@ -124,8 +138,12 @@ fi
%post
if [ $1 -eq 1 ] ; then
+%if 0%{?el6}
+ /sbin/chkconfig --add %{name} &> /dev/null || :
+%else
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+%endif
fi
/sbin/ldconfig
# create new self-signed certificate
@@ -150,19 +168,32 @@ fi
%preun
if [ $1 -eq 0 ] ; then
+%if 0%{?el6}
+ /sbin/service %{name} stop &> /dev/null || :
+ /sbin/chkconfig --del %{name} &> /dev/null || :
+%else
# Package removal, not upgrade
/bin/systemctl --no-reload disable ntop.service > /dev/null 2>&1 || :
/bin/systemctl stop ntop.service > /dev/null 2>&1 || :
+%endif
fi
%postun
+%if 0%{?el6}
+if [ "$1" -ge "1" ]; then
+ /sbin/service %{name} condrestart &> /dev/null || :
+fi
+%else
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
/bin/systemctl try-restart ntop.service >/dev/null 2>&1 || :
fi
+%endif
/sbin/ldconfig
+%if 0%{?el6}
+%else
%triggerun -- ntop < 3.4-0.8.pre3
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply ntop
@@ -172,6 +203,7 @@ fi
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del ntop >/dev/null 2>&1 || :
/bin/systemctl try-restart ntop.service >/dev/null 2>&1 || :
+%endif
%files
%doc AUTHORS ChangeLog COPYING MANIFESTO
@@ -180,7 +212,11 @@ fi
%doc docs/1STRUN.txt NEWS README SUPPORT_NTOP.txt THANKS
%config(noreplace) %{_sysconfdir}/ntop.conf
%config(noreplace) %{_sysconfdir}/ntop
+%if 0%{?el6}
+%{_initrddir}/ntop
+%else
%{_unitdir}/ntop.service
+%endif
%{_sbindir}/*
%{_libdir}/*.so
%{_libdir}/ntop
@@ -203,6 +239,12 @@ fi
%{_localstatedir}/lib/ntop/rrd
%changelog
+* Fri Nov 09 2012 Jonathan Steffan <jsteffan at fedoraproject.org> - 5.0-4
+- Add python-mako Requires for region map
+
+* Thu Nov 08 2012 Jonathan Steffan <jsteffan at fedoraproject.org> - 5.0-3
+- Add changes for EPEL6 from Stjepan Gros (rhbz #845195)
+
* Wed Aug 01 2012 Sven Lankes <sven at lank.es> - 5.0-2
- disable autogen check for svn
diff --git a/sources b/sources
index 95f832d..bdb6a7d 100644
--- a/sources
+++ b/sources
@@ -1,5 +1,5 @@
-e4115a6609fd2def2dce177772f9a789 ntop-5.0.tar.gz
-96fa6c171e00f4df2d6add2c1dc8ae30 etter.finger.os.gz
-c7723d644e545936ef5ef80fb4779901 GeoLiteCity.dat.gz
248128df8e0ffb12fc8a837e3310e2af GeoIPASNum.dat.gz
+c7723d644e545936ef5ef80fb4779901 GeoLiteCity.dat.gz
+96fa6c171e00f4df2d6add2c1dc8ae30 etter.finger.os.gz
e21eeebf7134161dcb9375d343f13bcc nDPI-svn5614.tar.gz
+e4115a6609fd2def2dce177772f9a789 ntop-5.0.tar.gz
More information about the scm-commits
mailing list