summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 765ce06b5e2323e5bce1790134ba5b025892f4f2 (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
# Maintainer: Adrián Pérez de Castro <aperez@igalia.com>
pkgname=vault-ssh-helper
pkgdesc='Allows using OTP authentication generated by a Vault server'
pkgver=0.2.1
pkgrel=1
url=https://github.com/hashicorp/vault-ssh-helper/
arch=(x86_64 i686)
license=(MPL)
makedepends=(go)
depends=(glibc)
source=("${url}/archive/v${pkgver}.tar.gz")
sha512sums=('ca1323a62de90787ce21bc1106328e5ee8c20d3cd242e5974312236fc3951f61bd7d01943a17356fd8986984938adbca45eac538a4130948bb9948867b454b8c')

prepare () {
	cd "${pkgname}-${pkgver}"
	export GOPATH="${srcdir}"
	go mod vendor -v
}

build () {
	cd "${pkgname}-${pkgver}"
	export GOPATH="${srcdir}"
	export CGO_CPPFLAGS="${CPPFLAGS}"
	export CGO_CFLAGS="${CFLAGS//-flto/}"
	export CGO_CXXFLAGS="${CXXFLAGS//-flto/}"
	go build -v -modcacherw -trimpath -buildmode pie -mod vendor \
		-ldflags "-linkmode external -extldflags \"${LDFLAGS//-flto/}\"" \
		-o "${srcdir}/vault-ssh-helper"
}

package () {
	install -Dm755 "${srcdir}/vault-ssh-helper" \
		           "${pkgdir}/usr/bin/vault-ssh-helper"
	install -Dm644 "${pkgname}-${pkgver}/README.md" \
		           "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}