summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3e4118b5a3a85301958cf208f618c2fe1494180a (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
# Maintainer: David Birks <david@tellus.space>

pkgname=sanic
pkgdesc='An all-in-one tool to develop, build, and deploy your Docker/Kubernetes projects'
pkgver=1.2.11
pkgrel=1
arch=('x86_64')
license=('Apache')
url='https://github.com/distributed-containers-inc/sanic'
depends=('kubectl' 'docker')
makedepends=('go')
source=("$pkgname-$pkgver.tar.gz::https://github.com/distributed-containers-inc/sanic/archive/v$pkgver.tar.gz")
sha256sums=('2bf562a0335514e268b09b43ea7d65ecde54c815571589907557023d70799b70')

prepare() {
  # Make fake gopath
  mkdir -p gopath/src/github.com/distributed-containers-inc
  ln -rTsf $pkgname-$pkgver gopath/src/github.com/distributed-containers-inc/sanic
}

build() {
  # Trim PWD from binary
  export GOFLAGS="-gcflags=all=-trimpath=${PWD} -asmflags=all=-trimpath=${PWD} -ldflags=-extldflags=-zrelro -ldflags=-extldflags=-znow"

  export GOPATH="$srcdir"/gopath
  export GO111MODULE=on
  cd gopath/src/github.com/distributed-containers-inc/sanic
  go install
}

package() {
  install -Dm 755 "$srcdir/gopath/bin/$pkgname" "$pkgdir/usr/bin/$pkgname"
}