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