blob: bc3339439861a72cd7429dca011234d9405f333e (
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
|
# Maintainer: Bao Trinh <qubidt@gmail.com>
# Contributor: George Rawlinson <grawlinson@archlinux.org>
_pkgname=nomad-driver-podman
pkgname=${_pkgname}-git
pkgver=0.4.2.r10.gaeed282
pkgrel=1
pkgdesc="A nomad taskdriver for podman containers"
arch=('x86_64')
url="https://github.com/hashicorp/nomad-driver-podman"
license=('MPL2')
depends=('nomad' 'podman')
makedepends=('go' 'git')
options=('!lto')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("${_pkgname}::git+${url}")
md5sums=('SKIP')
pkgver() {
cd "${_pkgname}"
git describe --long --tags --match'=v[0-9]*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${_pkgname}"
# create directory for build output
mkdir -p build
# download dependencies
go mod download
}
build() {
cd "${_pkgname}"
export CGO_LDFLAGS="${LDFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export GOPATH="${srcdir}"
go build -v \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags "-linkmode=external -compressdwarf=false -extldflags ${LDFLAGS}" \
-o build \
.
}
package() {
cd "${_pkgname}"
# binary
install -vDm755 -t "$pkgdir/usr/lib/nomad/plugins" "build/${_pkgname}"
# documentation
rm "examples/plugins/.gitkeep"
rmdir "examples/plugins"
install -vDm644 -t "$pkgdir/usr/share/doc/${_pkgname}" README.md
cp -vr examples "$pkgdir/usr/share/doc/${_pkgname}"
}
|