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