]> git.pld-linux.org Git - packages/ntop.git/blobdiff - ntop.spec
- spaces -> tabs
[packages/ntop.git] / ntop.spec
index 3139f298698ef68fbc1b1a6228850c75a10b38e9..f7f73c2ad470d522dec5378a26ce8846c91f415e 100644 (file)
--- a/ntop.spec
+++ b/ntop.spec
@@ -1,31 +1,41 @@
-%define        snap    01-03-26
 Summary:       Network monitoring tool
 Summary(pl):   Narzêdzie do monitorowania sieci
 Name:          ntop
-Version:       1.3.2
-Release:       0.%(echo %{snap} | sed -e "s/-//g")
+Version:       3.0
+Release:       0.2
 License:       GPL
 Group:         Networking
-Group(de):     Netzwerkwesen
-Group(pl):     Sieciowe
-Source0:       http://snapshot.ntop.org/tgz/%{name}-%{snap}.tgz
-Patch0:                %{name}-configure.patch
+Source0:       http://dl.sourceforge.net/ntop/%{name}-%{version}.tgz
+# Source0-md5: 1ec6055c75f1acbb5d5600492481ef85
+Source1:       %{name}.init
+Source2:       %{name}.sysconfig
+Source3:       %{name}.conf
+Patch0:                %{name}-acam.patch
 Patch1:                %{name}-externallib.patch
 Patch2:                %{name}-perl.patch
 URL:           http://www.ntop.org/
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: gd-devel >= 2.0.1
+BuildRequires: gdbm-devel >= 1.8.3
 BuildRequires: libpcap-devel
-BuildRequires: libwrap-devel
-BuildRequires: ncurses-devel
-BuildRequires: readline-devel
-BuildRequires: openssl-devel
-BuildRequires: ucd-snmp-devel
-BuildRequires: gd-devel >= 1.8.2
-BuildRequires: gdbm-devel
 BuildRequires: libpng-devel
-BuildRequires: zlib-devel
+BuildRequires: libtiff-devel
+BuildRequires: libwrap-devel
 BuildRequires: libtool
-BuildRequires: automake
-BuildRequires: autoconf
+BuildRequires: ncurses-devel >= 5.2
+BuildRequires: openssl-devel >= 0.9.7d
+BuildRequires: readline-devel >= 4.2
+BuildRequires: zlib-devel
+PreReq:                rc-scripts
+Requires(pre): /usr/bin/getgid
+Requires(pre): /bin/id
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires(post,preun):  /sbin/chkconfig
+Requires(post,postun): /sbin/ldconfig
+Requires(postun):      /usr/sbin/groupdel
+Requires(postun):      /usr/sbin/userdel
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -37,63 +47,119 @@ ntop to narz
 robi to popularna Unixowa komenda top.
 
 %prep
-%setup -q -n %{name}-current
-cd %{name}*
-rm -f missing ltconfig
-%patch0 -p1
-%patch2 -p1
-cd ../gdchart*
-%patch1 -p1
+%setup -q
+#%%patch0 -p1
+#cd %{name}*
+#%%patch2 -p1
+#cd ../gdchart*
+#%%patch1 -p1
 
 %build
-cd gdchart*
-rm -rf gd-* zlib-*
-%configure
-%{__make}
+#cd gdchart*
+#rm -rf gd-* zlib-*
+#%%{__libtoolize}
+#%%{__aclocal}
+#%%{__autoconf}
+#%%configure
+#%%{__make}
 
-cd ../%{name}*
-libtoolize --copy --force
-automake -a -c -i
-autoheader
-aclocal
-autoconf
+#mv -f acinclude.m4.in acinclude.m4
+#rm -f missing
+#%%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__automake}
 %configure \
-       --with-gdchart-root=../gdchart0.94c \
        --with-ossl-root=%{_prefix} \
+       --with-gdchart-root=`pwd`/../gdchart0.94c \
        --enable-tcpwrap \
        --with-gnu-ld \
-       --localstatedir=%{_var}/%{ntop}
-       
+       --enable-i18n \
+       --enable-showoses \
+       --localstatedir=%{_var}/lib/%{name} || true
+
+%configure \
+       --with-ossl-root=%{_prefix} \
+       --with-gdchart-root=`pwd`/../gdchart0.94c \
+       --enable-tcpwrap \
+       --with-gnu-ld \
+       --localstatedir=%{_var}/lib/%{name}
+
+
+%{__make}
+cd plugins
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-cd %{name}*
-install -d     $RPM_BUILD_ROOT%{_var}/%{name}
+install -d     $RPM_BUILD_ROOT{%{_var}/lib/%{name},/etc/{rc.d/init.d,sysconfig}}
 
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
-       
-mv $RPM_BUILD_ROOT%{_bindir}/*.pem     $RPM_BUILD_ROOT%{_datadir}/%{name}
 
-gzip -9nf AUTHORS NEWS README THANKS
+#mv $RPM_BUILD_ROOT%{_bindir}/*.pem $RPM_BUILD_ROOT%{_datadir}/%{name}
+
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/ntop.conf
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post   -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%pre
+if [ -n "`getgid ntop`" ]; then
+       if [ "`getgid ntop`" != "120" ]; then
+               echo "Error: group ntop doesn't have gid=120. Correct this before installing ntop." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/groupadd -g 120 -r -f ntop
+fi
+if [ -n "`id -u ntop 2>/dev/null`" ]; then
+       if [ "`id -u ntop`" != "120" ]; then
+               echo "Error: user ntop doesn't have uid=120. Correct this before installing ntop." 1>&2
+               exit 1
+       fi
+else
+       /usr/sbin/useradd -u 120 -r -d /var/lib/ntop -s /bin/false -c "ntop User" -g ntop ntop 1>&2
+fi
+
+%post
+/sbin/ldconfig
+/sbin/chkconfig --add ntop
+if [ -f /var/lock/subsys/ntop ]; then
+       /etc/rc.d/init.d/ntop restart >&2
+else
+       echo "Run \"/etc/rc.d/init.d/ntop start\" to start ntop daemon." >&2
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+       if [ -f /var/lock/subsys/ntop ]; then
+               /etc/rc.d/init.d/ntop stop 1>&2
+       fi
+       /sbin/chkconfig --del ntop
+fi
+
+%postun
+/sbin/ldconfig
+if [ "$1" = "0" ]; then
+       /usr/sbin/userdel ntop
+       /usr/sbin/groupdel ntop
+fi
 
 %files
 %defattr(644,root,root,755)
-%doc */*.gz
-%dir %{_var}/%{name}
+%doc AUTHORS NEWS README THANKS
+#ntop/docs/1STRUN.TXT ntop/docs/FAQ
+%dir %{_var}/lib/%{name}
 %attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
-%attr(755,root,root) %{_libdir}/lib*.la
+%attr(755,root,root) %{_libdir}/lib*
+%attr(755,root,root) %{_datadir}/%{name}
+#%%{_libdir}/lib*.la
 %dir %{_libdir}/%{name}
-%dir %{_libdir}/%{name}/plugins
-%attr(755,root,root) %{_libdir}/%{name}/plugins/*.so*
-%attr(755,root,root) %{_libdir}/%{name}/plugins/*.la
-%{_datadir}/%{name}
+%attr(755,root,root) %{_libdir}/%{name}/plugins
 %{_mandir}/man*/*
+%attr(754,root,root) /etc/rc.d/init.d/ntop
+%attr(640,root,root) /etc/sysconfig/ntop
+%attr(644,ntop,ntop) %config(noreplace) %verify(not size mtime md5) /etc/ntop.conf
This page took 0.124118 seconds and 4 git commands to generate.