summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cd107827dd361ce0dae9c527a50b815dd1da1a2c (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgname=sget-git
pkgver=r266.g99e7b91
pkgrel=1
pkgdesc="Program for automatic verification of signatures and integration with Sigstore's binary transparency log"
arch=('i686' 'x86_64')
url="https://github.com/sigstore/sget"
license=('Apache')
depends=('glibc')
makedepends=('git' 'go')
provides=("sget=$pkgver")
conflicts=('sget')
source=("git+https://github.com/sigstore/sget.git")
sha256sums=('SKIP')


export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -trimpath -mod=readonly -modcacherw"

pkgver() {
  cd "sget"

  _rev=$(git rev-list --count --all)
  _hash=$(git rev-parse --short HEAD)
  printf "r%s.g%s" "$_rev" "$_hash"
}

check() {
  cd "sget"

  go test \
    ./...
}

package() {
  cd "sget"

  GOBIN="$pkgdir/usr/bin" \
    go install ./...

  install -d \
    "$pkgdir/usr/share/bash-completion/completions" \
    "$pkgdir/usr/share/fish/vendor_completions.d" \
    "$pkgdir/usr/share/zsh/site-functions"

  "$pkgdir/usr/bin/sget" completion bash > "$pkgdir/usr/share/bash-completion/completions/rekor-cli"
  "$pkgdir/usr/bin/sget" completion fish > "$pkgdir/usr/share/fish/vendor_completions.d/rekor-cli.fish"
  "$pkgdir/usr/bin/sget" completion zsh > "$pkgdir/usr/share/zsh/site-functions/_rekor-cli"
}