SFEntop.spec: update to 3.3.10
authorjurikm
Fri, 28 May 2010 13:40:48 +0000
changeset 2714 69baa3d94e4f
parent 2713 b259647ad2a6
child 2715 62065de3f94f
SFEntop.spec: update to 3.3.10
ChangeLog
SFEntop.spec
patches/ntop-01-lua-hidden.diff
patches/ntop-02-configure.diff
patches/ntop-03-mimpure.diff
--- a/ChangeLog	Thu May 27 07:07:47 2010 +0000
+++ b/ChangeLog	Fri May 28 13:40:48 2010 +0000
@@ -1,3 +1,7 @@
+2010-05-28 Milan Jurik <[email protected]>
+
+	* SFEntop.spec: update to 3.3.10
+
 2010-05-27 Milan Jurik <[email protected]>
 
 	* SFEgnumeric.spec: bump to 1.10.4
--- a/SFEntop.spec	Thu May 27 07:07:47 2010 +0000
+++ b/SFEntop.spec	Fri May 28 13:40:48 2010 +0000
@@ -2,36 +2,73 @@
 # Copyright (c) 2006 Sun Microsystems, Inc.
 # This file and all modifications and additions to the pristine
 # package are under the same license as the package itself.
+#
+
+# TODO fix sctp support
 
 %include Solaris.inc
 
-Name:                SFEntop
-Summary:             A network traffic usage monitor
-Version:             3.2
-Source:              %{sf_download}/ntop/ntop-%{version}.tgz
+%define cc_is_gcc 1
+%include base.inc
+
+%define SFErrdtool	%(/usr/bin/pkginfo -q SFErrdtool && echo 1 || echo 0)
+
+# define for internal lua lib download in ntop configure script
+%define lua_version 5.1.4
 
-SUNW_BaseDir:        %{_basedir}
-BuildRoot:           %{_tmppath}/%{name}-%{version}-build
+Name:		SFEntop
+Summary:	A network traffic usage monitor
+Version:	3.3.10
+Source:		%{sf_download}/ntop/ntop-%{version}.tar.gz
+Source1:	http://www.lua.org/ftp/lua-%{lua_version}.tar.gz
+Source2:	http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
+Source3:	http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
+Source4:	http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
+Patch1:		ntop-01-lua-hidden.diff
+Patch2:		ntop-02-configure.diff
+Patch3:		ntop-03-mimpure.diff
+URL:		http://www.ntop.org/
+SUNW_BaseDir:	%{_basedir}
+BuildRoot:	%{_tmppath}/%{name}-%{version}-build
 %include default-depend.inc
 
-BuildRequires: SFElibpcap-devel
-BuildRequires: SFEgdbm-devel
-BuildRequires: SFEgd-devel
-Requires: SFElibpcap
-Requires: SFEgdbm
-Requires: SFEgd
+BuildRequires: SUNWlibpcap
+BuildRequires: SUNWgnu-dbm
+BuildRequires: SUNWgd2
+Requires: SUNWlibpcap
+Requires: SUNWgnu-dbm
+Requires: SUNWgd2
+BuildRequires: SFElibevent
+Requires: SFElibevent
+BuildRequires: SUNWopenssl-include
+Requires: SUNWopenssl-libraries
+Requires: %name-root
+BuildRequires: SUNWgzip
 
-Requires: %name-root
+BuildRequires: SUNWgawk
 
-BuildRequires: SFEgawk
+%if %SFErrdtool
+BuildRequires: SFErrdtool
+Requires: SFErrdtool
+%else
+BuildRequires: SUNWrrdtool
+Requires: SUNWrrdtool
+%endif
 
 %package root
-Summary:                 %{summary} - / filesystem
-SUNW_BaseDir:            /
+Summary:	%{summary} - / filesystem
+SUNW_BaseDir:	/
 %include default-depend.inc
 
 %prep
 %setup -q -n ntop-%version
+cp %{PATCH1} .
+%patch2 -p1
+%patch3 -p1
+cp %{SOURCE1} .
+cp %{SOURCE2} .
+cp %{SOURCE3} . && gunzip GeoLiteCity.dat.gz
+cp %{SOURCE4} . && gunzip GeoIPASNum.dat.gz
 
 %build
 
@@ -41,22 +78,27 @@
 fi
 
 # This source is gcc-centric, therefore...
-export CC=/usr/sfw/bin/gcc
-# export CFLAGS="%optflags"
-export CFLAGS="-O4 -fPIC -DPIC -Xlinker -i -fno-omit-frame-pointer"
+export CC=gcc
+export CXX=g++
+export CFLAGS="%optflags"
+#export CFLAGS="-O4 -fPIC -DPIC -Xlinker -i -fno-omit-frame-pointer"
 
 export LDFLAGS="%{_ldflags} -lsocket -lnsl"
 
-./configure --prefix=%{_prefix}  \
+./autogen.sh --prefix=%{_prefix}  \
             --mandir=%{_mandir} \
             --localstatedir=%{_localstatedir} \
-            --sysconfdir=%{_sysconfdir}
+            --sysconfdir=%{_sysconfdir} \
+            --disable-static \
+            --with-ssl \
+            --enable-jumbo-frames
 
 make -j$CPUS
 
 %install
 rm -rf $RPM_BUILD_ROOT
 
+cd GeoIP-1.4.6; make install DESTDIR=$RPM_BUILD_ROOT; cd ..
 make install DESTDIR=$RPM_BUILD_ROOT
 
 rm -f ${RPM_BUILD_ROOT}%{_libdir}/*.la
@@ -69,6 +111,8 @@
 %defattr (-, root, bin)
 %dir %attr (0755, root, bin) %{_bindir}
 %{_bindir}/*
+%dir %attr (0755, root, bin) %{_includedir}
+%{_includedir}/*
 %dir %attr (0755, root, bin) %{_libdir}
 %{_libdir}/*
 %dir %attr (0755, root, sys) %{_datadir}
@@ -82,6 +126,8 @@
 %{_localstatedir}/*
 
 %changelog
+* Fri May 28 2010 - Milan Jurik
+- update to 3.3.10
 * Sat Mar 31 2007 - Thomas Wagner
 - change Build-Requires to be SFEgd-devel
 * Mon Mar 19 2007 - [email protected]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ntop-01-lua-hidden.diff	Fri May 28 13:40:48 2010 +0000
@@ -0,0 +1,9 @@
+--- lua-5.1.4/src/luaconf.h	Mon Feb 11 17:25:08 2008
++++ lua-5.1.4/src/luaconf.h	Tue May 25 21:16:27 2010
+@@ -184,6 +184,0 @@
+-
+-#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
+-      defined(__ELF__)
+-#define LUAI_FUNC	__attribute__((visibility("hidden"))) extern
+-#define LUAI_DATA	LUAI_FUNC
+-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ntop-02-configure.diff	Fri May 28 13:40:48 2010 +0000
@@ -0,0 +1,19 @@
+--- ntop-3.3.10/configure.in	Thu May 27 20:58:10 2010
++++ ntop-3.3.10-patch/configure.in	Thu May 27 20:59:13 2010
+@@ -1662,6 +1662,7 @@
+ tar xvfz $LUA_VERSION.tar.gz
+ cat $LUA_VERSION/src/Makefile | sed -e s,'MYCFLAGS=-DLUA_USE_POSIX',' MYCFLAGS="-fPIC -DLUA_USE_POSIX"',g > /tmp/lua.temp
+ cat /tmp/lua.temp >  $LUA_VERSION/src/Makefile
++cd $LUA_VERSION; gpatch -p1 < ../ntop-01-lua-hidden.diff; cd ..
+ #rm -f /tmp/lua.temp
+ cd $LUA_VERSION; make posix; cd ..
+ 
+@@ -1970,7 +1971,7 @@
+ fi
+ tar xvfz GeoIP.tar.gz
+ GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
+-cd $GEO_DIR; ./configure --prefix=${prefix}; make; cd ..
++cd $GEO_DIR; ./configure --prefix=${prefix} --sysconfdir=$sysconfdir; make; cd ..
+ # OSX Fix
+ GEO_DYLIB="$GEO_DIR/libGeoIP/.libs/libGeoIP.dylib"
+ if test -f $GEO_DYLIB; then
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ntop-03-mimpure.diff	Fri May 28 13:40:48 2010 +0000
@@ -0,0 +1,5 @@
+--- ntop-3.3.10/Makefile.am	Wed May 26 21:06:13 2010
++++ ntop-3.3.10-patch/Makefile.am	Wed May 26 21:05:57 2010
+@@ -155,1 +155,1 @@
+-libntopreport_la_LDFLAGS      = $(AM_LDFLAGS) -release $(VERSION) -export-dynamic @DYN_FLAGS@
++libntopreport_la_LDFLAGS      = $(AM_LDFLAGS) -release $(VERSION) -export-dynamic -mimpure-text @DYN_FLAGS@