summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Timo Gurr <tgurr@exherbo.org> 2018-01-24 14:42:51 +0100
committerAvatar Timo Gurr <tgurr@exherbo.org> 2018-01-24 15:02:29 +0100
commitbe0f8c00eda57c3c295758e763191f0566c3b0da (patch)
tree6af797de1e566c75b39b10f4e02b1abb748e7a4c
parent894c5586e6cd8995be0b5ac66ca41dfd661992f2 (diff)
downloadnet-be0f8c00eda57c3c295758e763191f0566c3b0da.tar.gz
net-be0f8c00eda57c3c295758e763191f0566c3b0da.tar.xz
GeoIP: version bump to 1.6.12
Change-Id: Ie8cb09e934e841ce27e4350dc047c87d8dd1f330 Reviewed-on: https://galileo.mailstation.de/gerrit/11215 Reviewed-by: Jenkins <wk@mailstation.de> Reviewed-by: Timo Gurr <tgurr@exherbo.org>
-rw-r--r--packages/net-libs/GeoIP/GeoIP-1.6.12.exheres-0 (renamed from packages/net-libs/GeoIP/GeoIP-1.6.9.exheres-0)0
-rw-r--r--packages/net-libs/GeoIP/GeoIP.exlib36
-rw-r--r--packages/net-libs/GeoIP/files/geoipupdate.sh49
3 files changed, 67 insertions, 18 deletions
diff --git a/packages/net-libs/GeoIP/GeoIP-1.6.9.exheres-0 b/packages/net-libs/GeoIP/GeoIP-1.6.12.exheres-0
index e469fdc..e469fdc 100644
--- a/packages/net-libs/GeoIP/GeoIP-1.6.9.exheres-0
+++ b/packages/net-libs/GeoIP/GeoIP-1.6.12.exheres-0
diff --git a/packages/net-libs/GeoIP/GeoIP.exlib b/packages/net-libs/GeoIP/GeoIP.exlib
index 27a3dba..24f119b 100644
--- a/packages/net-libs/GeoIP/GeoIP.exlib
+++ b/packages/net-libs/GeoIP/GeoIP.exlib
@@ -1,37 +1,37 @@
# Copyright 2009 Daniel Mierswa <impulze@impulze.org>
# Distributed under the terms of the GNU General Public License v2
-require github [ user='maxmind' pn='geoip-api-c' release=v${PV} pnv="${PN}-${PV}" suffix='tar.gz' ]
+require github [ user=maxmind pn=geoip-api-c release=v${PV} pnv=${PN}-${PV} suffix=tar.gz ]
-export_exlib_phases src_unpack src_install
+export_exlib_phases src_install
-SUMMARY="GeoIP C API - IP to Country lookup"
-DESCRIPTION="GeoIP C API allows to lookup IP addresses in a GeoLite Country database."
-DOWNLOADS+="
- http://geolite.maxmind.com/download/${PN,,}/database/GeoLiteCountry/${PN}.dat.gz
- http://geolite.maxmind.com/download/${PN,,}/database/GeoLiteCity.dat.gz
- http://geolite.maxmind.com/download/${PN,,}/database/${PN}v6.dat.gz
-"
+SUMMARY="GeoIP Legacy C API - IP to Country lookup"
+DESCRIPTION="GeoIP Legacy C API allows to lookup IP addresses in a GeoLite Legacy Country database."
LICENCES="GPL-2 LGPL-2.1 MaxMind"
SLOT="0"
MYOPTIONS=""
-RESTRICT="test" # all tests access all sorts of internet sites that we don't want
+# all tests access all sorts of internet sites that we don't want
+RESTRICT="test"
DEPENDENCIES=""
-GeoIP_src_unpack() {
- default
- edo mv "${WORKBASE}"/${PN}.dat "${WORK}"/data
-}
+DEFAULT_SRC_CONFIGURE_PARAMS=(
+ --disable-static
+)
GeoIP_src_install() {
default
- insinto /usr/share/${PN}
- doins "${WORKBASE}"/GeoLiteCity.dat
- doins "${WORKBASE}"/${PN}v6.dat
- edo ln -s GeoLiteCity.dat "${IMAGE}"/usr/share/${PN}/${PN}City.dat
+ dobin "${FILES}"/geoipupdate.sh
+
+ keepdir /usr/share/GeoIP
+}
+
+pkg_postinst() {
+ ewarn "WARNING: Databases are no longer installed by this exheres."
+ elog "Don't forget to run 'geoipupdate.sh -f' to populate /usr/share/GeoIP with geo-located IP"
+ elog "address databases."
}
diff --git a/packages/net-libs/GeoIP/files/geoipupdate.sh b/packages/net-libs/GeoIP/files/geoipupdate.sh
new file mode 100644
index 0000000..b6a0ab0
--- /dev/null
+++ b/packages/net-libs/GeoIP/files/geoipupdate.sh
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+GEOIP_MIRROR="https://download.maxmind.com/download/geoip/database"
+GEOIPDIR=/usr/share/GeoIP
+TMPDIR=
+
+DATABASES="
+ GeoIPv6
+ GeoLiteCity
+ GeoLiteCityv6-beta/GeoLiteCityv6
+ GeoLiteCountry/GeoIP
+ asnum/GeoIPASNum
+ asnum/GeoIPASNumv6
+"
+
+if [ "${1}" = -f ] || [ "${1}" = --force ]; then
+ force=true
+fi
+
+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)
+
+ if [ -f "${GEOIPDIR}/${fname}.dat" ] || [ ${force} ]; then
+ wget --no-verbose -t 3 -T 60 \
+ "${GEOIP_MIRROR}/${db}.dat.gz" \
+ -O "${TMPDIR}/${fname}.dat.gz"
+ if [ $? -eq 0 ]; then
+ gunzip -fdc "${TMPDIR}/${fname}.dat.gz" > "${TMPDIR}/${fname}.dat"
+ mv "${TMPDIR}/${fname}.dat" "${GEOIPDIR}/${fname}.dat"
+ chmod 0644 "${GEOIPDIR}/${fname}.dat"
+ case ${fname} in
+ GeoLite*) ln -sf ${fname}.dat `echo ${fname} | sed 's/GeoLite/GeoIP/'`.dat ;;
+ esac
+ fi
+ fi
+ done
+ [ -d "${TMPDIR}" ] && rm -rf $TMPDIR
+ fi
+fi