initial import
This commit is contained in:
104
geoip-database/PKGBUILD
Normal file
104
geoip-database/PKGBUILD
Normal file
@@ -0,0 +1,104 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgbase=geoip-database
|
||||
pkgname=('geoip-database' 'geoip-database-extra')
|
||||
pkgver=20210714
|
||||
pkgrel=0
|
||||
arch=('any')
|
||||
url="https://mailfud.org/geoip-legacy/"
|
||||
license=('CC-BY-SA-4.0')
|
||||
makedepends=('util-linux')
|
||||
checkdepends=('geoip')
|
||||
_source_base="https://edurepo.conocimientoslibres.ga/sources/other/${pkgbase}/${pkgver}"
|
||||
source=("GeoIP-${pkgver}.dat.gz::${_source_base}/GeoIP.dat.gz"
|
||||
"GeoIP-${pkgver}.dat.gz.sig::${_source_base}/GeoIP.dat.gz.sig"
|
||||
"GeoIPv6-${pkgver}.dat.gz::${_source_base}/GeoIPv6.dat.gz"
|
||||
"GeoIPv6-${pkgver}.dat.gz.sig::${_source_base}/GeoIPv6.dat.gz.sig"
|
||||
"GeoIPCity-${pkgver}.dat.gz::${_source_base}/GeoIPCity.dat.gz"
|
||||
"GeoIPCity-${pkgver}.dat.gz.sig::${_source_base}/GeoIPCity.dat.gz.sig"
|
||||
"GeoIPCityv6-${pkgver}.dat.gz::${_source_base}/GeoIPCityv6.dat.gz"
|
||||
"GeoIPCityv6-${pkgver}.dat.gz.sig::${_source_base}/GeoIPCityv6.dat.gz.sig"
|
||||
"GeoIPASNum-${pkgver}.dat.gz::${_source_base}/GeoIPASNum.dat.gz"
|
||||
"GeoIPASNum-${pkgver}.dat.gz.sig::${_source_base}/GeoIPASNum.dat.gz.sig"
|
||||
"GeoIPASNumv6-${pkgver}.dat.gz::${_source_base}/GeoIPASNumv6.dat.gz"
|
||||
"GeoIPASNumv6-${pkgver}.dat.gz.sig::${_source_base}/GeoIPASNumv6.dat.gz.sig"
|
||||
'COPYING::https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt')
|
||||
sha512sums=('b74f0d570b7d398a31e808b5c5a3f34ad571c72cb6335555a731640976738d5087fd1e3e0eef3d58c47310cc3de48737a8c61ea62c8ad268d62eed707e986b02'
|
||||
'SKIP'
|
||||
'636e74f8bb33d126f7c49f4939fc28e24ed61691d6378bf446c167bf5d9fe54a1b297eca7df0600e7dec34d97f4eaadec06c5df476dd6b56804b2a738f9c69f3'
|
||||
'SKIP'
|
||||
'c79d9baac060ae4701cebc168b8774ce38156ebd2f814355c6c89f9ac0e64da9d55772b91236562cd45028aa0a4eab14c82fb76d26dcf10b86f40ca2eb1e1b2c'
|
||||
'SKIP'
|
||||
'6b6ae56e8335be23aa1733b13c0fd099fb98bfec7a6afe2301f68d282fbd7ea2432b2938012d092d5121a055e297727db8fca6a361d17a7d8e848beb3cd5f3d7'
|
||||
'SKIP'
|
||||
'3e4fc04cb9734d2f8696fc05fb7575c4f9ec42e97bc772eb610eb409feda0fc0b20ee2b9a221cf5449139c416ef1b15579d9ab4bd5e8623b647d7c453de53dfa'
|
||||
'SKIP'
|
||||
'76e217938c35b2a488195a5314eff9f1e299e52c87a3f5989f6bcb1cb42f372c4b9746b45dc95798e83116d71fc6d4044a4e9f38049428e770a8a017fb2ea4b7'
|
||||
'SKIP'
|
||||
'a73901952351f0e76fcb56cd345564098cc937fb873c811fa13f3d3fdb2c65d50287c67619487e52e7ae6ccb00b835eae94c19668a25f1dd702f127874489204')
|
||||
validpgpkeys=('4DF21B6A7C1021B25C360914F6EE7BC59A315766') # Jesús E.
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}"
|
||||
rename -v -- "-${pkgver}" '' *.dat
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "${srcdir}"
|
||||
|
||||
if [[ $(geoiplookup -f GeoIP.dat 95.217.229.211) != *'FI, Finland' ]]; then
|
||||
echo >&2 'Unable to resolve IPv4 address to country.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $(geoiplookup6 -f GeoIPv6.dat 2a01:4f9:4b:39ea::301) != *'DE, Germany' ]]; then
|
||||
echo >&2 'Unable to resolve IPv6 address to country.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $(geoiplookup -f GeoIPCity.dat 95.217.229.211) != *'FI, 18, N/A, Helsinki'* ]]; then
|
||||
echo >&2 'Unable to resolve IPv4 address to city.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $(geoiplookup6 -f GeoIPCityv6.dat 2a01:4f9:4b:39ea::301) != *'DE, 00, N/A, N/A'* ]]; then
|
||||
echo >&2 'Unable to resolve IPv6 address to city.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $(geoiplookup -f GeoIPASNum.dat 95.217.229.211) != *'AS24940 Hetzner Online GmbH' ]]; then
|
||||
echo >&2 'Unable to resolve IPv4 address to ASN.'
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ $(geoiplookup6 -f GeoIPASNumv6.dat 2a01:4f9:4b:39ea::301) != *'AS24940 Hetzner Online GmbH' ]]; then
|
||||
echo >&2 'Unable to resolve IPv6 address to ASN.'
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
package_geoip-database() {
|
||||
pkgdesc="GeoIP legacy country database (based on GeoLite2 data created by MaxMind)"
|
||||
|
||||
cd "${srcdir}"
|
||||
|
||||
install -d "${pkgdir}/usr/share/GeoIP"
|
||||
for i in GeoIP{,v6}.dat; do
|
||||
install -m644 "$i" "${pkgdir}/usr/share/GeoIP"
|
||||
done
|
||||
install -Dm644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
||||
}
|
||||
|
||||
package_geoip-database-extra() {
|
||||
pkgdesc="GeoIP legacy city/ASN databases (based on GeoLite2 data created by MaxMind)"
|
||||
|
||||
cd "${srcdir}"
|
||||
|
||||
install -d "${pkgdir}/usr/share/GeoIP"
|
||||
for i in GeoIPCity{,v6}.dat GeoIPASNum{,v6}.dat; do
|
||||
install -m644 "$i" "${pkgdir}/usr/share/GeoIP"
|
||||
done
|
||||
install -Dm644 COPYING -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
||||
}
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
||||
Reference in New Issue
Block a user