2017-11-03 10:26:11 +00:00
|
|
|
# $OpenBSD: Makefile,v 1.52 2017/11/03 10:26:11 sthen Exp $
|
2003-06-27 14:55:35 +00:00
|
|
|
|
2016-03-01 00:06:57 +00:00
|
|
|
COMMENT-main= find the country where IP address/hostname originates from
|
|
|
|
COMMENT-db= GeoIP GeoLite database: IPv4/v6 address to country
|
|
|
|
COMMENT-city= GeoIP GeoLite database: IPv4/v6 address to city
|
|
|
|
COMMENT-asn= GeoIP GeoLite database: IPv4/v6 address to AS number
|
2003-06-27 14:55:35 +00:00
|
|
|
|
2017-05-17 13:52:33 +00:00
|
|
|
V= 1.6.11
|
2017-11-03 10:26:11 +00:00
|
|
|
D= 20171103
|
2014-03-18 17:56:36 +00:00
|
|
|
DISTNAME= GeoIP-$V
|
2016-03-01 00:06:57 +00:00
|
|
|
PKGNAME-main= GeoIP-$V
|
|
|
|
PKGNAME-db= geolite-country-$D
|
|
|
|
PKGNAME-city= geolite-city-$D
|
|
|
|
PKGNAME-asn= geolite-asn-$D
|
2014-04-12 09:58:43 +00:00
|
|
|
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
|
2016-03-01 00:06:57 +00:00
|
|
|
geolite-data-$D.tar.xz:0
|
2014-03-18 17:56:36 +00:00
|
|
|
|
2014-11-01 09:43:57 +00:00
|
|
|
SHARED_LIBS += GeoIP 9.0 # 7.3
|
2014-03-18 17:56:36 +00:00
|
|
|
|
2006-11-02 07:03:29 +00:00
|
|
|
CATEGORIES= net geo
|
2003-06-27 14:55:35 +00:00
|
|
|
|
2017-02-08 10:52:30 +00:00
|
|
|
HOMEPAGE= https://dev.maxmind.com/geoip/legacy/downloadable/
|
2014-11-01 09:43:57 +00:00
|
|
|
|
|
|
|
MAINTAINER= Stuart Henderson <sthen@openbsd.org>
|
2003-06-27 14:55:35 +00:00
|
|
|
|
2016-05-26 15:21:09 +00:00
|
|
|
# geoip-api-c: LGPLv2.1+
|
|
|
|
# geolite DBs: CC BY-SA 4.0
|
2003-06-27 14:55:35 +00:00
|
|
|
PERMIT_PACKAGE_CDROM= Yes
|
2012-07-11 09:38:39 +00:00
|
|
|
|
2016-03-01 00:06:57 +00:00
|
|
|
WANTLIB-main += c
|
2003-06-27 14:55:35 +00:00
|
|
|
|
2014-11-01 09:43:57 +00:00
|
|
|
MASTER_SITES= https://github.com/maxmind/geoip-api-c/releases/download/v$V/
|
2015-12-03 21:24:29 +00:00
|
|
|
MASTER_SITES0= https://spacehopper.org/mirrors/
|
2009-03-08 12:44:45 +00:00
|
|
|
|
2016-03-01 00:06:57 +00:00
|
|
|
MULTI_PACKAGES= -main -db -city -asn
|
|
|
|
RUN_DEPENDS-main= net/GeoIP,-db
|
|
|
|
|
2003-06-27 14:55:35 +00:00
|
|
|
CONFIGURE_STYLE= gnu
|
2014-11-01 09:43:57 +00:00
|
|
|
SEPARATE_BUILD= Yes
|
2016-03-11 20:07:49 +00:00
|
|
|
CONFIGURE_ARGS= --datadir=${LOCALSTATEDIR}/db
|
2012-07-11 09:38:39 +00:00
|
|
|
|
2014-03-18 17:56:36 +00:00
|
|
|
post-install:
|
|
|
|
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/GeoIP/
|
|
|
|
${INSTALL_DATA} ${WRKDIR}/data/* ${PREFIX}/share/examples/GeoIP/
|
|
|
|
chown -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/share/examples/GeoIP/
|
|
|
|
|
|
|
|
pre-test:
|
|
|
|
ln -s ../data ${WRKSRC}/data
|
|
|
|
|
|
|
|
# maintainer convenience target
|
|
|
|
geolite:
|
|
|
|
t=`mktemp -d /tmp/geoip.XXXXXXXXXX`; \
|
2014-04-12 09:58:43 +00:00
|
|
|
d=`date +%Y%m%d`; \
|
2016-03-01 00:06:57 +00:00
|
|
|
f=geolite-data-$${d}.tar.xz; \
|
2014-03-18 17:56:36 +00:00
|
|
|
cd $$t; \
|
|
|
|
mkdir data; \
|
|
|
|
cd data; \
|
|
|
|
echo "This file contains an unmodified dated snapshot of GeoLite data from MaxMind," > readme.txt; \
|
2017-02-08 10:52:30 +00:00
|
|
|
echo "see https://www.maxmind.com and https://dev.maxmind.com/geoip/legacy/geolite/." >> readme.txt; \
|
2016-06-03 10:59:00 +00:00
|
|
|
echo "Distributed under Creative Commons Attribution-ShareAlike 4.0 Unported License." >> readme.txt; \
|
2014-03-18 17:56:36 +00:00
|
|
|
echo "Created at `date -z UTC` and intended for OS packaging purposes." >> readme.txt; \
|
2017-02-08 10:52:30 +00:00
|
|
|
ftp https://geolite.maxmind.com/download/geoip/database/{GeoIPv6,GeoLiteCity,GeoLiteCityv6-beta/GeoLiteCityv6,GeoLiteCountry/GeoIP}.dat.gz https://download.maxmind.com/download/geoip/database/asnum/GeoIPASNum{,v6}.dat.gz; \
|
2014-03-18 17:56:36 +00:00
|
|
|
gunzip *gz; \
|
|
|
|
cd ..; \
|
2016-03-01 00:06:57 +00:00
|
|
|
tar cf - data | xz -T 0 > $$f; \
|
2016-10-07 10:22:24 +00:00
|
|
|
scp $$f naiad:mirrors/; \
|
|
|
|
rm -r $$t
|
2003-06-27 14:55:35 +00:00
|
|
|
|
|
|
|
.include <bsd.port.mk>
|