goip2-databases: Update to 20180116

This commit is contained in:
Alexey Pavlov
2018-01-18 14:14:23 +03:00
parent 0d1cc4d8bc
commit f2abbceccd
2 changed files with 45 additions and 9 deletions

View File

@@ -3,25 +3,38 @@
_realname=geoip2-database
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=20150720
pkgver=20180116
pkgrel=1
pkgdesc="GeoLite country geolocation database compiled by MaxMind (mingw-w64)"
arch=('any')
url="https://www.maxmind.com/en/geoip2-services-and-databases"
url="https://dev.maxmind.com/geoip/geoip2/geolite2/"
license=('custom:Creative Commons Attribution-ShareAlike 3.0 Unported')
source=(GeoLite2-Country-${pkgver}.mmdb.gz::https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
#GeoLite2-City-${pkgver}.mmdb.gz::https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
)
sha256sums=('4819459376f61423f5fb96eff141bf486d8e6133c47acd832d2ba87a39f2a922')
source=(GeoLite2-City-${pkgver}.tar.gz::https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
GeoLite2-Country-${pkgver}.tar.gz::https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz
GeoLite2-ASN-${pkgver}.tar.gz::https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz)
noextract=(GeoLite2-City-${pkgver}.tar.gz
GeoLite2-Country-${pkgver}.tar.gz
GeoLite2-ASN-${pkgver}.tar.gz)
sha256sums=('025932f30ad6b5e77e1501cb953c87c77ca46eed5e22034e6cc3f206547db419'
'788ec447ffbb408f484fbf43454141553882c214bd5b8d39accb82bcc3be9f27'
'f717a9f562ff84bc129be75bb4fecd6fb1f66f384fd7202eca8872e83efa2afa')
prepare() {
cd "${srcdir}"
mv GeoLite2-Country-${pkgver}.mmdb GeoLite2-Country.mmdb
for _db in GeoLite2-{City,Country,ASN}; do
tar --strip-components=1 -xf ${_db}-${pkgver}.tar.gz --wildcards "*/${_db}.mmdb"
done
tar --strip-components=1 -xf GeoLite2-ASN-${pkgver}.tar.gz --wildcards "*/COPYRIGHT.txt" "*/LICENSE.txt"
}
package() {
cd "${srcdir}"
install -d "${pkgdir}${MINGW_PREFIX}/share/GeoIP2"
install -m644 -t "${pkgdir}${MINGW_PREFIX}/share/GeoIP2" GeoLite2-Country.mmdb
install -d "${pkgdir}${MINGW_PREFIX}/share/GeoIP"
install -m644 -t "${pkgdir}${MINGW_PREFIX}/share/GeoIP" GeoLite2-{City,Country,ASN}.mmdb
install -Dm644 COPYRIGHT.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/COPYRIGHT.txt"
install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE.txt"
}

View File

@@ -0,0 +1,23 @@
#!/bin/bash -e
# Unicode characters taken from pactree.c
UNICODE_IS_FUN="\u2514\u2500"
verbose=0
if [[ $1 == -v ]]; then
verbose=1
fi
URLS=(http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz
http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz)
for url in ${URLS[@]}; do
last_mod=$(curl -sI $url | grep -i ^Last-Modified: | cut -d' ' -f2- | tr -d '\r')
echo "$last_mod (${url##*/})"
if ((verbose)); then
build_id=$(curl -s $url | gzip -cd | grep -aoE '[0-9]{8} Build [0-9]*')
echo -e "${UNICODE_IS_FUN}$build_id"
fi
done