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