summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 81a6ef15c9fcf8a47029201f47fd70e839e366b2 (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
# Maintainer: Mario Finelli <mario at finel dot li>
# Contributor: ml <ml@visu.li>

pkgname=helm-s3
pkgver=0.15.1
pkgrel=1
pkgdesc="Helm plugin that allows to set up a chart repository in AWS S3"
arch=(x86_64)
url=https://github.com/hypnoglow/helm-s3
license=(MIT)
install=helm-s3.install
depends=(helm)
makedepends=(go)
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('32bd3a0feffeda34abafde00485ccfdd92d6098671aa43fba18eeffbfbb431d0')

prepare() {
  cd "${pkgname}-${pkgver}"
  export GOPATH="${srcdir}/gopath"
  go mod download
  sed -i '/^hooks:$/Q' plugin.yaml
}

build() {
  cd "${pkgname}-${pkgver}"
  export GOPATH="${srcdir}/gopath"
  export CGO_ENABLED=1
  export CGO_LDFLAGS="$LDFLAGS"
  export CGO_CFLAGS="$CFLAGS"
  export CGO_CPPFLAGS="$CPPFLAGS"
  export CGO_CXXFLAGS="$CXXFLAGS"
  export GOFLAGS='-buildmode=pie -trimpath -modcacherw -mod=readonly'
  go build -o bin/helms3 \
    -ldflags "-linkmode=external -X main.version=${pkgver}" ./cmd/helm-s3
}

check() {
  cd "${pkgname}-${pkgver}"
  make test-unit
}

package() {
  cd "${pkgname}-${pkgver}"

  # /usr/lib/helm/plugins follows other helm plugins on the AUR (e.g., helm-diff)
  install -Dm0755 bin/helms3 -t "${pkgdir}/usr/lib/helm/plugins/${pkgname##helm-}/bin"
  install -m0644 plugin.yaml -t "${pkgdir}/usr/lib/helm/plugins/${pkgname##helm-}"

  install -Dm0644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim: set ts=2 sw=2 et: