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