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