]>
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 |
b0bef586 ER |
4 | # - unpackaged |
5 | # /etc/ntop/GeoIPASNum.dat | |
6 | # /etc/ntop/GeoLiteCity.dat | |
7 | # /usr/lib64/libntop.a | |
8 | # /usr/lib64/libntopreport.a | |
80a56caa | 9 | # NOTE: can read oui.txt.xz if MAKE_WITH_ZLIB enabled |
1c15e1a3 | 10 | |
3f97aafa | 11 | Summary: Network monitoring tool |
e89446b9 | 12 | Summary(pl.UTF-8): Narzędzie do monitorowania sieci |
3f97aafa | 13 | Name: ntop |
4b11e15f | 14 | Version: 5.0.1 |
ef651793 | 15 | Release: 9 |
a62aca02 | 16 | License: GPL v3+ |
9eec0d7a | 17 | Group: Networking |
ee59f5dc | 18 | Source0: http://downloads.sourceforge.net/ntop/%{name}-%{version}.tar.gz |
4b11e15f | 19 | # Source0-md5: 01710b6925a8a5ffe1a41b8b512ebd69 |
81772bff | 20 | Source1: %{name}.init |
21 | Source2: %{name}.sysconfig | |
24ab7c00 JR |
22 | # http://ettercap.cvs.sourceforge.net/ettercap/ettercap_ng/share/etter.finger.os?rev=HEAD |
23 | Source3: etter.finger.os | |
fb745d9b | 24 | Patch0: %{name}-conf.patch |
25 | Patch1: %{name}-config.patch | |
26 | Patch2: %{name}-am.patch | |
abadc7c1 | 27 | Patch3: %{name}-lua_wget.patch |
a62aca02 | 28 | Patch4: %{name}-http_c.patch |
29 | Patch5: %{name}-running-user.patch | |
30 | Patch6: ieee-oui.patch | |
31 | Patch7: %{name}-install.patch | |
4b11e15f | 32 | Patch8: %{name}-rrdtool-1.6.0.patch |
a8fcc5a6 | 33 | Patch9: ac-am.patch |
3f97aafa | 34 | URL: http://www.ntop.org/ |
1c15e1a3 | 35 | BuildRequires: GeoIP-devel |
31b46f6f | 36 | BuildRequires: autoconf >= 2.52 |
fd17b5c4 | 37 | BuildRequires: automake >= 1.6 |
9e8c6481 | 38 | BuildRequires: gawk |
8aa70f00 | 39 | BuildRequires: gdbm-devel >= 1.8.3 |
3f97aafa | 40 | BuildRequires: libpcap-devel |
03329ce3 | 41 | BuildRequires: libtool |
f9d989ae | 42 | BuildRequires: net-snmp-devel |
6ebc82ab | 43 | BuildRequires: openssl-devel >= 0.9.7d |
7318b900 | 44 | BuildRequires: perl-devel |
ac58c465 | 45 | BuildRequires: rpm-pythonprov |
411f46d0 | 46 | BuildRequires: rpmbuild(macros) >= 1.268 |
fd17b5c4 | 47 | BuildRequires: rrdtool-devel >= 1.1.0 |
b0bef586 | 48 | BuildRequires: sed >= 4.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 | |
80a56caa | 58 | Requires: hwdata >= 0.243-2 |
dff01925 | 59 | Requires: rc-scripts >= 0.4.2.8 |
3f396d9b | 60 | # maybe is optional, needs checking |
abadc7c1 ER |
61 | Suggests: GeoIP-db-City |
62 | Suggests: GeoIP-db-IPASNum | |
63 | Suggests: ettercap | |
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 | 87 | %patch7 -p1 |
2d7d42cb | 88 | %patch8 -p1 |
a8fcc5a6 | 89 | %patch9 -p1 |
b0bef586 | 90 | |
24ab7c00 JR |
91 | gzip -9c %{SOURCE3} >etter.finger.os.gz |
92 | ||
1c15e1a3 ER |
93 | # taken from autogen.sh |
94 | cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in | |
fb745d9b | 95 | cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4 |
3f97aafa | 96 | |
31b46f6f JB |
97 | %{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' python/sankey.py |
98 | ||
3f97aafa | 99 | %build |
9e8c6481 | 100 | %{__libtoolize} |
8c73db90 | 101 | %{__aclocal} |
aa754682 | 102 | %{__autoconf} |
fb745d9b | 103 | %{__autoheader} |
5c8a70e7 | 104 | %{__automake} |
4b11e15f JR |
105 | |
106 | cd nDPI | |
107 | %configure | |
108 | %{__make} | |
109 | cd .. | |
110 | ||
9e8c6481 | 111 | # "verified.awk -u" calls require gawk |
d4bb730c | 112 | %configure \ |
9e8c6481 JB |
113 | AWK=gawk \ |
114 | --disable-static \ | |
fe6022b1 | 115 | --with-gnu-ld \ |
9e8c6481 | 116 | --with-ossl-root=%{_prefix} \ |
31b46f6f | 117 | --enable-snmp |
8597cd3b | 118 | |
593fe373 | 119 | %{__make} |
3f97aafa AM |
120 | |
121 | %install | |
9eec0d7a | 122 | rm -rf $RPM_BUILD_ROOT |
1dced15e | 123 | install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}} |
3f97aafa | 124 | |
fe6022b1 | 125 | %{__make} install \ |
abadc7c1 | 126 | GEOIP_FILES= \ |
9d96f8b2 | 127 | OUI_FILES= \ |
abadc7c1 | 128 | ETTER_PASSIVE= \ |
fe6022b1 | 129 | DESTDIR=$RPM_BUILD_ROOT |
8597cd3b | 130 | |
abadc7c1 ER |
131 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop |
132 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop | |
133 | cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf | |
81772bff | 134 | |
f9d989ae ER |
135 | # these are identical files according to find-debuginfo |
136 | for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do | |
137 | ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so | |
138 | done | |
139 | ||
80a56caa ER |
140 | # read by checkForInputFile() scanning various dirs and extensions |
141 | ln -s /lib/hwdata/oui.txt $RPM_BUILD_ROOT%{_sysconfdir}/ntop/oui.txt | |
9d96f8b2 | 142 | |
8005772a ER |
143 | # no -devel |
144 | rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la | |
c0b31d44 | 145 | |
3f97aafa | 146 | %clean |
215b65a5 | 147 | rm -rf $RPM_BUILD_ROOT |
3f97aafa | 148 | |
94207320 | 149 | %pre |
e5996737 | 150 | %groupadd -g 120 ntop |
1dced15e | 151 | %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop |
94207320 | 152 | |
ffc5999b | 153 | %post |
94207320 | 154 | /sbin/ldconfig |
155 | /sbin/chkconfig --add ntop | |
411f46d0 | 156 | %service ntop restart "ntop daemon" |
94207320 | 157 | |
158 | %preun | |
159 | if [ "$1" = "0" ]; then | |
411f46d0 | 160 | %service ntop stop |
b87b7487 | 161 | /sbin/chkconfig --del ntop |
94207320 | 162 | fi |
163 | ||
ffc5999b | 164 | %postun |
94207320 | 165 | /sbin/ldconfig |
166 | if [ "$1" = "0" ]; then | |
1b68ade4 | 167 | %userremove ntop |
168 | %groupremove ntop | |
94207320 | 169 | fi |
fe6022b1 | 170 | |
3f97aafa AM |
171 | %files |
172 | %defattr(644,root,root,755) | |
fd17b5c4 | 173 | %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ} |
f9d989ae ER |
174 | %attr(750,root,ntop) %dir %{_sysconfdir}/ntop |
175 | %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/ntop-cert.pem | |
9d96f8b2 | 176 | %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/oui.txt |
f9d989ae ER |
177 | %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/specialMAC.txt.gz |
178 | %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf | |
179 | %attr(754,root,root) /etc/rc.d/init.d/ntop | |
180 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop | |
181 | %attr(755,root,root) %{_sbindir}/ntop | |
8005772a | 182 | %attr(755,root,root) %{_libdir}/lib*.so |
2a2238a1 | 183 | %attr(755,root,root) %{_datadir}/%{name} |
041f4633 | 184 | %dir %{_libdir}/%{name} |
215b65a5 | 185 | %attr(755,root,root) %{_libdir}/%{name}/plugins |
f9d989ae ER |
186 | %{_mandir}/man8/ntop.8* |
187 | ||
188 | %attr(770,root,ntop) %dir %{_localstatedir}/ntop | |
189 | %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd |