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: 116df99cf548431393991ea15443c52f
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}-no_wget_etter.patch
36 URL: http://www.ntop.org/
37 BuildRequires: GeoIP-devel
38 BuildRequires: autoconf
39 BuildRequires: automake >= 1.6
41 BuildRequires: gd-devel >= 2.0.1
42 BuildRequires: gdbm-devel >= 1.8.3
43 BuildRequires: gdome2-devel
44 BuildRequires: glib2-devel
45 BuildRequires: libdbi-devel
46 BuildRequires: libevent-devel >= 1.4.0
47 BuildRequires: libpcap-devel
48 BuildRequires: libpng-devel
49 BuildRequires: libtiff-devel
50 BuildRequires: libtool
51 BuildRequires: libwrap-devel
52 BuildRequires: lua51-devel
53 BuildRequires: ncurses-devel >= 5.2
54 BuildRequires: net-snmp-devel
55 BuildRequires: openssl-devel >= 0.9.7d
56 BuildRequires: perl-devel
57 BuildRequires: readline-devel >= 4.2
58 BuildRequires: rpm-pythonprov
59 BuildRequires: rpmbuild(macros) >= 1.268
60 BuildRequires: rrdtool-devel >= 1.1.0
61 BuildRequires: sed >= 4.0
62 BuildRequires: zlib-devel
63 Requires(post,postun): /sbin/ldconfig
64 Requires(post,preun): /sbin/chkconfig
65 Requires(postun): /usr/sbin/groupdel
66 Requires(postun): /usr/sbin/userdel
67 Requires(pre): /bin/id
68 Requires(pre): /usr/bin/getgid
69 Requires(pre): /usr/sbin/groupadd
70 Requires(pre): /usr/sbin/useradd
71 Requires: hwdata >= 0.243-2
72 Requires: rc-scripts >= 0.4.2.8
73 # maybe is optional, needs checking
74 Suggests: GeoIP-db-City
75 Suggests: GeoIP-db-IPASNum
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81 %define _localstatedir /var/lib
84 ntop is a tool that shows the network usage, similar to what the
85 popular top Unix command does.
87 %description -l pl.UTF-8
88 ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak
89 robi to popularna uniksowa komenda top.
104 s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/
105 s/AM_PROG_CC_STDC/AC_PROG_CC/
107 /3rd_party\/oui.txt.gz/d
110 gzip -9c %{SOURCE3} >etter.finger.os.gz
112 # taken from autogen.sh
113 cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in
114 cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4
122 # "verified.awk -u" calls require gawk
127 --with-ossl-root=%{_prefix} \
130 %{?with_mysql:--enable-mysql}
135 rm -rf $RPM_BUILD_ROOT
136 install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}}
142 DESTDIR=$RPM_BUILD_ROOT
144 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
145 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
146 cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf
148 # these are identical files according to find-debuginfo
149 for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do
150 ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so
153 # read by checkForInputFile() scanning various dirs and extensions
154 ln -s /lib/hwdata/oui.txt $RPM_BUILD_ROOT%{_sysconfdir}/ntop/oui.txt
157 rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la
160 rm -rf $RPM_BUILD_ROOT
163 %groupadd -g 120 ntop
164 %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop
168 /sbin/chkconfig --add ntop
169 %service ntop restart "ntop daemon"
172 if [ "$1" = "0" ]; then
174 /sbin/chkconfig --del ntop
179 if [ "$1" = "0" ]; then
185 %defattr(644,root,root,755)
186 %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ}
187 %attr(750,root,ntop) %dir %{_sysconfdir}/ntop
188 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/ntop-cert.pem
189 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/oui.txt
190 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/specialMAC.txt.gz
191 %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf
192 %attr(754,root,root) /etc/rc.d/init.d/ntop
193 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop
194 %attr(755,root,root) %{_sbindir}/ntop
195 %attr(755,root,root) %{_libdir}/lib*.so
196 %attr(755,root,root) %{_datadir}/%{name}
197 %dir %{_libdir}/%{name}
198 %attr(755,root,root) %{_libdir}/%{name}/plugins
199 %{_mandir}/man8/ntop.8*
201 %attr(770,root,ntop) %dir %{_localstatedir}/ntop
202 %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd