lilac/repo/sing-geoip/PKGBUILD
2024-05-15 14:02:02 +00:00

34 lines
863 B
Bash

# Maintainer: bgme <i@bgme.me>
pkgname=sing-geoip
pkgver=20240512
pkgrel=2
pkgdesc='sing-geoip database'
arch=('any')
url="https://github.com/SagerNet/sing-geoip"
license=('custom:sing-geoip')
makedepends=('git' 'go' 'jq')
source=("git+https://github.com/SagerNet/sing-geoip.git")
sha256sums=('SKIP')
pkgver() {
curl -s https://api.github.com/repos/Dreamacro/maxmind-geoip/releases/latest | jq -r ".name"
}
build() {
export NO_SKIP=true
cd "${srcdir}/${pkgname}"
go run -v .
}
package() {
cd "${srcdir}/${pkgname}"
install -Dm644 "geoip-cn.db" "${pkgdir}/usr/share/${pkgname}/geoip-cn.db"
install -Dm644 "geoip.db" "${pkgdir}/usr/share/${pkgname}/geoip.db"
install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
cd "rule-set"
install -Dm644 -t "${pkgdir}/usr/share/${pkgname}/rule-set" ./*.srs
}