]> git.pld-linux.org Git - packages/ntop.git/blobdiff - ntop.spec
- two more patches from fc
[packages/ntop.git] / ntop.spec
index b9db3c870986f83891fccb839c7c189db9c5e11b..7bcef49848e06a543bdba698f81615730882bece 100644 (file)
--- a/ntop.spec
+++ b/ntop.spec
-%define        snap    01-03-26
+# TODO
+# - see if it uses system files for ettercap and geoip files we did not package
+# - see if /etc/ntop/oui.txt.gz can be externalized (ethernet vendor id file),
+#   hwdata uses same file for example. url: http://linux.die.net/man/1/get-oui
+#
+# Conditional build:
+%bcond_with    mysql   # with mysql support
+
 Summary:       Network monitoring tool
-Summary(pl):   Narzêdzie do monitorowania sieci
+Summary(pl.UTF-8):     Narzędzie do monitorowania sieci
 Name:          ntop
-Version:       1.3.2
-Release:       2.%(echo %{snap} | sed -e "s/-//g")
+Version:       3.3.10
+Release:       3
 License:       GPL
 Group:         Networking
-Group(de):     Netzwerkwesen
-Group(pl):     Sieciowe
-Source0:       http://snapshot.ntop.org/tgz/%{name}-%{snap}.tgz
-Source1:       %{name}-acinclude.m4
-Patch0:                %{name}-configure.patch
-Patch1:                %{name}-externallib.patch
-Patch2:                %{name}-perl.patch
+Source0:       http://downloads.sourceforge.net/ntop/%{name}-%{version}.tar.gz
+# Source0-md5: 6e2ffa90d5f935c8f03d88a5dd19a866
+Source1:       %{name}.init
+Source2:       %{name}.sysconfig
+Patch0:                %{name}-conf.patch
+Patch1:                %{name}-config.patch
+Patch2:                %{name}-am.patch
+Patch3:                %{name}-lua_wget.patch
+Patch4:                %{name}-geoip.patch
+Patch5:                %{name}-http_c.patch
+Patch6:                %{name}-running-user.patch
 URL:           http://www.ntop.org/
+BuildRequires: GeoIP-devel
 BuildRequires: autoconf
-BuildRequires: automake
-BuildRequires: gd-devel >= 1.8.2
-BuildRequires: gdbm-devel
+BuildRequires: automake >= 1.6
+BuildRequires: gawk
+BuildRequires: gd-devel >= 2.0.1
+BuildRequires: gdbm-devel >= 1.8.3
+BuildRequires: gdome2-devel
+BuildRequires: glib2-devel
+BuildRequires: libevent-devel >= 1.4.0
 BuildRequires: libpcap-devel
 BuildRequires: libpng-devel
-BuildRequires: libwrap-devel
+BuildRequires: libtiff-devel
 BuildRequires: libtool
+BuildRequires: libwrap-devel
+BuildRequires: lua51-devel
 BuildRequires: ncurses-devel >= 5.2
-BuildRequires: openssl-devel >= 0.9.6a
+BuildRequires: openssl-devel >= 0.9.7d
 BuildRequires: readline-devel >= 4.2
-BuildRequires: ucd-snmp-devel
+BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rrdtool-devel >= 1.1.0
 BuildRequires: zlib-devel
+Requires(post,postun): /sbin/ldconfig
+Requires(post,preun):  /sbin/chkconfig
+Requires(postun):      /usr/sbin/groupdel
+Requires(postun):      /usr/sbin/userdel
+Requires(pre): /bin/id
+Requires(pre): /usr/bin/getgid
+Requires(pre): /usr/sbin/groupadd
+Requires(pre): /usr/sbin/useradd
+Requires:      rc-scripts
+# maybe is optional, needs checking
+Suggests:      GeoIP-db-City
+Suggests:      GeoIP-db-IPASNum
+Suggests:      ettercap
+Provides:      group(ntop)
+Provides:      user(ntop)
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                _localstatedir          /var/lib
+
 %description
 ntop is a tool that shows the network usage, similar to what the
 popular top Unix command does.
 
-%description -l pl
-ntop to narzêdzie, które pokazuje u¿ycie sieci w podobny sposób jak
-robi to popularna Unixowa komenda top.
+%description -l pl.UTF-8
+ntop to narzędzie, które pokazuje użycie sieci w podobny sposób jak
+robi to popularna uniksowa komenda top.
 
 %prep
-%setup -q -n %{name}-current
-cd %{name}*
-rm -f missing ltconfig
+%setup -q
 %patch0 -p1
-%patch2 -p1
-cd ../gdchart*
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
+%patch6 -p1
 
-%build
-cd gdchart*
-rm -rf gd-* zlib-*
-libtoolize --copy --force
-aclocal
-autoconf
-%configure
-%{__make}
+# taken from autogen.sh
+cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in
+cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4
 
-cd ../%{name}*
-install %{SOURCE1} acinclude.m4
-libtoolize --copy --force
-aclocal
-autoconf
-automake -a -c
+%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+# "verified.awk -u" calls require gawk
 %configure \
-       --with-gdchart-root=../gdchart0.94c \
-       --with-ossl-root=%{_prefix} \
-       --enable-tcpwrap \
+       AWK=gawk \
+       --disable-static \
        --with-gnu-ld \
-       --localstatedir=%{_var}/%{ntop}
-       
+       --with-ossl-root=%{_prefix} \
+       --with-tcpwrap \
+       %{?with_mysql:--enable-mysql}
+
 %{__make}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-cd %{name}*
-install -d     $RPM_BUILD_ROOT%{_var}/%{name}
+install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}}
 
 %{__make} install \
+       GEOIP_FILES= \
+       ETTER_PASSIVE= \
        DESTDIR=$RPM_BUILD_ROOT
-       
-mv $RPM_BUILD_ROOT%{_bindir}/*.pem     $RPM_BUILD_ROOT%{_datadir}/%{name}
 
-gzip -9nf AUTHORS NEWS README THANKS
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop
+cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop
+cp -a packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf
+
+# no -devel
+rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post   -p /sbin/ldconfig
-%postun -p /sbin/ldconfig
+%pre
+%groupadd -g 120 ntop
+%useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop
+
+%post
+/sbin/ldconfig
+/sbin/chkconfig --add ntop
+%service ntop restart "ntop daemon"
+
+%preun
+if [ "$1" = "0" ]; then
+       %service ntop stop
+       /sbin/chkconfig --del ntop
+fi
+
+%postun
+/sbin/ldconfig
+if [ "$1" = "0" ]; then
+       %userremove ntop
+       %groupremove ntop
+fi
 
 %files
 %defattr(644,root,root,755)
-%doc */*.gz
-%dir %{_var}/%{name}
-%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
-%attr(755,root,root) %{_libdir}/lib*.la
+%doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ}
+%attr(770,root,ntop) %dir %{_localstatedir}/ntop
+%attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd
+%attr(755,root,root) %{_sbindir}/*
+%attr(755,root,root) %{_libdir}/lib*.so
+%attr(755,root,root) %{_datadir}/%{name}
 %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) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ntop
+%attr(750,root,ntop) %dir %{_sysconfdir}/ntop
+%attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/*
+%attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf
This page took 0.097675 seconds and 4 git commands to generate.