Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > 7d8dc2ceb15886e9195b62df95d72000 > files > 6

ntop-3.2-10mdk.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.2
Release:	%mkrel 10
License:	GPL
Group:		Monitoring
URL:		http://www.ntop.org
Source0:	%{fname}-%{version}.tar.bz2
Source1:	%{name}.init
Source2:	%{name}.logrotate
Patch0:		%{name}-%{version}-gcc32.patch.bz2
Patch1:		%{name}-%{version}-dot.patch.bz2
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:	net-snmp-devel
BuildRequires:	pkgconfig
BuildRequires:	chrpath
BuildRequires:  rpm-devel
%if %{mdkversion} == 1000
BuildRequires:	autoconf2.5
BuildRequires:	automake1.7
%endif
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
%if %{mdkversion} == 1000
%patch0 -p1 -b .gcc32
%endif
%patch1 -p1 -b .dot

%build

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

%if %{mdkversion} == 1000
aclocal-1.7
autoconf-2.5x
automake-1.7 ||

CFLAGS="%{optflags}"
export CFLAGS
CXXFLAGS="%{optflags}"
export CXXFLAGS
./configure	%{_target_platform} \
		--bindir=%{_sbindir} \
		--enable-optimize \
		--enable-tcpwrap \
		--enable-sslv3 \
		--enable-snmp \
		--sysconfdir=%{_sysconfdir} \
		--mandir=%{_mandir} \
		--program-prefix= \
		--localstatedir=%{_localstatedir} \
		--datadir=%{_datadir} \
		--with-localedir=%{_datadir}/locale \
		--prefix=%{_prefix}
%else
%configure	--bindir=%{_sbindir} \
		--enable-optimize \
		--enable-tcpwrap \
		--enable-sslv3 \
		--enable-snmp \
		--sysconfdir=%{_sysconfdir} \
		--mandir=%{_mandir} \
		--with-localedir=%{_datadir}/locale \
		--localstatedir=%{_localstatedir}

%endif

%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 plugins/README.SNMP www
%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
* Mon Jan 09 2006 Oden Eriksson <oeriksson@mandriva.com> 3.2-10mdk
- rebuilt against new net-snmp libs with new major (10)

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

* Mon Jan  9 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  2 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...

* Tue 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.

* Thu Sep 12 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.1.2-1mdk
- Updated to release 2.1.2.

* Wed Jul 24 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.0-3mdk
- rebuild for new readline

* Thu Feb 28 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.0-2mdk
- Added fixes from Olivier Thauvin <thauvin@aerov.jussieu.fr>:
	- Fix --localstatedir=%%{_localstatedir} and creating
	  %%{_localstatedir}/ntop.
	- Add share/ntop files missing in previous release.

* Tue Feb 26 2002 Giuseppe Ghibò <ghibo@mandrakesoft.com> 2.0-1mdk
- version 2.0.

* Wed Aug 22 2001 Lenny Cartier <lenny@mandrakesoft.com> 1.3.1-3mdk
- rebuild

* Sun Apr 22 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 1.3.1-2mdk
- Recompile again last gcc.
- Fix glibc22 compilation.

* Thu Aug 22 2000 Giuseppe Ghibò <ghibo@mandrakesoft.com> 1.3.1-1mdk
- initial release.