2 # - see if it uses system files for ettercap and geoip, ieee-oui files we did not package
3 # - see where plugins are needed in plugin dir or in system dir
5 # /etc/ntop/GeoIPASNum.dat
6 # /etc/ntop/GeoLiteCity.dat
8 # /usr/lib64/libntopreport.a
9 # NOTE: can read oui.txt.xz if MAKE_WITH_ZLIB enabled
12 %bcond_with mysql # with mysql support
14 Summary: Network monitoring tool
15 Summary(pl.UTF-8): Narzędzie do monitorowania sieci
21 Source0: http://downloads.sourceforge.net/ntop/%{name}-%{version}.tar.gz
22 # Source0-md5: 01710b6925a8a5ffe1a41b8b512ebd69
24 Source2: %{name}.sysconfig
25 # http://ettercap.cvs.sourceforge.net/ettercap/ettercap_ng/share/etter.finger.os?rev=HEAD
26 Source3: etter.finger.os
27 Patch0: %{name}-conf.patch
28 Patch1: %{name}-config.patch
29 Patch2: %{name}-am.patch
30 Patch3: %{name}-lua_wget.patch
31 Patch4: %{name}-http_c.patch
32 Patch5: %{name}-running-user.patch
33 Patch6: ieee-oui.patch
34 Patch7: %{name}-install.patch
35 Patch8: %{name}-rrdtool-1.6.0.patch
37 URL: http://www.ntop.org/
38 BuildRequires: GeoIP-devel
39 BuildRequires: autoconf
40 BuildRequires: automake >= 1.6
42 BuildRequires: gd-devel >= 2.0.1
43 BuildRequires: gdbm-devel >= 1.8.3
44 BuildRequires: gdome2-devel
45 BuildRequires: glib2-devel
46 BuildRequires: libdbi-devel
47 BuildRequires: libevent-devel >= 1.4.0
48 BuildRequires: libpcap-devel
49 BuildRequires: libpng-devel
50 BuildRequires: libtiff-devel
51 BuildRequires: libtool
52 BuildRequires: libwrap-devel
53 BuildRequires: lua51-devel
54 BuildRequires: ncurses-devel >= 5.2
55 BuildRequires: net-snmp-devel
56 BuildRequires: openssl-devel >= 0.9.7d
57 BuildRequires: perl-devel
58 BuildRequires: readline-devel >= 4.2
59 BuildRequires: rpm-pythonprov
60 BuildRequires: rpmbuild(macros) >= 1.268
61 BuildRequires: rrdtool-devel >= 1.1.0
62 BuildRequires: sed >= 4.0
63 BuildRequires: zlib-devel
64 Requires(post,postun): /sbin/ldconfig
65 Requires(post,preun): /sbin/chkconfig
66 Requires(postun): /usr/sbin/groupdel
67 Requires(postun): /usr/sbin/userdel
68 Requires(pre): /bin/id
69 Requires(pre): /usr/bin/getgid
70 Requires(pre): /usr/sbin/groupadd
71 Requires(pre): /usr/sbin/useradd
72 Requires: hwdata >= 0.243-2
73 Requires: rc-scripts >= 0.4.2.8
74 # maybe is optional, needs checking
75 Suggests: GeoIP-db-City
76 Suggests: GeoIP-db-IPASNum
80 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
82 %define _localstatedir /var/lib
85 ntop is a tool that shows the network usage, similar to what the
86 popular top Unix command does.
88 %description -l pl.UTF-8
89 ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak
90 robi to popularna uniksowa komenda top.
105 gzip -9c %{SOURCE3} >etter.finger.os.gz
107 # taken from autogen.sh
108 cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in
109 cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4
123 # "verified.awk -u" calls require gawk
128 --with-ossl-root=%{_prefix} \
131 %{?with_mysql:--enable-mysql}
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}}
143 DESTDIR=$RPM_BUILD_ROOT
145 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
146 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
147 cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf
149 # these are identical files according to find-debuginfo
150 for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do
151 ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so
154 # read by checkForInputFile() scanning various dirs and extensions
155 ln -s /lib/hwdata/oui.txt $RPM_BUILD_ROOT%{_sysconfdir}/ntop/oui.txt
158 rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la
161 rm -rf $RPM_BUILD_ROOT
164 %groupadd -g 120 ntop
165 %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop
169 /sbin/chkconfig --add ntop
170 %service ntop restart "ntop daemon"
173 if [ "$1" = "0" ]; then
175 /sbin/chkconfig --del ntop
180 if [ "$1" = "0" ]; then
186 %defattr(644,root,root,755)
187 %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ}
188 %attr(750,root,ntop) %dir %{_sysconfdir}/ntop
189 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/ntop-cert.pem
190 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/oui.txt
191 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/specialMAC.txt.gz
192 %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf
193 %attr(754,root,root) /etc/rc.d/init.d/ntop
194 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop
195 %attr(755,root,root) %{_sbindir}/ntop
196 %attr(755,root,root) %{_libdir}/lib*.so
197 %attr(755,root,root) %{_datadir}/%{name}
198 %dir %{_libdir}/%{name}
199 %attr(755,root,root) %{_libdir}/%{name}/plugins
200 %{_mandir}/man8/ntop.8*
202 %attr(770,root,ntop) %dir %{_localstatedir}/ntop
203 %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd