diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 52 |
1 files changed, 29 insertions, 23 deletions
@@ -1,35 +1,41 @@ -# Maintainer: Matthias Lisin <ml@visu.li +# Maintainer: ml <> pkgname=vt-cli -pkgver=0.6.1 +pkgver=1.0.0 pkgrel=1 pkgdesc='VirusTotal Command Line Interface' arch=('i686' 'x86_64') -url='https://github.com/VirusTotal/vt-cli' +url=https://virustotal.github.io/vt-cli/ license=('Apache') -makedepends=('go' 'dep') -source=("$pkgname-$pkgver.tar.gz::${url}/archive/${pkgver}.tar.gz") -sha512sums=('2e1a986e6e52afc0d34c8966ad29e3fca5e66b4a87dd2bed1a03c877694bccba26b44b2831d639248421f6eb0b45b72497f2caefcfcdad73da955e5d4f977b78') -_gopkg=gopath/src/github.com/VirusTotal/"$pkgname" +depends=('glibc') +makedepends=('go') +source=("https://github.com/VirusTotal/vt-cli/archive/$pkgver/$pkgname-$pkgver.tar.gz") +sha256sums=('8fab50202ce3a3f8128e94565cb58cdc2cbf5f816fd7b0855d897a379c9cfaf6') -prepare() { - export GOPATH="$srcdir/gopath" - mkdir -p "${_gopkg%/*}" - ln -frs "$pkgname-$pkgver" "$_gopkg" - cd "$_gopkg" - dep ensure +build() { + cd "$pkgname-$pkgver" + 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' + go build -o build/vt -ldflags "-linkmode=external -X github.com/VirusTotal/vt-cli/cmd.Version=$pkgver" ./vt + build/vt completion bash >vt.bash + build/vt completion zsh >vt.zsh + build/vt completion fish >vt.fish } -build() { - export GOPATH="$srcdir/gopath" - cd "$_gopkg" - LDFLAGS+=" -X github.com/VirusTotal/vt-cli/cmd.Version=${pkgver}" - go build -gcflags "all=-trimpath=${GOPATH}" \ - -asmflags "all=-trimpath=${GOPATH}" \ - -ldflags "-extldflags=${LDFLAGS}" \ - -buildmode=pie -o build/vt vt/main.go +check() { + cd "$pkgname-$pkgver" + # yaml_test.go broken. fails upstream as well + go test -ldflags "-linkmode=external" -short ./utils/... } package() { - cd "$pkgname-$pkgver" - install -Dm755 build/vt "$pkgdir/usr/bin/vt" + cd "$pkgname-$pkgver" + install -Dm755 build/vt -t "$pkgdir/usr/bin" + install -Dm644 vt.bash "$pkgdir/usr/share/bash-completion/completions/vt" + install -Dm644 vt.zsh "$pkgdir/usr/share/zsh/site-functions/_vt" + install -Dm644 vt.fish "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname".fish + install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" doc/* } |