2 # - see if it uses system files for ettercap and geoip files we did not package
3 # - see if /etc/ntop/oui.txt.gz can be externalized (whatever it is)
4 # - see where plugins are needed in plugin dir or in system dir
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: 6e2ffa90d5f935c8f03d88a5dd19a866
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}-geoip.patch
25 Patch5: %{name}-http_c.patch
26 Patch6: %{name}-running-user.patch
27 URL: http://www.ntop.org/
28 BuildRequires: GeoIP-devel
29 BuildRequires: autoconf
30 BuildRequires: automake >= 1.6
32 BuildRequires: gd-devel >= 2.0.1
33 BuildRequires: gdbm-devel >= 1.8.3
34 BuildRequires: gdome2-devel
35 BuildRequires: glib2-devel
36 BuildRequires: libevent-devel >= 1.4.0
37 BuildRequires: libpcap-devel
38 BuildRequires: libpng-devel
39 BuildRequires: libtiff-devel
40 BuildRequires: libtool
41 BuildRequires: libwrap-devel
42 BuildRequires: lua51-devel
43 BuildRequires: ncurses-devel >= 5.2
44 BuildRequires: net-snmp-devel
45 BuildRequires: openssl-devel >= 0.9.7d
46 BuildRequires: readline-devel >= 4.2
47 BuildRequires: rpmbuild(macros) >= 1.268
48 BuildRequires: rrdtool-devel >= 1.1.0
49 BuildRequires: zlib-devel
50 Requires(post,postun): /sbin/ldconfig
51 Requires(post,preun): /sbin/chkconfig
52 Requires(postun): /usr/sbin/groupdel
53 Requires(postun): /usr/sbin/userdel
54 Requires(pre): /bin/id
55 Requires(pre): /usr/bin/getgid
56 Requires(pre): /usr/sbin/groupadd
57 Requires(pre): /usr/sbin/useradd
59 # maybe is optional, needs checking
60 Suggests: GeoIP-db-City
61 Suggests: GeoIP-db-IPASNum
65 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
67 %define _localstatedir /var/lib
70 ntop is a tool that shows the network usage, similar to what the
71 popular top Unix command does.
73 %description -l pl.UTF-8
74 ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak
75 robi to popularna uniksowa komenda top.
87 # taken from autogen.sh
88 cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in
89 cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4
97 # "verified.awk -u" calls require gawk
102 --with-ossl-root=%{_prefix} \
105 %{?with_mysql:--enable-mysql}
110 rm -rf $RPM_BUILD_ROOT
111 install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}}
116 DESTDIR=$RPM_BUILD_ROOT
118 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
119 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
120 cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf
122 # these are identical files according to find-debuginfo
123 for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do
124 ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so
128 rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la
131 rm -rf $RPM_BUILD_ROOT
134 %groupadd -g 120 ntop
135 %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop
139 /sbin/chkconfig --add ntop
140 %service ntop restart "ntop daemon"
143 if [ "$1" = "0" ]; then
145 /sbin/chkconfig --del ntop
150 if [ "$1" = "0" ]; then
156 %defattr(644,root,root,755)
157 %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ}
158 %attr(750,root,ntop) %dir %{_sysconfdir}/ntop
159 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/ntop-cert.pem
160 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/oui.txt.gz
161 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/specialMAC.txt.gz
162 %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf
163 %attr(754,root,root) /etc/rc.d/init.d/ntop
164 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop
165 %attr(755,root,root) %{_sbindir}/ntop
166 %attr(755,root,root) %{_libdir}/lib*.so
167 %attr(755,root,root) %{_datadir}/%{name}
168 %dir %{_libdir}/%{name}
169 %attr(755,root,root) %{_libdir}/%{name}/plugins
170 %{_mandir}/man8/ntop.8*
172 %attr(770,root,ntop) %dir %{_localstatedir}/ntop
173 %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd