Sophie

Sophie

distrib > Mageia > 1 > x86_64 > by-pkgid > 9f46645a6dbdd2d8d174d3f9fb097c5a > files > 8

ntop-4.0.3-1.mga1.src.rpm

##%define _requires_exceptions devel(.*)
##%define _provides_exceptions devel(.*)
##%define _disable_ld_no_undefined 1

Name:		ntop
Version:	4.0.3
Release:	%mkrel 1
Summary:	Network and traffic analyzer
License:	GPLv3
Group:		Monitoring
URL:		http://www.ntop.org
Source0:	http://downloads.sourceforge.net/ntop/%{name}-%{version}.tgz
Source1:	%{name}.init
Source2:	%{name}.logrotate
Source3:	http://standards.ieee.org/regauth/oui/oui.txt
Source4:        ntop.conf
Patch0:		ntop-path_to_dot.diff
Patch5:		ntop-4.0-system_lua.patch
Patch6:		ntop-4.0.3-mga-fix-default-user.patch
BuildRequires:	gdbm-devel
BuildRequires:	gd-devel
BuildRequires:	GeoIP-devel
BuildRequires:	glib2-devel
BuildRequires:	libevent-devel
BuildRequires:	libjpeg-devel
BuildRequires:	libpcap-devel
BuildRequires:	libpcre-devel
BuildRequires:	libpng-devel
BuildRequires:	libtool
BuildRequires:	lua-devel >= 5.1.4
BuildRequires:  mysql-devel
BuildRequires:  perl-devel
BuildRequires:	ncurses-devel
BuildRequires:	net-snmp-devel >= 5.4.1-3
BuildRequires:	openssl-devel
BuildRequires:	pkgconfig
BuildRequires:	readline-devel
BuildRequires:	rrdtool-devel
BuildRequires:	tcp_wrappers-devel
BuildRequires:	xpm-devel
BuildRequires:	zlib-devel
BuildRequires:	wget

Requires(pre): rpm-helper
Requires(preun): rpm-helper
Requires(post): rpm-helper
Requires(postun): rpm-helper
Requires:	tcp_wrappers
Requires:	rrdtool
Requires:	geoip

%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
%patch5 -p1 -b .system_lua
%patch6 -p0 -b .default-user-to-ntop
# update oui.txt
rm -f oui.txt*
cp %{SOURCE3} oui.txt; gzip -9 oui.txt

%build
sh ./autogen.sh --noconfig

%serverbuild

%configure2_5x \
    --disable-static \
    --bindir=%{_sbindir} \
    --enable-tcpwrap \
    --enable-sslv3 \
    --enable-snmp \
    --localstatedir=/var/lib \
    --enable-mysql 

#rpath problem
sed -i \
    -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \
    -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \
    libtool

%make

%install
rm -rf %{buildroot}

%makeinstall_std

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sysconfdir}/{logrotate.d,sysconfig}
install -d  %{buildroot}/%{_localstatedir}/lib/ntop/rrd/{flows,graphics,interfaces}

#Create folder for archive logs
install -d %{buildroot}/%{_localstatedir}/log/ntop


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 > %{_sysconfdir}/ntop/ntop-cert.pem
rm -f privkey.pem cert.pem
chmod 600 %{_sysconfdir}/ntop/ntop-cert.pem
EOF

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

install  -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/ntop
install  -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/ntop
install  -m 0644 %{SOURCE4} %{buildroot}/%{_sysconfdir}/ntop/ntop.conf


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

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



cat > README.urpmi << EOF
There are some manual steps you need to do, first start %{_sbindir}/ntop to set
the admin password, please check %_datadir/doc/%name/1STRUN.txt file for more info. 
By default https is disabled by default, you need to execute 
%{_sysconfdir}/ntop/makecert.sh script to generate the ntop-cert.pem file.
After that you can enable https support by editing %{_sysconfdir}/ntop/ntop.conf.

Have fun!
EOF

%pre
%_pre_useradd %{name} %{_localstatedir}/lib/%{name} /bin/false

%post
%_post_service ntop

%preun
%_preun_service ntop


%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 docs/database NetFlow README.urpmi
%{_sysconfdir}/logrotate.d/ntop
%config(noreplace) %{_sysconfdir}/ntop/%name.conf
%{_sysconfdir}/%name
%{_initrddir}/%{name}
%{_sbindir}/%{name}
%{_mandir}/man8/%{name}.8.*
%{_datadir}/%{name}/
%{_libdir}/libcpacketPlugin.so
%{_libdir}/libicmpPlugin.so
%{_libdir}/libnetflowPlugin.so
%{_libdir}/libntop.so
%{_libdir}/libntopreport.so
%{_libdir}/librrdPlugin.so
%{_libdir}/libsflowPlugin.so
%{_libdir}/libcpacketPlugin-4.0.3.so
%{_libdir}/libicmpPlugin-4.0.3.so
%{_libdir}/libnetflowPlugin-4.0.3.so
%{_libdir}/libntop-4.0.3.so
%{_libdir}/libntopreport-4.0.3.so
%{_libdir}/librrdPlugin-4.0.3.so
%{_libdir}/libsflowPlugin-4.0.3.so
%{_libdir}/%{name}/
%dir /var/lib/ntop
%attr(0755,ntop,ntop) %{_localstatedir}/lib/ntop/rrd/
%attr(0755,ntop,ntop) %dir /var/log/ntop


%changelog
* Mon Apr 11 2011 mikala <mikala> 4.0.3-1.mga1
+ Revision: 83455
- Update tarball to 4.0.3
- Move configuration file in /etc/ntop & use it
- Drop patch2,3,4
- Add a patch from fedora to use ntop for default user
- Remove some gdome2-devel as BR
- Ensure that the pem file is going to be created in /etc/ntop folder
- Disable https by default in configuration file
- Add some configurations options (commented out ) in /etc/ntop/ntop.conf
- Edit the readme.urpmi to reflect some changes
- imported package ntop


* Thu Mar 17 2011 Oden Eriksson <oeriksson@mandriva.com> 4.0-6mdv2011.0
+ Revision: 645851
- relink against libmysqlclient.so.18

* Sat Jan 01 2011 Oden Eriksson <oeriksson@mandriva.com> 4.0-5mdv2011.0
+ Revision: 627269
- rebuilt against mysql-5.5.8 libs, again

* Thu Dec 30 2010 Oden Eriksson <oeriksson@mandriva.com> 4.0-4mdv2011.0
+ Revision: 626550
- rebuilt against mysql-5.5.8 libs

* Wed Dec 22 2010 Oden Eriksson <oeriksson@mandriva.com> 4.0-3mdv2011.0
+ Revision: 623876
- rebuilt against libevent 2.x

* Tue Oct 12 2010 Funda Wang <fwang@mandriva.org> 4.0-2mdv2011.0
+ Revision: 585070
- rebuild for new net-snmp

* Tue Jul 20 2010 Guillaume Rousse <guillomovitch@mandriva.org> 4.0-1mdv2011.0
+ Revision: 555130
- use standard rpm-helper macros for creating user, and don't hardcode uid/gid
- drop useless redundant macros
- drop useless patch and build dependencies
- new version

* Fri Apr 16 2010 Funda Wang <fwang@mandriva.org> 3.3.10-4mdv2010.1
+ Revision: 535275
- rpm-devel is not requried

* Thu Feb 18 2010 Oden Eriksson <oeriksson@mandriva.com> 3.3.10-3mdv2010.1
+ Revision: 507524
- rebuild

* Thu Oct 15 2009 Oden Eriksson <oeriksson@mandriva.com> 3.3.10-2mdv2010.0
+ Revision: 457694
- rebuild

* Wed Sep 09 2009 Oden Eriksson <oeriksson@mandriva.com> 3.3.10-1mdv2010.0
+ Revision: 435316
- fix deps
- 3.3.10 (fixes CVE-2009-2732)
- use system lua and geoip

* Sun Dec 07 2008 Funda Wang <fwang@mandriva.org> 3.3.8-3mdv2009.1
+ Revision: 311544
- rebuild for new mysql

* Wed Oct 29 2008 Oden Eriksson <oeriksson@mandriva.com> 3.3.8-2mdv2009.1
+ Revision: 298324
- rebuilt against libpcap-1.0.0

* Sat Oct 11 2008 Funda Wang <fwang@mandriva.org> 3.3.8-1mdv2009.1
+ Revision: 292192
- put back *.so as it will not introduce extra dependencies
- New version 3.3.8
- don't ship .so files as development linker

* Sun Aug 17 2008 Oden Eriksson <oeriksson@mandriva.com> 3.3.7-1mdv2009.0
+ Revision: 272911
- 3.3.7
- use _disable_ld_no_undefined due to ugly autopoo
- restore changes in the init script
- rediffed P0
- added P3 to avoid useless pollution during build
- new oui.txt file (S3)

  + Thierry Vignaud <tv@mandriva.org>
    - rebuild

  + Pixel <pixel@mandriva.com>
    - do not call ldconfig in %%post/%%postun, it is now handled by filetriggers
    - adapt to %%_localstatedir now being /var instead of /var/lib (#22312)

* Wed Mar 26 2008 Oden Eriksson <oeriksson@mandriva.com> 3.3-3mdv2008.1
+ Revision: 190305
- fix #25940 (warning request)
- don't start it per default

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot

  + Thierry Vignaud <tv@mandriva.org>
    - kill re-definition of %%buildroot on Pixel's request

* Mon Dec 17 2007 Oden Eriksson <oeriksson@mandriva.com> 3.3-2mdv2008.1
+ Revision: 121765
- added a fresh oui.txt file (S3)
- fix deps
- make the utterly borked autopoo stuff link correctly
- added mysql support
- activated net-snmp support again (thanks pld)

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