summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2009-02-18 21:44:38 +0000
committerAlin Năstac <mrness@gentoo.org>2009-02-18 21:44:38 +0000
commit12eb56b9468b8e23b1fb79416aa7b26706a101bb (patch)
treee24d07095c02d5061660d319a893abec0951a2a0 /net-analyzer/ntop
parentSparc stable, Bug #259360 --- looks fine. (diff)
downloadgentoo-2-12eb56b9468b8e23b1fb79416aa7b26706a101bb.tar.gz
gentoo-2-12eb56b9468b8e23b1fb79416aa7b26706a101bb.tar.bz2
gentoo-2-12eb56b9468b8e23b1fb79416aa7b26706a101bb.zip
Update GeoIP databases through a cron job (#259394).
(Portage version: 2.1.6.4/cvs/Linux 2.6.25-gentoo-r6 x86_64)
Diffstat (limited to 'net-analyzer/ntop')
-rw-r--r--net-analyzer/ntop/ChangeLog9
-rw-r--r--net-analyzer/ntop/files/ntop-3.3.9-external-geoip.patch47
-rw-r--r--net-analyzer/ntop/files/ntop-update-geoip-db21
-rw-r--r--net-analyzer/ntop/ntop-3.3.9-r1.ebuild (renamed from net-analyzer/ntop/ntop-3.3.9.ebuild)21
4 files changed, 75 insertions, 23 deletions
diff --git a/net-analyzer/ntop/ChangeLog b/net-analyzer/ntop/ChangeLog
index 6b63894b5a33..49cddb905838 100644
--- a/net-analyzer/ntop/ChangeLog
+++ b/net-analyzer/ntop/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-analyzer/ntop
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ChangeLog,v 1.67 2009/02/16 22:17:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ChangeLog,v 1.68 2009/02/18 21:44:38 mrness Exp $
+
+*ntop-3.3.9-r1 (18 Feb 2009)
+
+ 18 Feb 2009; Alin Năstac <mrness@gentoo.org>
+ files/ntop-3.3.9-external-geoip.patch, +files/ntop-update-geoip-db,
+ -ntop-3.3.9.ebuild, +ntop-3.3.9-r1.ebuild:
+ Update GeoIP databases through a cron job (#259394).
*ntop-3.3.9 (16 Feb 2009)
diff --git a/net-analyzer/ntop/files/ntop-3.3.9-external-geoip.patch b/net-analyzer/ntop/files/ntop-3.3.9-external-geoip.patch
index 99efd615c171..8291b557b87a 100644
--- a/net-analyzer/ntop/files/ntop-3.3.9-external-geoip.patch
+++ b/net-analyzer/ntop/files/ntop-3.3.9-external-geoip.patch
@@ -1,7 +1,7 @@
diff -Nru ntop-3.3.9.orig/configure.in ntop-3.3.9/configure.in
---- ntop-3.3.9.orig/configure.in 2009-02-16 19:43:57.000000000 +0000
-+++ ntop-3.3.9/configure.in 2009-02-16 19:47:10.000000000 +0000
-@@ -1882,20 +1882,6 @@
+--- ntop-3.3.9.orig/configure.in 2009-02-18 21:04:10.000000000 +0000
++++ ntop-3.3.9/configure.in 2009-02-18 21:05:58.000000000 +0000
+@@ -1883,39 +1883,7 @@
fi
dnl> GeoIP (http://www.maxmind.com/)
@@ -19,13 +19,21 @@ diff -Nru ntop-3.3.9.orig/configure.in ntop-3.3.9/configure.in
- fi
-fi
-
- if test -f "GeoLiteCity.dat"; then
- echo "GeoLiteCity.dat already present"
- else
-@@ -1911,10 +1897,7 @@
- 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
+-fi
+-
+-
-GEO_DIR=`find $PWD -type d -name "GeoIP-*"`
-GEO_IP="$GEO_DIR/libGeoIP/"
-CFLAGS="$CFLAGS -I$GEO_IP"
@@ -34,7 +42,7 @@ diff -Nru ntop-3.3.9.orig/configure.in ntop-3.3.9/configure.in
dnl> NTOPCONFIGDEBUG_SETTINGS([precet])
-@@ -2079,7 +2062,6 @@
+@@ -2080,7 +2048,6 @@
AC_SUBST(SO_VERSION_PATCH)
AC_SUBST(RRD_LIB)
AC_SUBST(RRD_INC)
@@ -44,7 +52,7 @@ diff -Nru ntop-3.3.9.orig/configure.in ntop-3.3.9/configure.in
diff -Nru ntop-3.3.9.orig/initialize.c ntop-3.3.9/initialize.c
--- ntop-3.3.9.orig/initialize.c 2008-12-03 22:00:22.000000000 +0000
-+++ ntop-3.3.9/initialize.c 2009-02-16 22:04:34.000000000 +0000
++++ ntop-3.3.9/initialize.c 2009-02-18 21:04:44.000000000 +0000
@@ -467,16 +467,15 @@
#endif
@@ -85,8 +93,19 @@ diff -Nru ntop-3.3.9.orig/initialize.c ntop-3.3.9/initialize.c
diff -Nru ntop-3.3.9.orig/Makefile.am ntop-3.3.9/Makefile.am
--- ntop-3.3.9.orig/Makefile.am 2008-12-03 22:00:22.000000000 +0000
-+++ ntop-3.3.9/Makefile.am 2009-02-16 19:47:25.000000000 +0000
-@@ -270,8 +270,6 @@
++++ ntop-3.3.9/Makefile.am 2009-02-18 21:05:33.000000000 +0000
+@@ -76,9 +76,7 @@
+ NTOPDATA = ntop-cert.pem \
+ $(ETTER_PASSIVE) \
+ oui.txt.gz \
+- specialMAC.txt.gz \
+- GeoIPASNum.dat \
+- GeoLiteCity.dat
++ specialMAC.txt.gz
+
+ NTOPHTML = html html/*.js html/*.html html/*.gif html/*.jpg html/*.ico html/*.png \
+ html/*.css html/*.dtd \
+@@ -270,8 +268,6 @@
install: install-recursive
diff --git a/net-analyzer/ntop/files/ntop-update-geoip-db b/net-analyzer/ntop/files/ntop-update-geoip-db
new file mode 100644
index 000000000000..40d08189fe13
--- /dev/null
+++ b/net-analyzer/ntop/files/ntop-update-geoip-db
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+BASE_URL=http://geolite.maxmind.com/download/geoip/database
+
+echo "Updating NTOP GeoIP databases..."
+
+cd /var/lib/ntop || exit
+
+for u in asnum/GeoIPASNum.dat.gz GeoLiteCity.dat.gz ; do
+ FILE_GZ=${u#*/}
+ FILE=${FILE_GZ%.gz}
+ wget -O ${FILE_GZ} ${BASE_URL}/${u} &&
+ gunzip < ${FILE_GZ} > .${FILE} &&
+ mv -f .${FILE} ${FILE} &&
+ rm -f ${FILE_GZ} ||
+ exit
+done
+
+/etc/init.d/ntop --quiet status && /etc/init.d/ntop restart
+
+echo "NTOP GeoIP databases were successfully updated"
diff --git a/net-analyzer/ntop/ntop-3.3.9.ebuild b/net-analyzer/ntop/ntop-3.3.9-r1.ebuild
index e82a9412890d..cdcc14e8beb9 100644
--- a/net-analyzer/ntop/ntop-3.3.9.ebuild
+++ b/net-analyzer/ntop/ntop-3.3.9-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ntop-3.3.9.ebuild,v 1.1 2009/02/16 22:17:28 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/ntop/ntop-3.3.9-r1.ebuild,v 1.1 2009/02/18 21:44:38 mrness Exp $
inherit eutils autotools
@@ -27,15 +27,16 @@ COMMON_DEPEND="sys-apps/gawk
sys-libs/zlib
dev-libs/geoip"
DEPEND="${COMMON_DEPEND}
- >=sys-devel/libtool-1.4
- net-misc/wget" # needed for downloading GeoIP data
+ >=sys-devel/libtool-1.4"
# Needed by xmldumpPlugin - couldn't get it to work
# dev-libs/gdome2
# >=dev-libs/glib-2"
RDEPEND="${COMMON_DEPEND}
media-fonts/corefonts
- media-gfx/graphviz"
+ media-gfx/graphviz
+ net-misc/wget
+ app-arch/gzip"
pkg_setup() {
# snmp doesn't compile in this release, disabled for now
@@ -102,8 +103,7 @@ src_install() {
keepdir /var/lib/ntop &&
fowners ntop:ntop /var/lib/ntop &&
- fperms 750 /var/lib/ntop &&
- mv "${D}"/etc/ntop/Geo*.dat "${D}"/var/lib/ntop ||
+ fperms 750 /var/lib/ntop ||
die "failed to prepare /var/lib/ntop dir"
dodoc AUTHORS CONTENTS ChangeLog MANIFESTO NEWS
@@ -111,9 +111,14 @@ src_install() {
newinitd "${FILESDIR}"/ntop-initd ntop
newconfd "${FILESDIR}"/ntop-confd ntop
+
+ exeinto /etc/cron.monthly
+ doexe "${FILESDIR}"/ntop-update-geoip-db
}
pkg_postinst() {
- elog "You need to set a password first by running"
- elog "ntop --set-admin-password"
+ elog "If this is the first time you install ntop, you need to run"
+ elog "following commands before starting ntop service:"
+ elog " ntop --set-admin-password"
+ elog " /etc/cron.monthly/ntop-update-geoip-db"
}