summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorIP2Location2024-01-18 16:23:25 +0800
committerIP2Location2024-01-18 16:23:25 +0800
commit4af30b0f94ea201839fd3f0d3bc92189f142381e (patch)
treeb17ccdf0870989b3879c290a13a31db0c1569fb6 /PKGBUILD
downloadaur-4af30b0f94ea201839fd3f0d3bc92189f142381e.tar.gz
New package.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD40
1 files changed, 40 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e73f5adec931
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,40 @@
+# Maintainer: IP2Location <support@ip2location.com>
+pkgname=ip2loaction-io-cli
+_pkgname=${pkgname%}
+pkgver=1.1.0
+pkgrel=1
+pkgdesc="Official Command Line Interface for IP2Loaction.io Geolocation API service"
+arch=('x86_64' 'armv7h' 'aarch64')
+url="https://www.ip2location.io"
+license=('MIT')
+depends=('glibc')
+makedepends=('go')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/ip2location/ip2location-io-cli/archive/refs/tags/$v$pkgver.tar.gz")
+sha256sums=('86caf3202b8daea3a58aa3be3caa8514312116fba659d8e9e212e37b651b9f0d')
+
+prepare() {
+ cd "cli-${_pkgname}-$pkgver"
+ export GOPATH="$srcdir/gopath"
+
+ # download dependencies
+ go mod download -x
+}
+
+build() {
+ cd "cli-${_pkgname}-$pkgver"
+ export GOPATH="$srcdir/gopath"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ go build -v -o build "./${_pkgname}"
+
+ # Clean module cache for makepkg -C
+ go clean -modcache
+}
+
+package() {
+ cd "cli-${_pkgname}-$pkgver"
+ install -Dm755 "build/${_pkgname}" -t "$pkgdir/usr/bin/"
+} \ No newline at end of file