1 # Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
3 pkgname=('geoip-database' 'geoip-database-extra')
7 url="https://mailfud.org/geoip-legacy/"
9 makedepends=('util-linux')
10 checkdepends=('geoip')
11 _source_base=https://sources.archlinux.org/other/packages/$pkgname/$pkgver
12 source=(GeoIP-$pkgver.dat.gz::$_source_base/GeoIP.dat.gz
13 GeoIPv6-$pkgver.dat.gz::$_source_base/GeoIPv6.dat.gz
14 GeoIPCity-$pkgver.dat.gz::$_source_base/GeoIPCity.dat.gz
15 GeoIPCityv6-$pkgver.dat.gz::$_source_base/GeoIPCityv6.dat.gz
16 GeoIPASNum-$pkgver.dat.gz::$_source_base/GeoIPASNum.dat.gz
17 GeoIPASNumv6-$pkgver.dat.gz::$_source_base/GeoIPASNumv6.dat.gz)
18 sha256sums=('17cc005ce719b846a46d2248005136ff105d0a36bbde9c03f58a1ba4de0b274b'
19 '5777bb21f864e485cce44aed3a540b36757564adf6c53cb41bbad46d178e0528'
20 'a77f82e60506279bd1af23beca838fee8dcedc1754929cd776382cf8df3606d4'
21 '78e99bf1dcd75e625250c7baa71dfb07cff0705f6ca3d68c06a0c5d212bd9499'
22 'fb7869cb8a24d8bbbf60d156ee69c2c9d14681020f2c5b61f6fc1ae39aed9dde'
23 'a5fb4d75c6ea693d6defff598aa268c78b8c7765075bcaa60c7052458729e35d')
27 rename -v -- "-$pkgver" '' *.dat
33 if [[ $(geoiplookup -f GeoIP.dat 8.8.8.8) != *'US, United States' ]]; then
34 echo >&2 'Unable to resolve IPv4 address to country.'
38 if [[ $(geoiplookup6 -f GeoIPv6.dat 2001:4860:4860::8888) != *'US, United States' ]]; then
39 echo >&2 'Unable to resolve IPv6 address to country.'
43 if [[ $(geoiplookup -f GeoIPCity.dat 8.8.8.8) != *'US, 00, N/A, N/A'* ]]; then
44 echo >&2 'Unable to resolve IPv4 address to city.'
48 if [[ $(geoiplookup6 -f GeoIPCityv6.dat 2001:4860:4860::8888) != *'US, 00, N/A, N/A'* ]]; then
49 echo >&2 'Unable to resolve IPv6 address to city.'
53 if [[ $(geoiplookup -f GeoIPASNum.dat 8.8.8.8) != *'AS15169 GOOGLE' ]]; then
54 echo >&2 'Unable to resolve IPv4 address to ASN.'
58 if [[ $(geoiplookup6 -f GeoIPASNumv6.dat 2001:4860:4860::8888) != *'AS15169 GOOGLE' ]]; then
59 echo >&2 'Unable to resolve IPv6 address to ASN.'
64 package_geoip-database() {
65 pkgdesc="GeoIP legacy country database (based on GeoLite2 data created by MaxMind)"
69 install -d "$pkgdir/usr/share/GeoIP"
70 install -m644 -t "$pkgdir/usr/share/GeoIP" GeoIP{,v6}.dat
73 package_geoip-database-extra() {
74 pkgdesc="GeoIP legacy city/ASN databases (based on GeoLite2 data created by MaxMind)"
78 install -d "$pkgdir/usr/share/GeoIP"
79 install -m644 -t "$pkgdir/usr/share/GeoIP" GeoIPCity{,v6}.dat GeoIPASNum{,v6}.dat
82 # vim:set ts=2 sw=2 et: