Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 6d209156c096dbacafbbb06800c7f9d1 > files > 12

ntop-3.4-0.2.pre3.fc14.src.rpm

Name:           ntop
Version:        3.4
Release:        0.2.pre3%{?dist}
Summary:        A network traffic probe similar to the UNIX top command
Group:          Applications/Internet
# Confirmed from fedora legal 488717
License:        GPLv2 and BSD with advertising
URL:            http://www.ntop.org
Source0:        http://downloads.sourceforge.net/ntop/ntop-%{version}-pre3.tar.gz
Source1:        ntop.init
Source2:        ntop.conf
Source3:        http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
Source4:        http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
# Source: wget -O etter.finger.os.gz http://ettercap.cvs.sourceforge.net/ettercap/ettercap_ng/share?rev=HEAD
Source5:	etter.finger.os.gz
Patch1:         ntop-am.patch
Patch2:         ntop-running-user.patch
Patch3:         ntop-dbfile-default-dir.patch
Patch4: 	ntop-disable-etter_fingerprint_download.patch
Patch5:         ntop-http_c.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  autoconf, automake, pkgconfig, libtool, groff, libpcap-devel wget
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)
BuildRequires:  GeoIP-devel, libevent-devel, lua-devel, python-devel
Requires:       initscripts, graphviz
Requires(post): /sbin/chkconfig       
Requires(post): openssl >= 0.9.7f-4, /bin/cat
Requires(preun):/sbin/chkconfig       


%description
ntop is a network traffic probe that shows the network usage, similar to what
the popular top Unix command does. ntop is based on libpcap and it has been
written in a portable way in order to virtually run on every Unix platform and
on Win32 as well.

ntop users can use a a web browser (e.g. netscape) to navigate through ntop
(that acts as a web server) traffic information and get a dump of the network
status. In the latter case, ntop can be seen as a simple RMON-like agent with
an embedded web interface. The use of:

    * a web interface
    * limited configuration and administration via the web interface
    * reduced CPU and memory usage (they vary according to network size and
      traffic) 

make ntop easy to use and suitable for monitoring various kind of networks.

ntop should be manually started the first time so that the administrator
password can be selected.


%prep
%setup -q -n ntop-%{version}-pre3
cp %SOURCE3 ./ && gunzip GeoLiteCity.dat.gz
cp %SOURCE4 ./ && gunzip GeoIPASNum.dat.gz

# executable bits are set on some config files and docs that go into
# %%{_sysconfdir}/ntop and %%{_datadir}, and some debug source files.  Remove
# the execute bits - in the build directory
find . \( -name \*\.gz -o -name \*\.c -o -name \*\.h -o -name \*\.pdf \
     -o -name \*\.dtd -o -name \*\.html -o -name \*\.js \) -print     \
     | xargs chmod a-x

%patch1 -p1 -b .am
%patch2 -p1 -b .user
%patch3 -p1 -b .dbfile-default-dir
%patch4 -p1 -b .ntop-disable-etter_fingerprint_download
%patch5 -p1 -b .http_c

%build
#run ntop own autoconf wrapper
./autogen.sh --noconfig

%{configure} --with-tcpwrap                            \
             --enable-sslv3                            \
             --enable-i18n                             \
             --enable-snmp                             \
             --enable-mysql                            \
             --disable-static
#rpath problem
sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'

# Now add init, conf
install -d $RPM_BUILD_ROOT/%{_initrddir}
install -p -m 0755 %SOURCE1 $RPM_BUILD_ROOT/%{_initrddir}/ntop
install -p -m 0644 %SOURCE2 $RPM_BUILD_ROOT/%{_sysconfdir}/ntop.conf

### CLEAN UP ###
# remove libtool archives and -devel type stuff (but leave dlopened modules)
find $RPM_BUILD_ROOT -name \*\.la -print | xargs rm -f
# these are not dlopened modules, but -devel cruft
rm -f $RPM_BUILD_ROOT/%{_libdir}/lib{myrrd,ntop,ntopreport,*Plugin*}.so
# remove empty file
rm -f $RPM_BUILD_ROOT/%{_datadir}/ntop/html/ntop.html
# fix permissions
chmod 0755 $RPM_BUILD_ROOT/%{_libdir}/ntop/plugins/*
# create files to be %ghost'ed - %ghost'ed files must exist in the buildroot
install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/ntop/rrd
install -d $RPM_BUILD_ROOT/%{_localstatedir}/lib/ntop/rrd/{flows,graphics,interfaces}
touch      $RPM_BUILD_ROOT/%{_localstatedir}/lib/ntop/{addressQueue,dnsCache,fingerprint,LsWatch,macPrefix,ntop_pw,prefsCache}.db
#remove expired certificate
rm -rf  $RPM_BUILD_ROOT/%{_sysconfdir}/ntop/ntop-cert.pem

%clean
rm -rf $RPM_BUILD_ROOT

%pre
if [ $1 = 1 ]; then
  getent group %{name} >/dev/null || groupadd -r %{name}
  getent passwd %{name} >/dev/null || \
         useradd -r -g %{name} -d %{_localstatedir}/lib/ntop -s /sbin/nologin \
                 -c "ntop" %{name}
fi

%post
/sbin/ldconfig
if [ $1 = 1 ]; then
  /sbin/chkconfig --add %{name} &> /dev/null || :
fi

# create new self-signed certificate
%define sslcert %{_sysconfdir}/ntop/ntop-cert.pem
if [ ! -f %{sslcert} ] ; then
 #get hosname
 FQDN=`hostname`
 if [ "x${FQDN}" = "x" ]; then
    FQDN=localhost.localdomain
 fi
 #create key and certificate in one file
 cat << EOF | %{_bindir}/openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout %{sslcert}  -out %{sslcert} 2>/dev/null
--
SomeState
SomeCity
SomeOrganization
SomeOrganizationalUnit
${FQDN}
root@${FQDN}
EOF
fi

%preun
if [ $1 = 0 ]; then
  /sbin/service %{name} stop    &> /dev/null || :
  /sbin/chkconfig --del %{name} &> /dev/null || :
fi

%postun
/sbin/ldconfig
if [ "$1" -ge "1" ]; then
  /sbin/service %{name} condrestart &> /dev/null || :
fi

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING MANIFESTO
%doc docs/BUG_REPORT docs/database/README docs/database/README
%doc docs/FAQarchive docs/FAQ docs/HACKING docs/KNOWN_BUGS docs/TODO
%doc docs/1STRUN.txt NEWS README SUPPORT_NTOP.txt THANKS
%config(noreplace) %{_sysconfdir}/ntop.conf
%config(noreplace) %{_sysconfdir}/ntop
%{_initrddir}/ntop
%{_sbindir}/*
%{_libdir}/*
%{_mandir}/man8/*
%{_datadir}/ntop
%dir %{_localstatedir}/lib/ntop
%defattr(0644,root,root,-)
%ghost %{_localstatedir}/lib/ntop/addressQueue.db
%ghost %{_localstatedir}/lib/ntop/dnsCache.db
%ghost %{_localstatedir}/lib/ntop/fingerprint.db
%ghost %{_localstatedir}/lib/ntop/LsWatch.db
%ghost %{_localstatedir}/lib/ntop/macPrefix.db
%ghost %{_localstatedir}/lib/ntop/ntop_pw.db
%ghost %{_localstatedir}/lib/ntop/prefsCache.db
# This will catch all the directories in flows/graphics/interfaces.  If
# %ghost'ed files are added under these, this will have to be changed to %dir
# and more directives for directories under these will have to be added.
%defattr(0755,ntop,ntop,-)
%{_localstatedir}/lib/ntop/rrd

%changelog
* Tue Jul 27 2010 David Malcolm <dmalcolm@redhat.com> - 3.4-0.2.pre3
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Tue May  4 2010 Rakesh Pandit <rakesh@fedoraproject.org> - 3.4-0.1.pre3
- Updated to 3.4-pre3

* Mon Dec  7 2009 Stepan Kasal <skasal@redhat.com> - 3.3.10-4
- rebuild against perl 5.10.1

* Sun Sep 13 2009 Rakesh Pandit <rakesh@fedoraproject.org> - 3.3.10-3
- Patch7: ntop-http_c.patch for #518264 (CVE-2009-2732)

* Fri Aug 21 2009 Tomas Mraz <tmraz@redhat.com> - 3.3.10-2
- rebuilt with new openssl

* Wed Aug 05 2009 Rakesh Pandit <rakesh@fedoraproject.org> - 3.3.10-1
- Updated to 3.3.10, updated geoip patch
- lua_wget patch to prevent wget lua
- removed ntop-http_c.patch

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3.9-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Mar 17 2009 Rakesh Pandit <rakesh@fedoraproject.org> - 3.3.9-5
- Fixed world-writable access log (#490561)

* Thu Mar 12 2009 Rakesh Pandit <rakesh@fedoraproject.org> - 3.3.9-4
- Fixing license tag and confirmed .dat file are legal (#488717)
- Fixed Source field with proper source URLs.

* Thu Mar 05 2009 Peter Vrabec <pvrabec@redhat.com> - 3.3.9-3
- build against existing package (#488419)

* Tue Mar 03 2009 Peter Vrabec <pvrabec@redhat.com> - 3.3.9-2
- do not create new certificate if there is already one installed

* Fri Feb 27 2009 Peter Vrabec <pvrabec@redhat.com> - 3.3.9-1
- upgrade
- invalid certificate fix (#486725)

* Sat Jan 24 2009 Rakesh Pandit <rakesh@fedoraproject.org> - 3.3.8-2
- Bumped - for new update in mysql

* Wed Oct 22 2008 Rakesh Pandit <rakesh@fedoraproject.org> - 3.3.8-1
- updated to 3.3.8, removed ntop compile patch

* Fri Aug 08 2008 Peter Vrabec <pvrabec@redhat.com> - 3.3.6-5
- fix typo in init
 
* Fri Aug 08 2008 Peter Vrabec <pvrabec@redhat.com> - 3.3.6-4
- some more init script tuning

* Fri Aug 08 2008 Rakesh Pandit <rakesh@fedoraproject.org> - 3.3.6-3
- ntop-am patch updated by Jakub H

* Fri Aug 08 2008 Peter Vrabec <pvrabec@redhat.com> - 3.3.6-2
- init script fix

* Tue Aug 05 2008 Peter Vrabec <pvrabec@redhat.com> - 3.3.6-1
- initial fedora package

* Wed Jul 02 2008 Rakesh Pandit <rakesh.pandit@gmail.com> - 3.3-4
- removed ntop_safefree (temp solution) fix for lvale problem with net-snmp on
- fix directory permission & license issues
- removed unused-direct-shlib-dependency warning
- rpath warning fixed. 

* Sun Nov 18 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-3
- add 'yes' as argument to skip-version-check in /etc/ntop.conf
- fix LSB section of init file to agree on default start runlevels
- make install preserve timestamps
- patch for location of throughput.rrd
- force LANG to "C" to prevent errors in string handling
- clean up init file
- add Requires: on graphviz

* Tue Jun 12 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-2
- autotools patch to fix broken --disable-static switch - updated
- remove find the removes CVS directories (no longer needed)

* Mon Jun 11 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-1
- update to ntop 3.3 release
- remove patch to change release version (no longer needed)
- fix initfile to use correct parameters to --skip-version-check

* Fri Jun 08 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.13.20070608cvs
- update to 20070608cvs
- update patch to remove rc version
- remove remove-gd-version-guess.patch (not needed anymore)
- remove xmldump plugin dependencies since it has been disabled (broken) in
  default ntop installation

* Fri Apr 06 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.12.20070407cvs
- update to 20070407cvs
- compile with -DDEBUG for now to check for problems
- rework ntop-am.patch with recent changes
- patch to remove gdVersionGuessValue from plugin
- repatch with shrext patch

* Mon Mar 19 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.11.20070319cvs
- update to 20070319cvs
- remove patches that have been added upstream

* Fri Mar 16 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.10.20070314cvs
- fix rpmlint warning for initfile
- include 2 of Patrice's patches to cleanup builds
- remove repotag

* Fri Mar 16 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.9.20070314cvs
- update to 20070314cvs
- add additional mysql patch from Patrice
- remove all of unused logrotate pieces
- use /sbin/service to start/stop services
- update scriptlets to be easier to read
- Better description to initfile summary
- add LSB bits to initfile

* Mon Mar 07 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.8.20070307cvs
- update to 20070307cvs
- move database files to %%{_localstatedir}/lib/ntop
- fix javascript files not being installed
- remove x bit from additional javascript files

* Sat Mar 03 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.6.20060207cvs
- add --enable-mysql to compile mysql support

* Sat Mar 03 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.5.20060207cvs
- prefix patches with ntop-
- explanation on how to retrieve cvs source
- fix removal of %%{_libdir}/.so plugin files no matter the version
- reduce dependency on mysql-server to just mysql

* Fri Mar 02 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.4.20060227cvs
- add pcre-devel to BR so payloads can be matched
- remove unused Source4 line
- enabled mysql storage of net flow data

* Tue Feb 27 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.3.20060227cvs
- update to ntop cvs 20060227
- kill all the CVS files/directories
- remove glib2-devel BR because gdome2-devel requires it
- tcp_wrappers vs. tcp_wrappers-devel no dependent on os release
- add initscripts to requires since init file uses daemon function
- patch .so files to just version 3.3 not 3.3rc0; otherwise rpmlint complains
- fix typo in init file

* Wed Feb 18 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.2.20060218cvs
- update to ntop cvs 20060208

* Wed Feb 07 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.3-0.1.20060207cvs
- update to ntop cvs 20060207
- remove gdbm, pidfile, and FEDORAextra patches
- ntopdump.dtd has fixed eol markers now
- update nolibs patch so there is no complaint about xmldump libraries/headers

* Tue Feb 06 2007 Bernard Johnson <bjohnson@symetrix.com> - 3.2-8.1.20060206cvs
- update to cvs 20060206
- update ntop-am.patch for cvs version
- get rid of plugins patch and just remove cruft in spec file

* Thu Dec 14 2006 Bernard Johnson <bjohnson@symetrix.com> - 3.2-7
- add missing net-snmp-devel, and lm_sensors-devel BR

* Thu Dec 14 2006 Bernard Johnson <bjohnson@symetrix.com> - 3.2-6
- configure --disable-static
- configure --enable-snmp
- patch to fix permissions of created gdbm databases
- no more ntop-passwd
- fix OK printing in init file, redirect stdout of ntop command to null
- fix permissions on LsWatch.db database creation
- only listen on 127.0.0.1:3000 by default

* Mon Dec 11 2006 Bernard Johnson <bjohnson@symetrix.com> - 3.2-5
- use ntop.conf.sample with some modifications
- change default syslog facilty to daemon in init file
- add repo tag for those who want to use it
- install as-data by default, at least for now
- fix package detection of gdome library
- remove extraneous ldconfig call

* Mon Dec 11 2006 Bernard Johnson <bjohnson@symetrix.com> - 3.2-4
- fix detection of glib-2.0 and gdome2
- remove Requires: entries to let rpm figure them out
- remove BR libxml2, zlib-devel as they are pulled by other packages
- added scriplet requires for /sbin/chkconfig
- add logrotate to requires
- add BR dependency on pkgconfig since patch to fix missing files depends on it

* Mon Dec 11 2006 Bernard Johnson <bjohnson@symetrix.com> - 3.2-3
- fix: do not package debug files in arch package
- fix: remove x bit from /usr/src debug files
- fix: direct source download link
- fix: don't package devel libraries in /usr/lib
- integrate previous package ntop.sysv to ntop.init
- remove sysconfig file
- clean up usage of fedora-usermgt
- remove ldconfig calls
- create a ntop-passwd wrapper to set the passwd
- fix: directory permission in directory, init, and passwd wrapper

* Sat Dec 09 2006 Bernard Johnson <bjohnson@symetrix.com> - 3.2-2
- revert to 3.2 sources
- integrate changes from previous package

* Fri Dec 08 2006 Bernard Johnson <bjohnson@symetrix.com> - 3.2-1.20061208cvs
- initial package