Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 2801a4611ab374c8a99027b56516c3c1 > files > 5

ntop-3.3-1mdv2008.0.src.rpm

%define name ntop
%define fname ntop

%define ntop_gid 120
%define ntop_uid 120
%define ntop_group ntop
%define ntop_user  ntop

Summary:	Network and traffic analyzer
Name:		%{name}
Version:	3.3
Release:	%mkrel 1
License:	GPL
Group:		Monitoring
URL:		http://www.ntop.org
Source0:	http://downloads.sourceforge.net/ntop/%{fname}-%{version}.tar.gz
Source1:	%{name}.init
Source2:	%{name}.logrotate
Patch0:		ntop-path_to_dot.diff
Requires(pre): rpm-helper
Requires(preun): rpm-helper
Requires(post): rpm-helper
Requires(postun): rpm-helper
BuildRequires:	libpcap-devel
BuildRequires:	ncurses-devel
BuildRequires:	readline-devel
BuildRequires:	tcp_wrappers-devel
BuildRequires:	gdbm-devel
BuildRequires:	openssl-devel
BuildRequires:	libjpeg-devel
BuildRequires:	libpng-devel
BuildRequires:	xpm-devel
BuildRequires:	zlib-devel
BuildRequires:	gdome2-devel
BuildRequires:	gd-devel
BuildRequires:	glib2-devel
BuildRequires:	libtool
BuildRequires:	rrdtool-devel
#BuildRequires:	net-snmp-devel
BuildRequires:	pkgconfig
BuildRequires:	chrpath
BuildRequires:  rpm-devel
BuildRequires:	autoconf2.5
BuildRequires:	automake1.7
BuildRoot:	%{_tmppath}/%{fname}-%{version}-root

%define _requires_exceptions devel(.*)

%description
Ntop is a network and traffic analyzer that provides a wealth of information on
various networking hosts and protocols. ntop is primarily accessed via a
built-in web interface. Optionally, data may be stored into a database for
analysis or extracted from the web server in formats suitable for manipulation
in perl or php.

%prep

%setup -q
%patch0 -p0 -b .dot

%build
%serverbuild

# populate CPPFLAGS with some includes
export CPPFLAGS="$CPPFLAGS `pkg-config --cflags-only-I gdome2` `pkg-config --cflags-only-I glib-2.0`"

sh ./autogen.sh

%configure2_5x \
    --bindir=%{_sbindir} \
    --enable-optimize \
    --enable-tcpwrap \
    --enable-sslv3 \
    --disable-snmp \
    --sysconfdir=%{_sysconfdir} \
    --mandir=%{_mandir} \
    --with-localedir=%{_datadir}/locale \
    --localstatedir=%{_localstatedir}

%make

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_sysconfdir}/{logrotate.d,sysconfig}
install -d %{buildroot}%{_initrddir}
#install -d %{buildroot}%{_datadir}/snmp/mibs
install -d %{buildroot}/var/log/ntop

%makeinstall_std

chmod 644 %{buildroot}%{_sysconfdir}/ntop/*gz
rm -f %{buildroot}%{_sysconfdir}/ntop/ntop-cert.pem

cat > %{buildroot}%{_sysconfdir}/ntop/makecert.sh <<EOF
#!/bin/sh
openssl req -new -x509 -sha1 -extensions v3_ca -nodes -days 1825 -out cert.pem
cat privkey.pem cert.pem > ntop-cert.pem
rm -f privkey.pem cert.pem
chmod 600 ntop-cert.pem
EOF

chmod 755 %{buildroot}%{_sysconfdir}/ntop/makecert.sh

install -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/ntop
install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/ntop

cat > %{buildroot}%{_sysconfdir}/sysconfig/%{name} <<EOF
# In this file, you can specify extra argument passed
# to ntop daemon at startup.
# Notice -u (user), -P (data dir) and -d (run as daemon)
# are allready set in init script
extra_arg=""

EOF

# install the mib file
#install -m0644 plugins/NTOP-MIB.txt %{buildroot}%{_datadir}/snmp/mibs/NTOP-MIB.txt

# cleanup
#rm -rf %{buildroot}%{_prefix}/lib%{name}
rm -rf %{buildroot}%{_libdir}/*.{a,la}
rm -rf %{buildroot}%{_libdir}/plugins

# fix permissions
find %{buildroot}%{_datadir}/%{fname}/html -type f -print0|xargs -0 chmod 644
find %{buildroot}%{_datadir}/%{fname}/html -type d -print0|xargs -0 chmod 755

# nuke rpath
chrpath -d %{buildroot}%{_libdir}/ntop/plugins/*.so

%pre
/usr/sbin/groupadd -g %{ntop_gid} -r %{ntop_group} 2>/dev/null || :
/usr/sbin/useradd -M -s /bin/false \
	-d %{_localstatedir}/%{name} \
	-c "system user for ntop" \
	-g %{ntop_group} -r -u %{ntop_uid} %{ntop_user} 2>/dev/null || :

%post
/sbin/ldconfig
%_post_service ntop

%preun
%_preun_service ntop

%postun -p /sbin/ldconfig

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc AUTHORS CONTENTS COPYING ChangeLog NEWS PORTING MANIFESTO SUPPORT_NTOP.txt
%doc THANKS docs/FAQ docs/HACKING docs/KNOWN_BUGS docs/FILES docs/README
%doc docs/1STRUN.txt
%config %{_sysconfdir}/logrotate.d/ntop
%config(noreplace) %{_sysconfdir}/sysconfig/%name
%config %{_initrddir}/ntop
%{_sbindir}/*
%{_mandir}/*/*
%dir %{_datadir}/%{fname}
%{_datadir}/%{fname}/*
%{_libdir}/lib*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*
%dir %{_sysconfdir}/ntop
%{_sysconfdir}/ntop/*
#%{_datadir}/snmp/mibs/NTOP-MIB.txt
%attr(0711,%{ntop_user},%{ntop_group}) %dir /var/log/ntop
%attr(0710,%{ntop_user},%{ntop_group}) %dir %{_localstatedir}/ntop


%changelog
* Sat Aug 18 2007 Oden Eriksson <oeriksson@mandriva.com> 3.3-1mdv2008.0
+ Revision: 65597
- fix build, again...
- fix deps (rrdtool-devel)
- fix build
- 3.3
- drop obsolete patches
- rediffed the dot patch
- disable snmp support due to an unknown build error
- rebuilt against new net-snmp libs


* Mon Jan 09 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2-10mdk
- rebuilt against new net-snmp libs with new major (10)

* Mon Jan 09 2006 Olivier Blin <oblin@mandriva.com> 3.2-9mdk
- fix typo in initscript

* Mon Jan 09 2006 Olivier Blin <oblin@mandriva.com> 3.2-8mdk
- convert parallel init to LSB
- fix typos in Requires(X)

* Wed Jan 04 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2-7mdk
- rebuilt against new net-snmp with new major (10)

* Wed Jan 04 2006 Nicolas Lécureuil <neoclust@mandriva.org> 3.2-6mdk
- Add BuildRequires

* Mon Jan 02 2006 Olivier Blin <oblin@mandriva.com> 3.2-5mdk
- parallel init support

* Thu Dec 22 2005 Oden Eriksson <oeriksson@mandriva.com> 3.2-4mdk
- rebuilt against net-snmp that has new major (9)
- added some lib64 fixes
- added fixes here and there...

* Wed Dec 14 2005 Giuseppe Ghibò <ghibo@mandriva.com> 3.2-3mdk
- Added data files into /usr/libntop/ntop/*.

* Sun Nov 13 2005 Olivier Thauvin <nanardon@mandriva.org> 3.2-2mdk
- fix PreReq

* Sun Nov 13 2005 Olivier Thauvin <nanardon@mandriva.org> 3.2-1mdk
- 3.2

* Tue Sep 27 2005 Gwenole Beauchesne <gbeauchesne@mandriva.com> 3.1-3mdk
- fix buffer overflow (aka fortify fixes)

* Wed Jul 13 2005 Oden Eriksson <oeriksson@mandriva.com> 3.1-2mdk
- rebuilt against new libpcap-0.9.1 (aka. a "play safe" rebuild)

* Wed Feb 16 2005 Sylvie Terjan <erinmargault@mandrake.org> 3.1-1mdk
- 3.1-1mdk

* Tue Aug 10 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 3.0-4mdk
- allow settings extra arg in /etc/sysconfig/ntop

* Fri Apr 23 2004 Olivier Blin <blino@mandrake.org> 3.0-3mdk
- keep .so files and use requires_exceptions for devel packages

* Wed Apr 21 2004 Olivier Blin <blino@mandrake.org> 3.0-2mdk
- remove .a and .la files as well
- merge previous changes and changelog entry
  (this package should be libified)

* Tue Apr 20 2004 Anne Nicolas <anne@lea-linux.org> 3.0-1mdk
- Version 3.0
- drop PO and P1
- remove E option in init script

* Sun Feb 01 2004 Michael Scherer <misc@mandrake.org> 2.2-3mdk
- fix Requires ( should not requires devel )

* Fri Sep 05 2003 Marcel Pol <mpol@gmx.net> 2.2-2mdk
- buildrequires

* Mon Jun 16 2003 Per Øyvind Karlsen <peroyvind@sintrax.net> 2.2-1mdk
- Version 2.2
- drop uterly useless Prefix tag
- drop P0
- use %%makeinstall_std macro
- remove unpackaged files
- buildrequires
- fix E: ntop no-prereq-on rpm-helper
- fix unowned dirs
- fix so that we don't include debug files

* Thu Feb 20 2003 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.1.3-1mdk
- Version 2.1.3.