rpms/ntop/devel ntop-geoip.patch,NONE,1.1 ntop.spec,1.6,1.7

Peter Vrabec pvrabec at fedoraproject.org
Thu Mar 5 12:00:14 UTC 2009


Author: pvrabec

Update of /cvs/extras/rpms/ntop/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv28539

Modified Files:
	ntop.spec 
Added Files:
	ntop-geoip.patch 
Log Message:
build against existing package (#488419)


ntop-geoip.patch:

--- NEW FILE ntop-geoip.patch ---
diff -up ntop-3.3.9/configure.in.geo ntop-3.3.9/configure.in
--- ntop-3.3.9/configure.in.geo	2009-03-05 11:30:53.000000000 +0100
+++ ntop-3.3.9/configure.in	2009-03-05 11:30:53.000000000 +0100
@@ -1890,40 +1890,23 @@ else
     }'`
 fi
 
-dnl> GeoIP (http://www.maxmind.com/)
-if test -f "GeoIP.tar.gz"; then
-   echo "GeoIP already present on this machine"
-else
-   wget http://www.maxmind.com/download/geoip/api/c/GeoIP.tar.gz
-   tar xvfz GeoIP.tar.gz
-   GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
-   cd $GEO_DIR; ./configure; make; cd ..
-   # OSX Fix
-   GEO_DYLIB="$GEO_DIR/libGeoIP/.libs/libGeoIP.dylib"
-   if test -f $GEO_DYLIB; then
-      ln -s $GEO_DYLIB .
-   fi
-fi
-
-if test -f "GeoLiteCity.dat"; then
-   echo "GeoLiteCity.dat already present"
-else
-   wget http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
-   gunzip GeoLiteCity.dat.gz
-fi
-
-if test -f "GeoIPASNum.dat"; then
-   echo "GeoIPASNum.dat already present"
-else
-   wget http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
-   gunzip GeoIPASNum.dat.gz
+#
+#GeoIP
+#
+AC_CHECK_HEADERS(
+    [GeoIP.h],
+    [geoip_header="yes"],
+    [AC_MSG_FAILURE([GeoIP header file is missing])]
+)
+if test "$geoip_header" = "yes"; then
+    AC_CHECK_LIB(GeoIP, GeoIP_open,
+        [geoip_libs="yes"],
+	[AC_MSG_FAILURE([GeoIP library is missing])]
+    )
+fi
+if test "$geoip_libs" = "yes"; then
+    LDFLAGS="${LDFLAGS} -lGeoIP"
 fi
-
-
-GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
-GEO_IP="$GEO_DIR/libGeoIP/"
-CFLAGS="$CFLAGS -I$GEO_IP"
-LDFLAGS="$LDFLAGS -L$GEO_IP.libs/ -lGeoIP"
 
 dnl> NTOPCONFIGDEBUG_SETTINGS([precet])
 
diff -up ntop-3.3.9/Makefile.am.geo ntop-3.3.9/Makefile.am
--- ntop-3.3.9/Makefile.am.geo	2009-03-05 11:39:26.000000000 +0100
+++ ntop-3.3.9/Makefile.am	2009-03-05 12:20:11.000000000 +0100
@@ -262,8 +262,6 @@ libclean:
 
 install: install-recursive
 
-	cd @GEO_DIR@; make install
-
 	@mkdir -p $(DESTDIR)/$(CFG_DBFILE_DIR)
 
 	@echo ""


Index: ntop.spec
===================================================================
RCS file: /cvs/extras/rpms/ntop/devel/ntop.spec,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ntop.spec	3 Mar 2009 09:14:00 -0000	1.6
+++ ntop.spec	5 Mar 2009 11:59:44 -0000	1.7
@@ -1,6 +1,6 @@
 Name:           ntop
 Version:        3.3.9
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        A network traffic probe similar to the UNIX top command
 Group:          Applications/Internet
 License:        GPLv2
@@ -8,18 +8,19 @@
 Source0:        http://downloads.sourceforge.net/ntop/ntop-%{version}.tar.gz
 Source1:        ntop.init
 Source2:        ntop.conf
-Source3:        GeoIP.tar.gz
-Source4:        GeoLiteCity.dat.gz
-Source5:        GeoIPASNum.dat.gz
+Source3:        GeoLiteCity.dat.gz	
+Source4:        GeoIPASNum.dat.gz
 Patch1:         ntop-am.patch
 Patch2:         ntop-running-user.patch
 Patch3:         ntop-dbfile-default-dir.patch
 Patch4:         ntop-enable-sslv3.patch
+Patch5:         ntop-geoip.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  autoconf, automake, pkgconfig, libtool, groff, libpcap-devel wget
 BuildRequires:  gdbm-devel, gd-devel, rrdtool-devel, openssl-devel
 BuildRequires:  net-snmp-devel, lm_sensors-devel, pcre-devel, mysql-devel
 BuildRequires:  tcp_wrappers-devel, perl(ExtUtils::Embed)
+BuildRequires:  GeoIP-devel
 Requires:       initscripts, graphviz
 Requires(post): /sbin/chkconfig       
 Requires(post): openssl >= 0.9.7f-4, /bin/cat
@@ -50,10 +51,8 @@
 
 %prep
 %setup -q -n ntop-%{version}
-#this looks stupid, ask upstream
-cp %SOURCE3 ./ && tar xvfz GeoIP.tar.gz
-cp %SOURCE4 ./ && gunzip GeoLiteCity.dat.gz
-cp %SOURCE5 ./ && gunzip GeoIPASNum.dat.gz
+cp %SOURCE3 ./ && gunzip GeoLiteCity.dat.gz
+cp %SOURCE4 ./ && gunzip GeoIPASNum.dat.gz
 
 # executable bits are set on some config files and docs that go into
 # %%{_sysconfdir}/ntop and %%{_datadir}, and some debug source files.  Remove
@@ -66,22 +65,9 @@
 %patch2 -p1 -b .user
 %patch3 -p1 -b .dbfile-default-dir
 %patch4 -p1 -b .sslv3
-
-#fix files not in UTF-8
-for file in {geoiplookup.1.in,geoiplookup6.1.in,geoipupdate.1.in} 
-do
-    mv GeoIP-1.4.6/man/"$file" GeoIP-1.4.6/man/"$file".ISO;
-    iconv -f ISO_8859-1 -t UTF8 GeoIP-1.4.6/man/"$file".ISO >  GeoIP-1.4.6/man/"$file";
-done
+%patch5 -p1 -b .geo
 
 %build
-#take care of GeoIP
-cd GeoIP-1.4.6
-%{configure} --disable-static --libdir=/usr/%{_lib}
-#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
-cd ..
-
 #run ntop own autoconf wrapper
 ./autogen.sh --noconfig
 
@@ -94,9 +80,6 @@
 #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
 
-#take care of GeoIP
-cd GeoIP-1.4.6 && make %{?_smp_mflags} && cd ..
-
 make %{?_smp_mflags}
 
 %install
@@ -124,10 +107,6 @@
 #remove expired certificate
 rm -rf  $RPM_BUILD_ROOT/%{_sysconfdir}/ntop/ntop-cert.pem
 
-#get a rid of GeoIP devel stuff
-rm -rf $RPM_BUILD_ROOT/%{_includedir}
-rm -rf $RPM_BUILD_ROOT/%{_libdir}/lib{GeoIP,GeoIPUpdate}.so
-
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -185,16 +164,11 @@
 %doc docs/1STRUN.txt NEWS README SUPPORT_NTOP.txt THANKS
 %config(noreplace) %{_sysconfdir}/ntop.conf
 %config(noreplace) %{_sysconfdir}/ntop
-%config(noreplace) %{_sysconfdir}/GeoIP.conf
-%config(noreplace) %{_sysconfdir}/GeoIP.conf.default
 %{_initrddir}/ntop
 %{_sbindir}/*
-%{_bindir}/*
 %{_libdir}/*
-%{_mandir}/man1/*
 %{_mandir}/man8/*
 %{_datadir}/ntop
-%{_datadir}/GeoIP
 %dir %{_localstatedir}/lib/ntop
 %defattr(0644,root,root,-)
 %ghost %{_localstatedir}/lib/ntop/addressQueue.db
@@ -211,6 +185,9 @@
 %{_localstatedir}/lib/ntop/rrd
 
 %changelog
+* Thu Mar 05 2009 Peter Vrabec <pvrabec at redhat.com> - 3.3.9-3
+- build against existing package (#488419)
+
 * Tue Mar 03 2009 Peter Vrabec <pvrabec at redhat.com> - 3.3.9-2
 - do not create new certificate if there is already one installed
 




More information about the fedora-extras-commits mailing list