blob: e2db64d8c54b8588ea7f4b1a2fdfa20b8d4e6a30 (
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
|
# Maintainer: Shalygin Konstantin <k0ste@k0ste.ru>
# Contributor: Shalygin Konstantin <k0ste@k0ste.ru>
pkgname='pgremapper'
pkgver='1.0.0'
pkgrel='2'
pkgdesc="CLI tool for manipulating Ceph's upmap exception table"
arch=('x86_64' 'aarch64')
_uri="github.com/digitalocean"
url="https://${_uri}/${pkgname}"
license=('Apache 2.0')
depends=('ceph')
makedepends=('go' 'git')
source=("${pkgname}-${pkgver}.tar.gz::https://codeload.${_uri}/${pkgname}/tar.gz/refs/tags/v${pkgver}")
sha256sums=('c43e5e13bdb204012816dca6219ba37c470a7cb959e2b4536a400dcb4c70f8d4')
prepare() {
export GOPATH="${srcdir}/gopath"
export GOBIN="${GOPATH}/bin"
export GOCACHE="${srcdir}/cache/go-cache"
export GOMODCACHE="${srcdir}/cache/go"
export GOTMPDIR="${srcdir}"
eval "$(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH")"
cd "${pkgname}-${pkgver}"
mkdir -p "${GOPATH}/src/${_uri}"
ln -snf "${srcdir}/${pkgname}-${pkgver}" "${GOPATH}/src/${_uri}/${pkgname}"
}
build() {
cd "${GOPATH}/src/${_uri}/${pkgname}"
eval "$(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH")"
GOOS="${GOHOSTOS}" GOARCH="${GOHOSTARCH}" \
go build -x \
-buildmode="pie" \
-trimpath \
-mod="readonly" \
-modcacherw \
-ldflags "-linkmode external -extldflags '${LDFLAGS}'"
}
check() {
cd "${GOPATH}/src/${_uri}/${pkgname}"
go test -modcacherw -race ./...
}
package() {
cd "${pkgname}-${pkgver}"
install -Dm0755 "${pkgname}" -t "${pkgdir}/usr/bin"
install -Dm0644 "LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
|