]>
Commit | Line | Data |
---|---|---|
1c15e1a3 | 1 | # TODO |
9d96f8b2 | 2 | # - see if it uses system files for ettercap and geoip, ieee-oui files we did not package |
f9d989ae | 3 | # - see where plugins are needed in plugin dir or in system dir |
fb745d9b | 4 | # |
8f8442a4 | 5 | # Conditional build: |
fb745d9b | 6 | %bcond_with mysql # with mysql support |
1c15e1a3 | 7 | |
3f97aafa | 8 | Summary: Network monitoring tool |
e89446b9 | 9 | Summary(pl.UTF-8): Narzędzie do monitorowania sieci |
3f97aafa | 10 | Name: ntop |
f839ee23 | 11 | Version: 3.3.10 |
a991f53d | 12 | Release: 4 |
3f97aafa | 13 | License: GPL |
9eec0d7a | 14 | Group: Networking |
1c15e1a3 | 15 | Source0: http://downloads.sourceforge.net/ntop/%{name}-%{version}.tar.gz |
f839ee23 | 16 | # Source0-md5: 6e2ffa90d5f935c8f03d88a5dd19a866 |
81772bff | 17 | Source1: %{name}.init |
18 | Source2: %{name}.sysconfig | |
fb745d9b | 19 | Patch0: %{name}-conf.patch |
20 | Patch1: %{name}-config.patch | |
21 | Patch2: %{name}-am.patch | |
abadc7c1 ER |
22 | Patch3: %{name}-lua_wget.patch |
23 | Patch4: %{name}-geoip.patch | |
8db4b37a ER |
24 | Patch5: %{name}-http_c.patch |
25 | Patch6: %{name}-running-user.patch | |
9d96f8b2 | 26 | Patch7: ieee-oui.patch |
3f97aafa | 27 | URL: http://www.ntop.org/ |
1c15e1a3 | 28 | BuildRequires: GeoIP-devel |
03329ce3 | 29 | BuildRequires: autoconf |
fd17b5c4 | 30 | BuildRequires: automake >= 1.6 |
9e8c6481 | 31 | BuildRequires: gawk |
23c07473 | 32 | BuildRequires: gd-devel >= 2.0.1 |
8aa70f00 | 33 | BuildRequires: gdbm-devel >= 1.8.3 |
26a5ca45 ER |
34 | BuildRequires: gdome2-devel |
35 | BuildRequires: glib2-devel | |
f839ee23 | 36 | BuildRequires: libevent-devel >= 1.4.0 |
3f97aafa | 37 | BuildRequires: libpcap-devel |
03329ce3 | 38 | BuildRequires: libpng-devel |
ad718851 | 39 | BuildRequires: libtiff-devel |
03329ce3 | 40 | BuildRequires: libtool |
9e8c6481 | 41 | BuildRequires: libwrap-devel |
abadc7c1 | 42 | BuildRequires: lua51-devel |
75909d05 | 43 | BuildRequires: ncurses-devel >= 5.2 |
f9d989ae | 44 | BuildRequires: net-snmp-devel |
6ebc82ab | 45 | BuildRequires: openssl-devel >= 0.9.7d |
75909d05 | 46 | BuildRequires: readline-devel >= 4.2 |
411f46d0 | 47 | BuildRequires: rpmbuild(macros) >= 1.268 |
fd17b5c4 | 48 | BuildRequires: rrdtool-devel >= 1.1.0 |
fe6022b1 | 49 | BuildRequires: zlib-devel |
8005772a ER |
50 | Requires(post,postun): /sbin/ldconfig |
51 | Requires(post,preun): /sbin/chkconfig | |
52 | Requires(postun): /usr/sbin/groupdel | |
53 | Requires(postun): /usr/sbin/userdel | |
31edeabf | 54 | Requires(pre): /bin/id |
1b68ade4 | 55 | Requires(pre): /usr/bin/getgid |
31edeabf JB |
56 | Requires(pre): /usr/sbin/groupadd |
57 | Requires(pre): /usr/sbin/useradd | |
9d96f8b2 | 58 | Requires: rc-scripts >= 0.4.2.8 |
abadc7c1 ER |
59 | # maybe is optional, needs checking |
60 | Suggests: GeoIP-db-City | |
61 | Suggests: GeoIP-db-IPASNum | |
62 | Suggests: ettercap | |
9d96f8b2 | 63 | Requires: ieee-oui |
1b68ade4 | 64 | Provides: group(ntop) |
65 | Provides: user(ntop) | |
3f97aafa AM |
66 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
67 | ||
1dced15e | 68 | %define _localstatedir /var/lib |
9e8c6481 | 69 | |
3f97aafa AM |
70 | %description |
71 | ntop is a tool that shows the network usage, similar to what the | |
72 | popular top Unix command does. | |
73 | ||
66d0b5be JR |
74 | %description -l pl.UTF-8 |
75 | ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak | |
5997acdb | 76 | robi to popularna uniksowa komenda top. |
3f97aafa AM |
77 | |
78 | %prep | |
8005772a | 79 | %setup -q |
1db42d64 | 80 | %patch0 -p1 |
32b74bbf | 81 | %patch1 -p1 |
fb745d9b | 82 | %patch2 -p1 |
abadc7c1 ER |
83 | %patch3 -p1 |
84 | %patch4 -p1 | |
8db4b37a ER |
85 | %patch5 -p1 |
86 | %patch6 -p1 | |
9d96f8b2 ER |
87 | %patch7 -p1 |
88 | ||
89 | rm oui.txt.gz | |
9e8c6481 | 90 | |
1c15e1a3 ER |
91 | # taken from autogen.sh |
92 | cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in | |
fb745d9b | 93 | cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4 |
3f97aafa AM |
94 | |
95 | %build | |
9e8c6481 | 96 | %{__libtoolize} |
8c73db90 | 97 | %{__aclocal} |
aa754682 | 98 | %{__autoconf} |
fb745d9b | 99 | %{__autoheader} |
5c8a70e7 | 100 | %{__automake} |
9e8c6481 | 101 | # "verified.awk -u" calls require gawk |
d4bb730c | 102 | %configure \ |
9e8c6481 JB |
103 | AWK=gawk \ |
104 | --disable-static \ | |
fe6022b1 | 105 | --with-gnu-ld \ |
9e8c6481 | 106 | --with-ossl-root=%{_prefix} \ |
fb745d9b | 107 | --with-tcpwrap \ |
f9d989ae | 108 | --enable-snmp \ |
fb745d9b | 109 | %{?with_mysql:--enable-mysql} |
8597cd3b | 110 | |
593fe373 | 111 | %{__make} |
3f97aafa AM |
112 | |
113 | %install | |
9eec0d7a | 114 | rm -rf $RPM_BUILD_ROOT |
1dced15e | 115 | install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}} |
3f97aafa | 116 | |
fe6022b1 | 117 | %{__make} install \ |
abadc7c1 | 118 | GEOIP_FILES= \ |
9d96f8b2 | 119 | OUI_FILES= \ |
abadc7c1 | 120 | ETTER_PASSIVE= \ |
fe6022b1 | 121 | DESTDIR=$RPM_BUILD_ROOT |
8597cd3b | 122 | |
abadc7c1 ER |
123 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop |
124 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop | |
125 | cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf | |
81772bff | 126 | |
f9d989ae ER |
127 | # these are identical files according to find-debuginfo |
128 | for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do | |
129 | ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so | |
130 | done | |
131 | ||
19d05b6c | 132 | ln -s %{_datadir}/oui.txt $RPM_BUILD_ROOT%{_sysconfdir}/ntop/oui.txt |
9d96f8b2 | 133 | |
8005772a ER |
134 | # no -devel |
135 | rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la | |
c0b31d44 | 136 | |
3f97aafa | 137 | %clean |
215b65a5 | 138 | rm -rf $RPM_BUILD_ROOT |
3f97aafa | 139 | |
94207320 | 140 | %pre |
e5996737 | 141 | %groupadd -g 120 ntop |
1dced15e | 142 | %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop |
94207320 | 143 | |
ffc5999b | 144 | %post |
94207320 | 145 | /sbin/ldconfig |
146 | /sbin/chkconfig --add ntop | |
411f46d0 | 147 | %service ntop restart "ntop daemon" |
94207320 | 148 | |
149 | %preun | |
150 | if [ "$1" = "0" ]; then | |
411f46d0 | 151 | %service ntop stop |
b87b7487 | 152 | /sbin/chkconfig --del ntop |
94207320 | 153 | fi |
154 | ||
ffc5999b | 155 | %postun |
94207320 | 156 | /sbin/ldconfig |
157 | if [ "$1" = "0" ]; then | |
1b68ade4 | 158 | %userremove ntop |
159 | %groupremove ntop | |
94207320 | 160 | fi |
fe6022b1 | 161 | |
3f97aafa AM |
162 | %files |
163 | %defattr(644,root,root,755) | |
fd17b5c4 | 164 | %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ} |
f9d989ae ER |
165 | %attr(750,root,ntop) %dir %{_sysconfdir}/ntop |
166 | %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/ntop-cert.pem | |
9d96f8b2 | 167 | %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/oui.txt |
f9d989ae ER |
168 | %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/specialMAC.txt.gz |
169 | %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf | |
170 | %attr(754,root,root) /etc/rc.d/init.d/ntop | |
171 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop | |
172 | %attr(755,root,root) %{_sbindir}/ntop | |
8005772a | 173 | %attr(755,root,root) %{_libdir}/lib*.so |
2a2238a1 | 174 | %attr(755,root,root) %{_datadir}/%{name} |
041f4633 | 175 | %dir %{_libdir}/%{name} |
215b65a5 | 176 | %attr(755,root,root) %{_libdir}/%{name}/plugins |
f9d989ae ER |
177 | %{_mandir}/man8/ntop.8* |
178 | ||
179 | %attr(770,root,ntop) %dir %{_localstatedir}/ntop | |
180 | %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd |