blob: 96710e4537d282a200272178c41634630cf35fac (
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# Maintainer: Brody <archfan at brodix dot de>
# build debugging stuff or not
: ${_build_debug_enabled:=false}
pkgname=directpv
pkgdesc='CSI driver for Direct Attached Storage'
pkgver=4.1.5
pkgrel=2
arch=(x86_64)
url=https://min.io/docs/directpv/
_url=https://github.com/minio/directpv
license=(AGPL-3.0-only)
depends=(glibc)
makedepends=(go)
if [[ ${_build_debug_enabled} == false ]]; then
options+=(!debug)
fi
source=(${pkgname}-${pkgver}.tar.gz::${_url}/archive/v${pkgver}.tar.gz)
sha256sums=('c839ad53f97beeb9d1d521c9d0252aadf35f6138c2650453989b6c34a6294fd9')
prepare() {
cd ${pkgname}-${pkgver}
export GOFLAGS='-mod=readonly'
rm -rf out
go clean \
-modcache
go mod tidy -v
go mod vendor -v
go mod verify
}
build() {
local _ldflags _binary _tags
_ldflags=(
-X=main.version=v${pkgver}
-linkmode=external
)
_tags=(
osusergo
netgo
)
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOPATH="${srcdir}"
export GOFLAGS='-buildmode=pie -mod=vendor -modcacherw'
if [[ ${_build_debug_enabled} == false ]]; then
_ldflags+=(
-s
-w
)
export GOFLAGS+=' -trimpath'
else
_ldflags+=(
-compressdwarf=false
)
fi
cd ${pkgname}-${pkgver}
for _binary in {,kubectl-}${pkgname}; do
go build \
-v \
-ldflags="${_ldflags[*]}" \
-tags="${_tags[*]}" \
-o out/${_binary} \
./cmd/${_binary}
done
}
package() {
cd ${pkgname}-${pkgver}
install -Dm755 -t "${pkgdir}"/usr/bin \
out/{,kubectl-}${pkgname}
}
# vim: ts=2 sw=2 et:
|