]> git.pld-linux.org Git - packages/ntop.git/blob - ntop.spec
- two more patches from fc
[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 (ethernet vendor id file),
4 #   hwdata uses same file for example. url: http://linux.die.net/man/1/get-oui
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:  openssl-devel >= 0.9.7d
45 BuildRequires:  readline-devel >= 4.2
46 BuildRequires:  rpmbuild(macros) >= 1.268
47 BuildRequires:  rrdtool-devel >= 1.1.0
48 BuildRequires:  zlib-devel
49 Requires(post,postun):  /sbin/ldconfig
50 Requires(post,preun):   /sbin/chkconfig
51 Requires(postun):       /usr/sbin/groupdel
52 Requires(postun):       /usr/sbin/userdel
53 Requires(pre):  /bin/id
54 Requires(pre):  /usr/bin/getgid
55 Requires(pre):  /usr/sbin/groupadd
56 Requires(pre):  /usr/sbin/useradd
57 Requires:       rc-scripts
58 # maybe is optional, needs checking
59 Suggests:       GeoIP-db-City
60 Suggests:       GeoIP-db-IPASNum
61 Suggests:       ettercap
62 Provides:       group(ntop)
63 Provides:       user(ntop)
64 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65
66 %define         _localstatedir          /var/lib
67
68 %description
69 ntop is a tool that shows the network usage, similar to what the
70 popular top Unix command does.
71
72 %description -l pl.UTF-8
73 ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak
74 robi to popularna uniksowa komenda top.
75
76 %prep
77 %setup -q
78 %patch0 -p1
79 %patch1 -p1
80 %patch2 -p1
81 %patch3 -p1
82 %patch4 -p1
83 %patch5 -p1
84 %patch6 -p1
85
86 # taken from autogen.sh
87 cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in
88 cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4
89
90 %build
91 %{__libtoolize}
92 %{__aclocal}
93 %{__autoconf}
94 %{__autoheader}
95 %{__automake}
96 # "verified.awk -u" calls require gawk
97 %configure \
98         AWK=gawk \
99         --disable-static \
100         --with-gnu-ld \
101         --with-ossl-root=%{_prefix} \
102         --with-tcpwrap \
103         %{?with_mysql:--enable-mysql}
104
105 %{__make}
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109 install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}}
110
111 %{__make} install \
112         GEOIP_FILES= \
113         ETTER_PASSIVE= \
114         DESTDIR=$RPM_BUILD_ROOT
115
116 install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
117 cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
118 cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf
119
120 # no -devel
121 rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %pre
127 %groupadd -g 120 ntop
128 %useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop
129
130 %post
131 /sbin/ldconfig
132 /sbin/chkconfig --add ntop
133 %service ntop restart "ntop daemon"
134
135 %preun
136 if [ "$1" = "0" ]; then
137         %service ntop stop
138         /sbin/chkconfig --del ntop
139 fi
140
141 %postun
142 /sbin/ldconfig
143 if [ "$1" = "0" ]; then
144         %userremove ntop
145         %groupremove ntop
146 fi
147
148 %files
149 %defattr(644,root,root,755)
150 %doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ}
151 %attr(770,root,ntop) %dir %{_localstatedir}/ntop
152 %attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd
153 %attr(755,root,root) %{_sbindir}/*
154 %attr(755,root,root) %{_libdir}/lib*.so
155 %attr(755,root,root) %{_datadir}/%{name}
156 %dir %{_libdir}/%{name}
157 %attr(755,root,root) %{_libdir}/%{name}/plugins
158 %{_mandir}/man*/*
159 %attr(754,root,root) /etc/rc.d/init.d/ntop
160 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop
161 %attr(750,root,ntop) %dir %{_sysconfdir}/ntop
162 %attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/*
163 %attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf
This page took 0.031918 seconds and 3 git commands to generate.