summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 181b12da3cf13e75149942cc0136dde198282ca9 (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
# Maintainer: Kemel Zaidan <kemelzaidan@gmail.com>
pkgname=rdap-client
pkgver=1.2.0
pkgrel=2
pkgdesc="RDAP command line client from Registro.br"
arch=('x86_64' 'i686' 'aarch64')
url="https://github.com/registrobr/rdap-client"
license=('BSD-2-Clause')
depends=("glibc")
makedepends=("go>=1.15")
provides=("rdap-client")
conflicts=("rdap-client" "rdap-client-git")
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('56aa0c74f3d991a124038799f0aa89bd597b472845ddaeffc7506f20cc3169f7')

prepare() {
	cd "${pkgname}-${pkgver}"
	mkdir -p build
	go mod download
}

# tests not passing...
# check() {
# 	cd "${pkgname}-${pkgver}"
# 	go test -v ./..
# }

build() {
	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"
	cd "${pkgname}-${pkgver}"
	go build -o build .
}

package() {
	cd "${pkgname}-${pkgver}"
	install -Dm755 build/${pkgname} "${pkgdir}/usr/bin/${pkgname}"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}