]>
Commit | Line | Data |
---|---|---|
fb745d9b | 1 | # |
8f8442a4 | 2 | # Conditional build: |
fb745d9b | 3 | %bcond_with mysql # with mysql support |
4 | # | |
3f97aafa | 5 | Summary: Network monitoring tool |
e89446b9 | 6 | Summary(pl.UTF-8): Narzędzie do monitorowania sieci |
3f97aafa | 7 | Name: ntop |
f839ee23 | 8 | Version: 3.3.10 |
a7d85197 | 9 | Release: 2 |
3f97aafa | 10 | License: GPL |
9eec0d7a | 11 | Group: Networking |
d41c3295 | 12 | Source0: http://dl.sourceforge.net/ntop/%{name}-%{version}.tar.gz |
f839ee23 | 13 | # Source0-md5: 6e2ffa90d5f935c8f03d88a5dd19a866 |
81772bff | 14 | Source1: %{name}.init |
15 | Source2: %{name}.sysconfig | |
fb745d9b | 16 | Patch0: %{name}-conf.patch |
17 | Patch1: %{name}-config.patch | |
18 | Patch2: %{name}-am.patch | |
3f97aafa | 19 | URL: http://www.ntop.org/ |
03329ce3 | 20 | BuildRequires: autoconf |
fd17b5c4 | 21 | BuildRequires: automake >= 1.6 |
9e8c6481 | 22 | BuildRequires: gawk |
23c07473 | 23 | BuildRequires: gd-devel >= 2.0.1 |
8aa70f00 | 24 | BuildRequires: gdbm-devel >= 1.8.3 |
26a5ca45 ER |
25 | BuildRequires: gdome2-devel |
26 | BuildRequires: glib2-devel | |
f839ee23 | 27 | BuildRequires: libevent-devel >= 1.4.0 |
3f97aafa | 28 | BuildRequires: libpcap-devel |
03329ce3 | 29 | BuildRequires: libpng-devel |
ad718851 | 30 | BuildRequires: libtiff-devel |
03329ce3 | 31 | BuildRequires: libtool |
9e8c6481 | 32 | BuildRequires: libwrap-devel |
75909d05 | 33 | BuildRequires: ncurses-devel >= 5.2 |
6ebc82ab | 34 | BuildRequires: openssl-devel >= 0.9.7d |
75909d05 | 35 | BuildRequires: readline-devel >= 4.2 |
e5996737 | 36 | BuildRequires: rpmbuild(macros) >= 1.202 |
411f46d0 | 37 | BuildRequires: rpmbuild(macros) >= 1.268 |
fd17b5c4 | 38 | BuildRequires: rrdtool-devel >= 1.1.0 |
fe6022b1 | 39 | BuildRequires: zlib-devel |
8005772a ER |
40 | Requires(post,postun): /sbin/ldconfig |
41 | Requires(post,preun): /sbin/chkconfig | |
42 | Requires(postun): /usr/sbin/groupdel | |
43 | Requires(postun): /usr/sbin/userdel | |
31edeabf | 44 | Requires(pre): /bin/id |
1b68ade4 | 45 | Requires(pre): /usr/bin/getgid |
31edeabf JB |
46 | Requires(pre): /usr/sbin/groupadd |
47 | Requires(pre): /usr/sbin/useradd | |
8005772a | 48 | Requires: rc-scripts |
1b68ade4 | 49 | Provides: group(ntop) |
50 | Provides: user(ntop) | |
3f97aafa AM |
51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
52 | ||
1dced15e | 53 | %define _localstatedir /var/lib |
9e8c6481 | 54 | |
3f97aafa AM |
55 | %description |
56 | ntop is a tool that shows the network usage, similar to what the | |
57 | popular top Unix command does. | |
58 | ||
66d0b5be JR |
59 | %description -l pl.UTF-8 |
60 | ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak | |
5997acdb | 61 | robi to popularna uniksowa komenda top. |
3f97aafa AM |
62 | |
63 | %prep | |
8005772a | 64 | %setup -q |
1db42d64 | 65 | %patch0 -p1 |
32b74bbf | 66 | %patch1 -p1 |
fb745d9b | 67 | %patch2 -p1 |
9e8c6481 | 68 | |
fb745d9b | 69 | # taken from autogen.sh |
70 | cp -f /usr/share/aclocal/libtool.m4 libtool.m4.in | |
71 | cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4 | |
3f97aafa AM |
72 | |
73 | %build | |
9e8c6481 | 74 | %{__libtoolize} |
8c73db90 | 75 | %{__aclocal} |
aa754682 | 76 | %{__autoconf} |
fb745d9b | 77 | %{__autoheader} |
5c8a70e7 | 78 | %{__automake} |
9e8c6481 | 79 | # "verified.awk -u" calls require gawk |
d4bb730c | 80 | %configure \ |
9e8c6481 JB |
81 | AWK=gawk \ |
82 | --disable-static \ | |
fe6022b1 | 83 | --with-gnu-ld \ |
9e8c6481 | 84 | --with-ossl-root=%{_prefix} \ |
fb745d9b | 85 | --with-tcpwrap \ |
86 | %{?with_mysql:--enable-mysql} | |
8597cd3b | 87 | |
593fe373 | 88 | %{__make} |
3f97aafa AM |
89 | |
90 | %install | |
9eec0d7a | 91 | rm -rf $RPM_BUILD_ROOT |
1dced15e | 92 | install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}} |
3f97aafa | 93 | |
fe6022b1 AM |
94 | %{__make} install \ |
95 | DESTDIR=$RPM_BUILD_ROOT | |
8597cd3b | 96 | |
81772bff | 97 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop |
98 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop | |
8005772a | 99 | install packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf |
81772bff | 100 | |
8005772a ER |
101 | # no -devel |
102 | rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la | |
c0b31d44 | 103 | |
3f97aafa | 104 | %clean |
215b65a5 | 105 | rm -rf $RPM_BUILD_ROOT |
3f97aafa | 106 | |
94207320 | 107 | %pre |
e5996737 | 108 | %groupadd -g 120 ntop |
1dced15e | 109 | %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop |
94207320 | 110 | |
ffc5999b | 111 | %post |
94207320 | 112 | /sbin/ldconfig |
113 | /sbin/chkconfig --add ntop | |
411f46d0 | 114 | %service ntop restart "ntop daemon" |
94207320 | 115 | |
116 | %preun | |
117 | if [ "$1" = "0" ]; then | |
411f46d0 | 118 | %service ntop stop |
b87b7487 | 119 | /sbin/chkconfig --del ntop |
94207320 | 120 | fi |
121 | ||
ffc5999b | 122 | %postun |
94207320 | 123 | /sbin/ldconfig |
124 | if [ "$1" = "0" ]; then | |
1b68ade4 | 125 | %userremove ntop |
126 | %groupremove ntop | |
94207320 | 127 | fi |
fe6022b1 | 128 | |
3f97aafa AM |
129 | %files |
130 | %defattr(644,root,root,755) | |
fd17b5c4 | 131 | %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ} |
1dced15e ER |
132 | %attr(770,root,ntop) %dir %{_localstatedir}/ntop |
133 | %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd | |
8005772a ER |
134 | %attr(755,root,root) %{_sbindir}/* |
135 | %attr(755,root,root) %{_libdir}/lib*.so | |
2a2238a1 | 136 | %attr(755,root,root) %{_datadir}/%{name} |
041f4633 | 137 | %dir %{_libdir}/%{name} |
215b65a5 | 138 | %attr(755,root,root) %{_libdir}/%{name}/plugins |
3f97aafa | 139 | %{_mandir}/man*/* |
31edeabf | 140 | %attr(754,root,root) /etc/rc.d/init.d/ntop |
8005772a ER |
141 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop |
142 | %attr(750,root,ntop) %dir %{_sysconfdir}/ntop | |
143 | %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/* | |
fd17b5c4 | 144 | %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf |