Hi ports@,

Here is a diff to update a few things in the net/libmaxminddb port:

- Update the geolite2 maintainer target to cope with new upstream
  packaging scheme, and also fetch the ASN database
- Add a subpackage for the ASN database
- Update GeoLite2 databases to latest version

Comments? OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/libmaxminddb/Makefile,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile
--- Makefile    4 Jun 2017 10:57:59 -0000       1.13
+++ Makefile    8 Jun 2017 14:01:11 -0000
@@ -3,16 +3,18 @@
 COMMENT-main = library for MaxMind GeoIP2/GeoLite2 IP geolocation databases
 COMMENT-db =   GeoIP2 GeoLite2 database: IPv4/v6 address to country
 COMMENT-city = GeoIP2 GeoLite2 database: IPv4/v6 address to city
+COMMENT-asn =  GeoIP2 GeoLite2 database: IPv4/v6 address to AS number
 
 V =            1.2.1
-D =            20170503
+D =            20170608
 DISTNAME =     libmaxminddb-${V}
 PKGNAME-main = libmaxminddb-${V}
 PKGNAME-db =   geolite2-country-${D}
 PKGNAME-city = geolite2-city-${D}
+PKGNAME-asn =  geolite2-asn-${D}
 DISTFILES =    ${DISTNAME}${EXTRACT_SUFX} \
                geolite2-data-$D.tar.xz:0
-REVISION =     0
+REVISION-main =        0
 
 SHARED_LIBS += maxminddb       0.0     # 0.7
 
@@ -31,7 +33,7 @@ WANTLIB-main +=       c m
 MASTER_SITES = ${HOMEPAGE}/releases/download/${V}/
 MASTER_SITES0 =        https://www.distfiles.pl/
 
-MULTI_PACKAGES = -main -db -city
+MULTI_PACKAGES = -main -db -city -asn
 RUN_DEPENDS-main = net/libmaxminddb,-db
 
 TEST_DEPENDS = devel/p5-IPC-Run3
@@ -56,13 +58,16 @@ geolite2:
        echo "see https://www.maxmind.com and 
https://dev.maxmind.com/geoip/geoip2/geolite2/."; >> README; \
        echo "Distributed under Creative Commons Attribution-ShareAlike 4.0 
International License." >> README; \
        echo "Created at `date -z UTC` and intended for OS packaging purposes." 
>> README; \
-       ftp 
https://geolite.maxmind.com/download/geoip/database/GeoLite2-{Country,City}.{md5,mmdb.gz};
 \
-       gunzip *gz; \
-       for file in GeoLite2-Country GeoLite2-City; do \
-               if [ "`md5 -q $$file.mmdb`" != "`cat $$file.md5`" ]; then \
-                       echo "ERROR: $$file.mmdb is corrupt"; \
+       ftp 
https://geolite.maxmind.com/download/geoip/database/GeoLite2-{Country,City,ASN}.{tar.gz,tar.gz.md5};
 \
+       for file in GeoLite2-Country GeoLite2-City GeoLite2-ASN; do \
+               if [ "`md5 -q $$file.tar.gz`" != "`cat $$file.tar.gz.md5`" ]; 
then \
+                       echo "ERROR: $$file.tar.gz is corrupt"; \
                        exit; \
                fi; \
+               tar xfz $$file.tar.gz; \
+       done; \
+       for file in `find * -type f | grep mmdb`; do \
+               mv $$file .; \
        done; \
        cd ..; \
        tar cf - data/README data/*.mmdb | xz -T 0 > $$distfile; \
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/libmaxminddb/distinfo,v
retrieving revision 1.12
diff -u -p -r1.12 distinfo
--- distinfo    16 May 2017 08:11:27 -0000      1.12
+++ distinfo    8 Jun 2017 14:01:11 -0000
@@ -1,4 +1,4 @@
-SHA256 (geolite2-data-20170503.tar.xz) = 
Jvi75Q7dMcYsPCzWAPQtCi03uNEEqfw8h2W5x9XCy00=
+SHA256 (geolite2-data-20170608.tar.xz) = 
Nz8oqVqK92lZCeXP1dG2L1QoJwi6DJ8V53A4+MZciSw=
 SHA256 (libmaxminddb-1.2.1.tar.gz) = 
n6KzNByciBF/WEVN+y3RBJFaM32TyKmnNZMaY7N/e/o=
-SIZE (geolite2-data-20170503.tar.xz) = 17390448
+SIZE (geolite2-data-20170608.tar.xz) = 19503060
 SIZE (libmaxminddb-1.2.1.tar.gz) = 614448
Index: pkg/DESCR-asn
===================================================================
RCS file: pkg/DESCR-asn
diff -N pkg/DESCR-asn
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/DESCR-asn       8 Jun 2017 14:01:11 -0000
@@ -0,0 +1,5 @@
+This package contains a snapshot of the free GeoLite2 ASN database
+under CC BY-SA 4.0 license.
+
+"This product includes GeoLite2 data created by MaxMind, available from
+http://www.maxmind.com.";
Index: pkg/PLIST-asn
===================================================================
RCS file: pkg/PLIST-asn
diff -N pkg/PLIST-asn
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ pkg/PLIST-asn       8 Jun 2017 14:01:11 -0000
@@ -0,0 +1,5 @@
+@comment $OpenBSD$
+share/examples/libmaxminddb/
+@sample ${LOCALSTATEDIR}/db/GeoIP/
+share/examples/libmaxminddb/GeoLite2-ASN.mmdb
+@sample ${LOCALSTATEDIR}/db/GeoIP/GeoLite2-ASN.mmdb

Reply via email to