2 # there is a problem with --localstatedir=%{_var}/lib/%{name} (not building)
4 Summary: Network monitoring tool
5 Summary(pl): Narzêdzie do monitorowania sieci
11 Source0: http://dl.sourceforge.net/ntop/%{name}-%{version}.tgz
12 # Source0-md5: 1c9b4097c2e464b84f2fe8f6626d2b06
14 Source2: %{name}.sysconfig
15 Patch1: %{name}-plugins_makefile.patch
16 Patch2: %{name}-conf.patch
17 URL: http://www.ntop.org/
18 BuildRequires: autoconf
19 BuildRequires: automake
20 BuildRequires: gd-devel >= 2.0.1
21 BuildRequires: gdbm-devel >= 1.8.3
22 BuildRequires: libpcap-devel
23 BuildRequires: libpng-devel
24 BuildRequires: libtiff-devel
25 BuildRequires: libwrap-devel
26 BuildRequires: libtool
27 BuildRequires: ncurses-devel >= 5.2
28 BuildRequires: openssl-devel >= 0.9.7d
29 BuildRequires: readline-devel >= 4.2
30 BuildRequires: rpmbuild(macros) >= 1.159
31 BuildRequires: zlib-devel
33 Requires(pre): /bin/id
34 Requires(pre): /usr/bin/getgid
35 Requires(pre): /usr/sbin/groupadd
36 Requires(pre): /usr/sbin/useradd
37 Requires(post,preun): /sbin/chkconfig
38 Requires(post,postun): /sbin/ldconfig
39 Requires(postun): /usr/sbin/groupdel
40 Requires(postun): /usr/sbin/userdel
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 ntop is a tool that shows the network usage, similar to what the
47 popular top Unix command does.
50 ntop to narzêdzie, które pokazuje u¿ycie sieci w podobny sposób jak
51 robi to popularna uniksowa komenda top.
59 #mv -f acinclude.m4.in acinclude.m4
66 --with-ossl-root=%{_prefix} \
67 --with-gdchart-root=`pwd`/../gdchart0.94c \
72 --localstatedir=%{_var}/lib/%{name} || true
75 --with-ossl-root=%{_prefix} \
76 --with-gdchart-root=`pwd`/../gdchart0.94c \
79 --localstatedir=%{_var}/lib/%{name}
87 rm -rf $RPM_BUILD_ROOT
88 install -d $RPM_BUILD_ROOT{%{_var}/lib/%{name},/etc/{rc.d/init.d,sysconfig}}
91 DESTDIR=$RPM_BUILD_ROOT
93 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
94 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
95 install packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT/etc/ntop.conf
97 mv $RPM_BUILD_ROOT%{_libdir}/lib*Plugin*.so $RPM_BUILD_ROOT%{_libdir}/%{name}/plugins
98 rm $RPM_BUILD_ROOT%{_libdir}/*.a
101 rm -rf $RPM_BUILD_ROOT
104 if [ -n "`/usr/bin/getgid ntop`" ]; then
105 if [ "`/usr/bin/getgid ntop`" != "120" ]; then
106 echo "Error: group ntop doesn't have gid=120. Correct this before installing ntop." 1>&2
110 /usr/sbin/groupadd -g 120 ntop
112 if [ -n "`/bin/id -u ntop 2>/dev/null`" ]; then
113 if [ "`/bin/id -u ntop`" != "120" ]; then
114 echo "Error: user ntop doesn't have uid=120. Correct this before installing ntop." 1>&2
118 /usr/sbin/useradd -u 120 -d /var/lib/ntop -s /bin/false \
119 -c "ntop User" -g ntop ntop 1>&2
124 /sbin/chkconfig --add ntop
125 if [ -f /var/lock/subsys/ntop ]; then
126 /etc/rc.d/init.d/ntop restart >&2
128 echo "Run \"/etc/rc.d/init.d/ntop start\" to start ntop daemon." >&2
132 if [ "$1" = "0" ]; then
133 if [ -f /var/lock/subsys/ntop ]; then
134 /etc/rc.d/init.d/ntop stop 1>&2
136 /sbin/chkconfig --del ntop
141 if [ "$1" = "0" ]; then
147 %defattr(644,root,root,755)
148 %doc AUTHORS ChangeLog NEWS README THANKS
149 %attr(770,root,ntop) %dir %{_var}/lib/%{name}
150 %attr(755,root,root) %{_bindir}/*
151 %attr(755,root,root) %{_libdir}/lib*
152 %attr(755,root,root) %{_datadir}/%{name}
153 %dir %{_libdir}/%{name}
154 %attr(755,root,root) %{_libdir}/%{name}/plugins
156 %attr(754,root,root) /etc/rc.d/init.d/ntop
157 %attr(640,root,root) /etc/sysconfig/ntop
158 %attr(750,root,ntop) %dir /etc/ntop
159 %attr(640,root,ntop) %config(noreplace) %verify(not size mtime md5) /etc/ntop/*
160 %attr(644,root,ntop) %config(noreplace) %verify(not size mtime md5) /etc/ntop.conf