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