summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 69de8e3bf421183d91dda6d01a56415d92ea4319 (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
# Maintainer : atriix <aur a snilius d com>

pkgname=certstrap-git
_pkgname="certstrap"

pkgver=v1.2.0.r36.g14dbcb0
pkgrel=1

pkgdesc="Tools to bootstrap CAs, certificate requests, and signed certificates."
arch=('x86_64')
url="https://github.com/square/certstrap"
license=('Apache')

depends=('go>=1.13')
makedepends=('git')

options=('!emptydirs')

source=("git+$url")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$srcdir/$_pkgname"
  go mod vendor -v
}

build() {
  cd "$srcdir/$_pkgname"
  go build -mod=vendor -v -ldflags "-X main.release=$pkgver"
  BUILD_TAG=$pkgver go test -v ./...
}

package() {
  install -Dm755 "$srcdir/$_pkgname/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
}

# vim: ts=2 sw=2 et ft=PKGBUILD: