blob: 089b7fbccc4585973f01660da2c7bbe49db06f05 (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# Maintainer: Caleb Maclennan <caleb@alerque.com>
pkgname=dgop-git
_pkgname=${pkgname%-git}
pkgver=0.1.6.r0.g0e85650
pkgrel=1
pkgdesc='System monitoring CLI + REST API (git snapshot)'
arch=(x86_64 aarch64 armv7h)
url="https://github.com/AvengeMedia/$_pkgname"
license=(MIT)
depends=(glibc)
makedepends=(git
go)
provides=("dgop=$pkgver")
conflicts=(dgop)
source=("git+$url.git")
sha256sums=('SKIP')
pkgver() {
cd "$_pkgname"
git describe --long --tags --abbrev=7 --match="v*" HEAD |
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
mkdir -p gomodcache
}
build() {
cd "$_pkgname"
export GOMODCACHE="$srcdir/gomodcache"
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 -o $_pkgname ./cmd/cli
}
check() {
cd "$_pkgname"
export GOMODCACHE="$srcdir/gomodcache"
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"
# don't fail the package on WIP tests, but still run with writable mod cache
go test ./... || true
}
package() {
cd "$_pkgname"
install -Dm0755 -t "$pkgdir/usr/bin/" "$_pkgname"
install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}
|