rpms/ntop/EL-5 ntop-geoip.patch, NONE, 1.1 ntop-http_c.patch, NONE, 1.1 ntop.spec, 1.2, 1.3

Huzaifa Sidhpurwala huzaifas at fedoraproject.org
Thu Apr 16 05:59:37 UTC 2009


Author: huzaifas

Update of /cvs/pkgs/rpms/ntop/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8939

Modified Files:
	ntop.spec 
Added Files:
	ntop-geoip.patch ntop-http_c.patch 
Log Message:
bump to the latest fedora version

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 ""

ntop-http_c.patch:

--- NEW FILE ntop-http_c.patch ---
--- ntop-3.3.9.org/http.c	2009-03-16 23:58:33.000000000 +0530
+++ ntop-3.3.9/http.c	2009-03-16 23:59:39.000000000 +0530
@@ -1341,6 +1341,7 @@
 void initAccessLog(void) {
 
   if(myGlobals.runningPref.accessLogFile) {
+    umask(0137);
     myGlobals.accessLogFd = fopen(myGlobals.runningPref.accessLogFile, "a");
     if(myGlobals.accessLogFd == NULL) {
       traceEvent(CONST_TRACE_ERROR, "Unable to create file %s. Access log is disabled.",


Index: ntop.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ntop/EL-5/ntop.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ntop.spec	29 Aug 2008 09:09:00 -0000	1.2
+++ ntop.spec	16 Apr 2009 05:59:06 -0000	1.3
@@ -1,25 +1,31 @@
 Name:           ntop
-Version:        3.3.6
-Release:        6%{?dist}
+Version:        3.3.9
+Release:        5%{?dist}
 Summary:        A network traffic probe similar to the UNIX top command
 Group:          Applications/Internet
-License:        GPLv2
+License:        GPLv2 and BSD with advertising
 URL:            http://www.ntop.org
 Source0:        http://downloads.sourceforge.net/ntop/ntop-%{version}.tar.gz
 Source1:        ntop.init
 Source2:        ntop.conf
+Source3:        http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
+Source4:        http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz
 Patch1:         ntop-am.patch
 Patch2:         ntop-running-user.patch
 Patch3:         ntop-dbfile-default-dir.patch
 Patch4:         ntop-compile.patch
 Patch5:         ntop-enable-sslv3.patch
+Patch6:         ntop-geoip.patch
+Patch7:         ntop-http_c.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires:  autoconf, automake, pkgconfig, libtool, groff, libpcap-devel
+BuildRequires:  autoconf, automake, pkgconfig, libtool, groff, libpcap-devel wget 
 BuildRequires:  gdbm-devel, gd-devel, rrdtool-devel, openssl-devel
 BuildRequires:  net-snmp-devel, pcre-devel, mysql-devel
 BuildRequires:  perl(ExtUtils::Embed)
+BuildRequires:  GeoIP-devel
 Requires:       initscripts, graphviz
-Requires(post): /sbin/chkconfig       
+Requires(post): /sbin/chkconfig      
+Requires(post): openssl >= 0.9.7f-4, /bin/cat
 Requires(preun):/sbin/chkconfig       
 
 
@@ -47,6 +53,9 @@
 
 %prep
 %setup -q -n ntop
+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
@@ -60,6 +69,8 @@
 %patch3 -p1 -b .dbfile-default-dir
 %patch4 -p1 -b .compile
 %patch5 -p1 -b .sslv3
+%patch6 -p1 -b .geo
+%patch7 -p1 -b .http_c
 
 
 %build
@@ -114,6 +125,27 @@
   /sbin/chkconfig --add %{name} &> /dev/null || :
 fi
 
+# create new self-signed certificate
+%define sslcert %{_sysconfdir}/ntop/ntop-cert.pem
+if [ ! -f %{sslcert} ] ; then
+ #get hosname
+ FQDN=`hostname`
+ if [ "x${FQDN}" = "x" ]; then
+    FQDN=localhost.localdomain
+ fi
+ #create key and certificate in one file
+ cat << EOF | %{_bindir}/openssl req -new -newkey rsa:1024 -days 365 -nodes -x509 -keyout %{sslcert}  -out %{sslcert} 2>/dev/null
+--
+SomeState
+SomeCity
+SomeOrganization
+SomeOrganizationalUnit
+${FQDN}
+root@${FQDN}
+EOF
+fi
+
+
 %preun
 if [ $1 = 0 ]; then
   /sbin/service %{name} stop    &> /dev/null || :
@@ -155,6 +187,9 @@
 %{_localstatedir}/lib/ntop/rrd
 
 %changelog
+* Thu Apr 16 2009 Huzaifa Sidhpurwala <huzaifas at redhat.com> - 3.3.9-5
+- Bump to latest fedora version 
+
 * Fri Aug 29 2008 Richard W.M. Jones <rjones at redhat.com> - 3.3.6-6
 - Removed tcp_wrappers-devel, lm_sensors-devel, not available in EL-5.
 




More information about the fedora-extras-commits mailing list