aboutsummaryrefslogtreecommitdiffstats
path: root/net/GeoIP
diff options
context:
space:
mode:
Diffstat (limited to 'net/GeoIP')
-rw-r--r--net/GeoIP/Makefile4
-rw-r--r--net/GeoIP/files/geoipupdate.sh.in28
-rw-r--r--net/GeoIP/files/pkg-message.in4
3 files changed, 33 insertions, 3 deletions
diff --git a/net/GeoIP/Makefile b/net/GeoIP/Makefile
index 454a21d3c0e7..e2ab94a238f0 100644
--- a/net/GeoIP/Makefile
+++ b/net/GeoIP/Makefile
@@ -3,7 +3,7 @@
PORTNAME= GeoIP
PORTVERSION= 1.4.8
-PORTREVISION= 6
+PORTREVISION= 7
CATEGORIES= net geography
MASTER_SITES= http://geolite.maxmind.com/download/geoip/api/c/
@@ -16,7 +16,7 @@ USE_LDCONFIG= yes
USE_AUTOTOOLS= aclocal automake libtool libtoolize autoconf
AUTOMAKE_ARGS= --add-missing
-SUB_FILES= geoipupdate.sh
+SUB_FILES= geoipupdate.sh pkg-message
post-install:
${INSTALL_SCRIPT} ${WRKDIR}/geoipupdate.sh ${STAGEDIR}${PREFIX}/bin
diff --git a/net/GeoIP/files/geoipupdate.sh.in b/net/GeoIP/files/geoipupdate.sh.in
index 89145deaf6b3..6e937aa32579 100644
--- a/net/GeoIP/files/geoipupdate.sh.in
+++ b/net/GeoIP/files/geoipupdate.sh.in
@@ -1,2 +1,28 @@
#!/bin/sh
-fetch -o - http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | gunzip > %%DATADIR%%/GeoIP.dat
+
+TEMPFILE=`mktemp %%DATADIR%%/GeoIP.dat-XXXXXX`
+if fetch -o - http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz | gunzip >> $TEMPFILE ; then
+ chmod 644 $TEMPFILE
+ if ! mv $TEMPFILE %%DATADIR%%/GeoIP.dat ; then
+ rm $TEMPFILE
+ echo Unable to overwrite %%DATADIR%%/GeoIP.dat
+ exit 2
+ fi
+else
+ rm $TEMPFILE
+ echo GeoIP.dat download failed
+ exit 1
+fi
+TEMPFILE=`mktemp %%DATADIR%%/GeoIPv6.dat-XXXXXX`
+if fetch -o - http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz | gunzip >> $TEMPFILE ; then
+ chmod 644 $TEMPFILE
+ if ! mv $TEMPFILE %%DATADIR%%/GeoIPv6.dat ; then
+ rm $TEMPFILE
+ echo Unable to overwrite %%DATADIR%%/GeoIPv6.dat
+ exit 2
+ fi
+else
+ rm $TEMPFILE
+ echo GeoIPv6.dat download failed
+ exit 1
+fi
diff --git a/net/GeoIP/files/pkg-message.in b/net/GeoIP/files/pkg-message.in
new file mode 100644
index 000000000000..33d448300daa
--- /dev/null
+++ b/net/GeoIP/files/pkg-message.in
@@ -0,0 +1,4 @@
+GeoIP does not ship with the latest data file, and it does
+not ship with any IPv6 data! To obtain the latest v4 and v6
+data, run:
+# %%PREFIX%%/bin/geoipupdate.sh