summaryrefslogtreecommitdiffstats
path: root/abs/extra/geoip-database/PKGBUILD
blob: 7b8d4d95377a0878e19a40a921d52b5167194731 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# $Id: PKGBUILD 163822 2012-07-20 22:15:57Z foutrelis $
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>

pkgname=geoip-database
pkgver=20120706
pkgrel=1
pkgdesc="GeoLite country geolocation database compiled by MaxMind"
arch=('any')
url="http://www.maxmind.com/app/ip-location"
license=('custom:OPEN DATA LICENSE')
source=(GeoIP-$pkgver.dat.gz::http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
        GeoIPv6-$pkgver.dat.gz::http://geolite.maxmind.com/download/geoip/database/GeoIPv6.dat.gz
        http://geolite.maxmind.com/download/geoip/database/LICENSE.txt)
noextract=(GeoIP-$pkgver.dat.gz
           GeoIPv6-$pkgver.dat.gz)

build() {
  cd "$srcdir"

  for _database_name in GeoIP GeoIPv6; do
    gunzip -c $_database_name-$pkgver.dat.gz >$_database_name.dat
  done
}

check() {
  cd "$srcdir"

  for _database in {GeoIP,GeoIPv6}.dat; do
    if ! grep -q 'MaxMind Inc All Rights Reserved' $_database; then
      error "Copyright notice is missing from $_database; something is fishy!"
      return 1
    fi
  done
}

package() {
  cd "$srcdir"

  install -d "$pkgdir/usr/share/GeoIP"
  install -m644 -t "$pkgdir/usr/share/GeoIP" GeoIP.dat GeoIPv6.dat

  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE.txt"
}

# vim:set ts=2 sw=2 et:
md5sums=('1bfcf1600cabcae5ff37fbddf82ba231'
         '586740960300f6c5018eef279214d2b8'
         'a1381bd1aa0a0c91dc31b3f1e847cf4a')