summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1f8f3574a0c2490bd028d6d98a2c1a912ae6503a (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
# Maintainer: hashworks <mail@hashworks.net>
pkgname=srrdb-terminal-client
pkgver=1.1.5
pkgrel=3
pkgdesc="A terminal client to access srrdb.com"
arch=("x86_64")
url="https://github.com/hashworks/srrdb-Terminal-Client"
license=("GPL3")
changelog=CHANGELOG
makedepends=('go')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=("957a4891937123f8b88d8155d2c55ce8e8a7428df11afa72b91c67159d8f2f42")

prepare(){
	cd "srrdb-Terminal-Client-${pkgver}"
	mkdir -p build/
}

build() {
	cd "srrdb-Terminal-Client-${pkgver}"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS}"
	export CGO_CXXFLAGS="${CXXFLAGS}"
	export CGO_LDFLAGS="${LDFLAGS}"
	export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
	go build -ldflags '-X main.VERSION='"${pkgver}"' -X main.BUILD_DATE='"$(date -d@"${SOURCE_DATE_EPOCH}" +"%Y-%m-%d_%H:%M:%S")"'' -o build .
}

check() {
	cd "srrdb-Terminal-Client-${pkgver}"
	go test .
}

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