X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=ntop.spec;h=0aa444cd527939c135942802600cc27200b8f4f6;hb=24ab7c000859a80867cc69e18f28cb5602632ba2;hp=878fe0220551f5a82d9c79a2e9f389b709a2f162;hpb=26a5ca45b5184ed36fb25b77b9f8f28c41e7a5ad;p=packages%2Fntop.git diff --git a/ntop.spec b/ntop.spec index 878fe02..0aa444c 100644 --- a/ntop.spec +++ b/ntop.spec @@ -1,38 +1,56 @@ -# TODO: -# - paths wrong somewhere /var/lib/ntop/ntop is expected (should be without last path component) +# TODO +# - see if it uses system files for ettercap and geoip, ieee-oui files we did not package +# - see where plugins are needed in plugin dir or in system dir +# - fix init script (--redirdfs is bogus?) +# +# 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: 3.2 -Release: 0.7 -License: GPL +Version: 4.0.3 +Release: 0.1 +License: GPL v3+ Group: Networking -Source0: http://dl.sourceforge.net/ntop/%{name}-%{version}.tgz -# Source0-md5: cd29a876b34a7dd76555e9acd8f160bb +Source0: http://downloads.sourceforge.net/ntop/%{name}-%{version}.tgz +# Source0-md5: f064393a2090e5bda102cd49c2707789 Source1: %{name}.init Source2: %{name}.sysconfig -Patch0: %{name}-plugins_makefile.patch -Patch1: %{name}-conf.patch -Patch2: %{name}-nolibs.patch -Patch3: %{name}-config.patch -Patch4: %{name}-am.patch +# http://ettercap.cvs.sourceforge.net/ettercap/ettercap_ng/share/etter.finger.os?rev=HEAD +Source3: etter.finger.os +Patch0: %{name}-conf.patch +Patch1: %{name}-config.patch +Patch2: %{name}-am.patch +Patch3: %{name}-lua_wget.patch +Patch4: %{name}-http_c.patch +Patch5: %{name}-running-user.patch +Patch6: ieee-oui.patch +Patch7: %{name}-install.patch URL: http://www.ntop.org/ +BuildRequires: GeoIP-devel BuildRequires: autoconf -BuildRequires: automake +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: libdbi-devel +BuildRequires: libevent-devel >= 1.4.0 BuildRequires: libpcap-devel BuildRequires: libpng-devel BuildRequires: libtiff-devel BuildRequires: libtool BuildRequires: libwrap-devel +BuildRequires: lua51-devel BuildRequires: ncurses-devel >= 5.2 +BuildRequires: net-snmp-devel BuildRequires: openssl-devel >= 0.9.7d +BuildRequires: perl-devel BuildRequires: readline-devel >= 4.2 -BuildRequires: rpmbuild(macros) >= 1.202 +BuildRequires: rpmbuild(macros) >= 1.268 +BuildRequires: rrdtool-devel >= 1.1.0 BuildRequires: zlib-devel Requires(post,postun): /sbin/ldconfig Requires(post,preun): /sbin/chkconfig @@ -42,19 +60,24 @@ Requires(pre): /bin/id Requires(pre): /usr/bin/getgid Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd -Requires: rc-scripts +Requires: ieee-oui +Requires: rc-scripts >= 0.4.2.8 +# 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/ntop +%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 +%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 @@ -64,36 +87,54 @@ robi to popularna uniksowa komenda top. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 + +gzip -9c %{SOURCE3} >etter.finger.os.gz -# kill libtool.m4 copy -cp -f acinclude.m4.ntop acinclude.m4 +# taken from autogen.sh +cp -f %{_aclocaldir}/libtool.m4 libtool.m4.in +cat acinclude.m4.in libtool.m4.in acinclude.m4.ntop > acinclude.m4 %build %{__libtoolize} %{__aclocal} %{__autoconf} +%{__autoheader} %{__automake} # "verified.awk -u" calls require gawk %configure \ AWK=gawk \ --disable-static \ - --enable-i18n \ --with-gnu-ld \ --with-ossl-root=%{_prefix} \ - --with-tcpwrap + --with-tcpwrap \ + --enable-snmp \ + %{?with_mysql:--enable-mysql} %{__make} %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT{%{_localstatedir},/etc/{rc.d/init.d,sysconfig},%{_sbindir}} +install -d $RPM_BUILD_ROOT{%{_localstatedir}/ntop/rrd,/etc/{rc.d/init.d,sysconfig},%{_sbindir}} %{__make} install \ + GEOIP_FILES= \ + OUI_FILES= \ + ETTER_PASSIVE= \ DESTDIR=$RPM_BUILD_ROOT -install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/ntop -install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/ntop -install packages/RedHat/ntop.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/ntop.conf +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 + +# these are identical files according to find-debuginfo +for p in icmpPlugin lastSeenPlugin netflowPlugin cpacketPlugin rrdPlugin sflowPlugin; do + ln -snf ../../lib$p-%{version}.so $RPM_BUILD_ROOT%{_libdir}/ntop/plugins/$p.so +done + +ln -s %{_datadir}/oui.txt $RPM_BUILD_ROOT%{_sysconfdir}/ntop/oui.txt # no -devel rm -f $RPM_BUILD_ROOT%{_libdir}{,/ntop/plugins}/*.la @@ -103,22 +144,16 @@ rm -rf $RPM_BUILD_ROOT %pre %groupadd -g 120 ntop -%useradd -u 120 -d %{_localstatedir} -s /bin/false -c "ntop User" -g ntop ntop +%useradd -u 120 -d %{_localstatedir}/ntop -s /bin/false -c "ntop User" -g ntop ntop %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 +%service ntop restart "ntop daemon" %preun if [ "$1" = "0" ]; then - if [ -f /var/lock/subsys/ntop ]; then - /etc/rc.d/init.d/ntop stop 1>&2 - fi + %service ntop stop /sbin/chkconfig --del ntop fi @@ -131,16 +166,20 @@ fi %files %defattr(644,root,root,755) -%doc AUTHORS ChangeLog NEWS README THANKS -%attr(770,root,ntop) %dir %{_localstatedir} -%attr(755,root,root) %{_sbindir}/* +%doc AUTHORS ChangeLog NEWS README THANKS docs/{1STRUN.txt,FAQ} +%attr(750,root,ntop) %dir %{_sysconfdir}/ntop +%attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/ntop-cert.pem +%attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/oui.txt +%attr(640,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop/specialMAC.txt.gz +%attr(660,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf +%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(755,root,root) %{_sbindir}/ntop %attr(755,root,root) %{_libdir}/lib*.so %attr(755,root,root) %{_datadir}/%{name} %dir %{_libdir}/%{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(644,root,ntop) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/ntop.conf +%{_mandir}/man8/ntop.8* + +%attr(770,root,ntop) %dir %{_localstatedir}/ntop +%attr(770,root,ntop) %dir %{_localstatedir}/ntop/rrd