From b85e8b216fda8b0f73e3623ba9445f7ef1c5bf23 Mon Sep 17 00:00:00 2001 From: Peter Volkov Date: Thu, 16 Jun 2011 14:59:15 +0000 Subject: Add script for geoip database updates, bug #255147, thank toto for report and Christian Ruppert (idl0r) for this script. Package-Manager: portage-2.1.10.3/cvs/Linux x86_64 --- dev-libs/geoip/ChangeLog | 9 +++++- dev-libs/geoip/Manifest | 14 ++------- dev-libs/geoip/files/geoipupdate.sh | 27 +++++++++++++++++ dev-libs/geoip/geoip-1.4.7-r1.ebuild | 58 ++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 12 deletions(-) create mode 100755 dev-libs/geoip/files/geoipupdate.sh create mode 100644 dev-libs/geoip/geoip-1.4.7-r1.ebuild (limited to 'dev-libs') diff --git a/dev-libs/geoip/ChangeLog b/dev-libs/geoip/ChangeLog index 163ac3a2e703..c78184bd8ced 100644 --- a/dev-libs/geoip/ChangeLog +++ b/dev-libs/geoip/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-libs/geoip # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/geoip/ChangeLog,v 1.116 2011/06/07 14:38:55 jer Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/geoip/ChangeLog,v 1.117 2011/06/16 14:59:15 pva Exp $ + +*geoip-1.4.7-r1 (16 Jun 2011) + + 16 Jun 2011; Peter Volkov +geoip-1.4.7-r1.ebuild, + +files/geoipupdate.sh: + Add script for geoip database updates, bug #255147, thank toto for report and + Christian Ruppert (idl0r) for this script. 07 Jun 2011; Jeroen Roovers geoip-1.4.7.ebuild: Install the IPv6 database with USE=ipv6 thanks to Tom Hendrikx (bug #358287). diff --git a/dev-libs/geoip/Manifest b/dev-libs/geoip/Manifest index 885a7b62a921..cc151f63c367 100644 --- a/dev-libs/geoip/Manifest +++ b/dev-libs/geoip/Manifest @@ -1,17 +1,9 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - +AUX geoipupdate.sh 713 RMD160 bd0c4d6e4c58bb7a9aba7ec7b61ee8c991ee7de1 SHA1 544f692439aad0c5825f23d9cfbbac751facd1c2 SHA256 a7ba219827a708dcc8288275a9dc27fbf6995d147d09012105bac08586a0c0a3 DIST GeoIP-1.4.6.tar.gz 1045241 RMD160 67097c3f9c6bbdba1a4f7ee796713720dba19b0f SHA1 e692954f447c13270de7860e586696991776d8a3 SHA256 16b429407d7bc7d785d1aace73a390f287cd90200f0f61f5c75818058dec91c4 DIST GeoIP-1.4.7.tar.gz 1068781 RMD160 5970eb7d18cc5d1436aa32036805b240dbc46d04 SHA1 2db3a61e19dfaa0e4131217b155a59ba4bd0c5cc SHA256 11c5e225c0efddf1827112203c1ad2143658c61056eaa9adb4b690efe65aaf26 DIST GeoIPv6.dat.gz 757472 RMD160 178fb259d5fe7158a49c32a9b72d91372cb2d8a5 SHA1 98894197992ef1022bf27d612eda009672ccf46d SHA256 75f63ca4db6909b01ece94e3462048eb2a836f67b9d09548443d45294a938d52 EBUILD geoip-1.4.6.ebuild 1242 RMD160 b2d6619c576c2cf93a5dee84cd6ac2b55992e95f SHA1 e5ba438e4587e062922be4739d974b6333349869 SHA256 a2d497cc0bfcb8f6abd388af3187a11d146c967ebb3ae93e605c18a77c355d81 +EBUILD geoip-1.4.7-r1.ebuild 1525 RMD160 9332c262af42f9db60d935958fbf59a0b108f78a SHA1 66361463357f919b2dac233a0987f381b0cb99ec SHA256 b4656142a7a02ae56436cb5381c65ed4c497dc3c1a5be158f8776e5aab5dba67 EBUILD geoip-1.4.7.ebuild 1484 RMD160 ecdcf2ab84c21f2c7c040638267ebbb1981dd729 SHA1 80c49724695ca845d1d27a2ef2b1a687b89255be SHA256 bfe55ec943e4adcbcb0055b058f319d37e6d2326c4a1bdd840ae57160e4e559c -MISC ChangeLog 14283 RMD160 9eeb09e3b69922bfdc09215a3ab47bd1cd11f6cb SHA1 f6734c3ae23b89ca062f3f97bdd618015f14bbbf SHA256 5a775da5f5ed94cf68e4c6059651a41b051828d6514c8da3a7f5e07062f73fd6 +MISC ChangeLog 14534 RMD160 4292f1fc0686ecfc8c3e6e9f8537f91a00e2d818 SHA1 0fdacc7d9d04e4e3a83f5e2afa662b9b8f1a02b5 SHA256 c64c83d6522c03571c8bd29a46fd772cbaec1bd3439fbee690decfdd20744af3 MISC metadata.xml 467 RMD160 bae585df5c7d12c765d5fab1b7766b79729f1144 SHA1 dfe6076a08817ef8058f1209c381d61f4aaac998 SHA256 3081b13432bfa3cc218fe7f9ade8fe1cd0fcbea4f3f1de2d51faf8a0acad88f5 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v2.0.17 (GNU/Linux) - -iEYEARECAAYFAk3uOBYACgkQVWmRsqeSphNVUACffp52Wzm/pDw9Rqo2dCMKCdri -sPAAn1LF4U1bfpSUZOdSLdp/JXJikPaA -=hoxb ------END PGP SIGNATURE----- diff --git a/dev-libs/geoip/files/geoipupdate.sh b/dev-libs/geoip/files/geoipupdate.sh new file mode 100755 index 000000000000..cfe9cac2e33b --- /dev/null +++ b/dev-libs/geoip/files/geoipupdate.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +GEOIP_MIRROR="http://geolite.maxmind.com/download/geoip/database" +GEOIPDIR=/usr/share/GeoIP +TMPDIR= + +DATABASES="GeoLiteCity GeoLiteCountry/GeoIP asnum/GeoIPASNum GeoIPv6" + +if [ -d "${GEOIPDIR}" ]; then + cd $GEOIPDIR + if [ -n "${DATABASES}" ]; then + TMPDIR=$(mktemp -d geoipupdate.XXXXXXXXXX) + + echo "Updating GeoIP databases..." + + for db in $DATABASES; do + fname=$(basename $db) + + wget --no-verbose -t 3 -T 60 "${GEOIP_MIRROR}/${db}.dat.gz" -O "${TMPDIR}/${fname}.dat.gz" + gunzip -fdc "${TMPDIR}/${fname}.dat.gz" > "${TMPDIR}/${fname}.dat" + mv "${TMPDIR}/${fname}.dat" "${GEOIPDIR}/${fname}.dat" + chmod 0644 "${GEOIPDIR}/${fname}.dat" + done + [ -d "${TMPDIR}" ] && rm -rf $TMPDIR + fi +fi + diff --git a/dev-libs/geoip/geoip-1.4.7-r1.ebuild b/dev-libs/geoip/geoip-1.4.7-r1.ebuild new file mode 100644 index 000000000000..bbdba585ef7b --- /dev/null +++ b/dev-libs/geoip/geoip-1.4.7-r1.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/geoip/geoip-1.4.7-r1.ebuild,v 1.1 2011/06/16 14:59:15 pva Exp $ + +EAPI=4 + +inherit autotools-utils libtool + +MY_P=${P/geoip/GeoIP} + +DESCRIPTION="easily lookup countries by IP addresses, even when Reverse DNS entries don't exist" +HOMEPAGE="http://www.maxmind.com/geoip/api/c.shtml" +SRC_URI=" + http://www.maxmind.com/download/geoip/api/c/${MY_P}.tar.gz + ipv6? ( http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz ) +" + +# GPL-2 for md5.c - part of libGeoIPUpdate, MaxMind for GeoLite Country db +LICENSE="LGPL-2.1 GPL-2 MaxMind2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="ipv6 perl-geoipupdate static-libs" + +RDEPEND=" + perl-geoipupdate? ( + dev-perl/PerlIO-gzip + dev-perl/libwww-perl + ) +" + +S=${WORKDIR}/${MY_P} + +src_prepare() { + sed -e "s:usr local share GeoIP:usr share GeoIP:" \ + -e "s:usr local etc:etc:" \ + -i apps/geoipupdate-pureperl.pl || die + + elibtoolize # FreeBSD requires this +} + +src_configure() { + econf $(use_enable static-libs static) +} + +src_install() { + default + use perl-geoipupdate && dobin apps/geoipupdate-pureperl.pl + dodoc AUTHORS ChangeLog README TODO conf/GeoIP.conf.default + rm "${ED}/etc/GeoIP.conf.default" + use static-libs || remove_libtool_files + + if use ipv6; then + insinto /usr/share/GeoIP + doins "${WORKDIR}/GeoIPv6.dat" || die + fi + + dosbin "${FILESDIR}/geoipupdate.sh" +} -- cgit v1.2.3-65-gdbad