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