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=('e0133aafa62accfe57dea6d454c02f22a65aaba7775cbb4539f2a271da097db5'
19 'e5745bdf59be2c2be5bc4f1d97306158b0e74db971540319dcfd40c59ab71739'
20 'd4ac6997a838a51e83ebae824558fa768a07986afb5793afa8dc146dd5f8ad88'
21 'faf1d4f2bfaddcacfb195ecb10dce4b02d1c7cf6e23d1dd849a4a8baa8e4299b'
22 '3c2262cc641d1f9eae272973c211e89b3771feb5123747ab1f38d2a0518acb9a'
23 'ad98a4e2ab55c7d93df4188b8b55c8aa9587415a2e5b7f713f067b46aab26f89')
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: