From owner-svn-ports-all@FreeBSD.ORG Fri May 8 17:19:05 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 608E68D5; Fri, 8 May 2015 17:19:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35CDE14A7; Fri, 8 May 2015 17:19:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t48HJ5HM087179; Fri, 8 May 2015 17:19:05 GMT (envelope-from adamw@FreeBSD.org) Received: (from adamw@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t48HJ4np087177; Fri, 8 May 2015 17:19:04 GMT (envelope-from adamw@FreeBSD.org) Message-Id: <201505081719.t48HJ4np087177@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adamw set sender to adamw@FreeBSD.org using -f From: Adam Weinberger Date: Fri, 8 May 2015 17:19:04 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r385802 - in head/net/GeoIP: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 May 2015 17:19:05 -0000 Author: adamw Date: Fri May 8 17:19:04 2015 New Revision: 385802 URL: https://svnweb.freebsd.org/changeset/ports/385802 Log: Support fetching the GeoLite City and GeoLite ASN databases. Requested by: Scott Loga Modified: head/net/GeoIP/Makefile head/net/GeoIP/files/geoipupdate.sh.in Modified: head/net/GeoIP/Makefile ============================================================================== --- head/net/GeoIP/Makefile Fri May 8 17:08:09 2015 (r385801) +++ head/net/GeoIP/Makefile Fri May 8 17:19:04 2015 (r385802) @@ -4,7 +4,7 @@ PORTNAME= GeoIP PORTVERSION= 1.6.5 DISTVERSIONPREFIX= v -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net geography MAINTAINER= adamw@FreeBSD.org Modified: head/net/GeoIP/files/geoipupdate.sh.in ============================================================================== --- head/net/GeoIP/files/geoipupdate.sh.in Fri May 8 17:08:09 2015 (r385801) +++ head/net/GeoIP/files/geoipupdate.sh.in Fri May 8 17:19:04 2015 (r385802) @@ -1,5 +1,15 @@ #!/bin/sh +# You can set the following environment variables: +# +# GEOIP_DB_SERVER: The default download server is geolite.maxmind.com +# GEOIP_FETCH_CITY: If set (to anything), download the GeoLite City DB +# GEOIP_FETCH_ASN: If sset, download the GeoIP ASN DB + +GEOIP_DB_SERVER=${GEOIP_DB_SERVER:=geolite.maxmind.com} +GEOIP_FETCH_CITY=${GEOIP_FETCH_CITY:=} +GEOIP_FETCH_ASN=${GEOIP_FETCH_ASN:=} + set -eu echo Fetching GeoIP.dat and GeoIPv6.dat... @@ -27,8 +37,14 @@ _fetch() { return 0 } -GEOIP_DB_SERVER=${GEOIP_DB_SERVER:=geolite.maxmind.com} - _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz" GeoIP.dat - _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoIPv6.dat.gz" GeoIPv6.dat + +if [ -n "$GEOIP_FETCH_CITY" ]; then + _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoLiteCity.dat.gz" GeoLiteCity.dat + _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz" GeoLiteCityv6.dat +fi +if [ -n "$GEOIP_FETCH_ASN" ]; then + _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/asnum/GeoIPASNum.dat.gz" GeoIPASNum.dat + _fetch "http://${GEOIP_DB_SERVER}/download/geoip/database/asnum/GeoIPASNumv6.dat.gz" GeoIPASNumv6.dat +fi