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
4 # - fix init script (--redirdfs is bogus?)
7 %bcond_with mysql # with mysql support
9 Summary: Network monitoring tool
10 Summary(pl.UTF-8): Narzędzie do monitorowania sieci
16 Source0: http://downloads.sourceforge.net/ntop/%{name}-%{version}.tar.gz
17 # Source0-md5: 22f916327f0e92d8c470aaadcb80d84d
19 Source2: %{name}.sysconfig
20 Patch0: %{name}-conf.patch
21 Patch1: %{name}-config.patch
22 Patch2: %{name}-am.patch
23 Patch3: %{name}-lua_wget.patch
24 Patch4: %{name}-http_c.patch
25 Patch5: %{name}-running-user.patch
26 Patch6: ieee-oui.patch
27 Patch7: %{name}-install.patch
28 URL: http://www.ntop.org/
29 BuildRequires: GeoIP-devel
30 BuildRequires: autoconf
31 BuildRequires: automake >= 1.6
33 BuildRequires: gd-devel >= 2.0.1
34 BuildRequires: gdbm-devel >= 1.8.3
35 BuildRequires: gdome2-devel
36 BuildRequires: glib2-devel
37 BuildRequires: libdbi-devel
38 BuildRequires: libevent-devel >= 1.4.0
39 BuildRequires: libpcap-devel
40 BuildRequires: libpng-devel
41 BuildRequires: libtiff-devel
42 BuildRequires: libtool
43 BuildRequires: libwrap-devel
44 BuildRequires: lua51-devel
45 BuildRequires: ncurses-devel >= 5.2
46 BuildRequires: net-snmp-devel
47 BuildRequires: openssl-devel >= 0.9.7d
48 BuildRequires: perl-devel
49 BuildRequires: readline-devel >= 4.2
50 BuildRequires: rpmbuild(macros) >= 1.268
51 BuildRequires: rrdtool-devel >= 1.1.0
52 BuildRequires: zlib-devel
53 Requires(post,postun): /sbin/ldconfig
54 Requires(post,preun): /sbin/chkconfig
55 Requires(postun): /usr/sbin/groupdel
56 Requires(postun): /usr/sbin/userdel
57 Requires(pre): /bin/id
58 Requires(pre): /usr/bin/getgid
59 Requires(pre): /usr/sbin/groupadd
60 Requires(pre): /usr/sbin/useradd
62 Requires: rc-scripts >= 0.4.2.8
63 # maybe is optional, needs checking
64 Suggests: GeoIP-db-City
65 Suggests: GeoIP-db-IPASNum
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 %define _localstatedir /var/lib
74 ntop is a tool that shows the network usage, similar to what the
75 popular top Unix command does.
77 %description -l pl.UTF-8
78 ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak
79 robi to popularna uniksowa komenda top.
92 # taken from autogen.sh
93 cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in
94 cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4
102 # "verified.awk -u" calls require gawk
107 --with-ossl-root=%{_prefix} \
110 %{?with_mysql:--enable-mysql}
115 rm -rf $RPM_BUILD_ROOT
116 install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}}
122 DESTDIR=$RPM_BUILD_ROOT
124 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
125 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
126 cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf
128 # these are identical files according to find-debuginfo
129 for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do
130 ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so
133 ln -s %{_datadir}/oui.txt $RPM_BUILD_ROOT%{_sysconfdir}/ntop/oui.txt
136 rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la
139 rm -rf $RPM_BUILD_ROOT
142 %groupadd -g 120 ntop
143 %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop
147 /sbin/chkconfig --add ntop
148 %service ntop restart "ntop daemon"
151 if [ "$1" = "0" ]; then
153 /sbin/chkconfig --del ntop
158 if [ "$1" = "0" ]; then
164 %defattr(644,root,root,755)
165 %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ}
166 %attr(750,root,ntop) %dir %{_sysconfdir}/ntop
167 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/ntop-cert.pem
168 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/oui.txt
169 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/specialMAC.txt.gz
170 %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf
171 %attr(754,root,root) /etc/rc.d/init.d/ntop
172 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop
173 %attr(755,root,root) %{_sbindir}/ntop
174 %attr(755,root,root) %{_libdir}/lib*.so
175 %attr(755,root,root) %{_datadir}/%{name}
176 %dir %{_libdir}/%{name}
177 %attr(755,root,root) %{_libdir}/%{name}/plugins
178 %{_mandir}/man8/ntop.8*
180 %attr(770,root,ntop) %dir %{_localstatedir}/ntop
181 %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd