]> git.pld-linux.org Git - packages/ntop.git/blob - ntop.spec
- BR: perl-devel
[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:        3.3.10
12 Release:        4
13 License:        GPL
14 Group:          Networking
15 Source0:        http://downloads.sourceforge.net/ntop/%{name}-%{version}.tar.gz
16 # Source0-md5:  6e2ffa90d5f935c8f03d88a5dd19a866
17 Source1:        %{name}.init
18 Source2:        %{name}.sysconfig
19 Patch0:         %{name}-conf.patch
20 Patch1:         %{name}-config.patch
21 Patch2:         %{name}-am.patch
22 Patch3:         %{name}-lua_wget.patch
23 Patch4:         %{name}-geoip.patch
24 Patch5:         %{name}-http_c.patch
25 Patch6:         %{name}-running-user.patch
26 Patch7:         ieee-oui.patch
27 URL:            http://www.ntop.org/
28 BuildRequires:  GeoIP-devel
29 BuildRequires:  autoconf
30 BuildRequires:  automake >= 1.6
31 BuildRequires:  gawk
32 BuildRequires:  gd-devel >= 2.0.1
33 BuildRequires:  gdbm-devel >= 1.8.3
34 BuildRequires:  gdome2-devel
35 BuildRequires:  glib2-devel
36 BuildRequires:  libevent-devel >= 1.4.0
37 BuildRequires:  libpcap-devel
38 BuildRequires:  libpng-devel
39 BuildRequires:  libtiff-devel
40 BuildRequires:  libtool
41 BuildRequires:  libwrap-devel
42 BuildRequires:  lua51-devel
43 BuildRequires:  ncurses-devel >= 5.2
44 BuildRequires:  net-snmp-devel
45 BuildRequires:  openssl-devel >= 0.9.7d
46 BuildRequires:  perl-devel
47 BuildRequires:  readline-devel >= 4.2
48 BuildRequires:  rpmbuild(macros) >= 1.268
49 BuildRequires:  rrdtool-devel >= 1.1.0
50 BuildRequires:  zlib-devel
51 Requires(post,postun):  /sbin/ldconfig
52 Requires(post,preun):   /sbin/chkconfig
53 Requires(postun):       /usr/sbin/groupdel
54 Requires(postun):       /usr/sbin/userdel
55 Requires(pre):  /bin/id
56 Requires(pre):  /usr/bin/getgid
57 Requires(pre):  /usr/sbin/groupadd
58 Requires(pre):  /usr/sbin/useradd
59 Requires:       rc-scripts >= 0.4.2.8
60 # maybe is optional, needs checking
61 Suggests:       GeoIP-db-City
62 Suggests:       GeoIP-db-IPASNum
63 Suggests:       ettercap
64 Requires:       ieee-oui
65 Provides:       group(ntop)
66 Provides:       user(ntop)
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %define         _localstatedir          /var/lib
70
71 %description
72 ntop is a tool that shows the network usage, similar to what the
73 popular top Unix command does.
74
75 %description -l pl.UTF-8
76 ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak
77 robi to popularna uniksowa komenda top.
78
79 %prep
80 %setup -q
81 %patch0 -p1
82 %patch1 -p1
83 %patch2 -p1
84 %patch3 -p1
85 %patch4 -p1
86 %patch5 -p1
87 %patch6 -p1
88 %patch7 -p1
89
90 rm oui.txt.gz
91
92 # taken from autogen.sh
93 cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in
94 cat 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
115 rm -rf $RPM_BUILD_ROOT
116 install -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
124 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
125 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
126 cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf
127
128 # these are identical files according to find-debuginfo
129 for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do
130         ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so
131 done
132
133 ln -s %{_datadir}/oui.txt $RPM_BUILD_ROOT%{_sysconfdir}/ntop/oui.txt
134
135 # no -devel
136 rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la
137
138 %clean
139 rm -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
151 if [ "$1" = "0" ]; then
152         %service ntop stop
153         /sbin/chkconfig --del ntop
154 fi
155
156 %postun
157 /sbin/ldconfig
158 if [ "$1" = "0" ]; then
159         %userremove ntop
160         %groupremove ntop
161 fi
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.360635 seconds and 3 git commands to generate.