summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMatthias Lisin2019-04-21 13:49:39 +0200
committerMatthias Lisin2019-04-21 13:49:39 +0200
commitb8e9e17c6ff923f5ee6a822124f52395ae511638 (patch)
tree1c6008876a0d2fc7dd14806987f7fd2fca2ee742 /PKGBUILD
downloadaur-b8e9e17c6ff923f5ee6a822124f52395ae511638.tar.gz
newpkg: vt-cli 0.5.0-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD38
1 files changed, 38 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6cf1767c47e5
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Matthias Lisin <ml@visu.li
+pkgname=vt-cli
+pkgver=0.5.0
+pkgrel=1
+pkgdesc='VirusTotal Command Line Interface'
+arch=('any')
+url='https://github.com/VirusTotal/vt-cli'
+license=('Apache')
+makedepends=('go' 'dep')
+provides=('vt-cli')
+conflicts=('vt-cli-bin' 'vt-cli-git')
+source=("${url}/archive/${pkgver}.tar.gz")
+sha512sums=('fc37281c78349f0ef6d194c1ace9c36a7fc03a5dfd82d4da1d3176907b432c39c32ccb31d3f5da780fdd46e81a3eb7a6547f4d9385e3c2dc9ad5da6f77be7c52')
+_gopkg=gopath/src/github.com/VirusTotal/"$pkgname"
+
+prepare() {
+ export GOPATH="$srcdir"/gopath
+ mkdir -p gopath/src/github.com/VirusTotal
+ ln -rTsf "$pkgname-$pkgver" "$_gopkg"
+ cd "$_gopkg"
+ dep ensure
+}
+
+build() {
+ export GOPATH="$srcdir"/gopath
+ LDFLAGS+=" -X=github.com/VirusTotal/vt-cli/cmd.Version=${pkgver}"
+ cd gopath/src/github.com/VirusTotal/"$pkgname"
+ go build -gcflags "all=-trimpath=${PWD}" \
+ -asmflags "all=-trimpath=${PWD}" \
+ -ldflags "-extldflags=${LDFLAGS}" \
+ -o build/vt vt/main.go
+
+}
+
+package() {
+ cd "$pkgname-$pkgver"
+ install -Dm755 build/vt "$pkgdir/usr/bin/vt"
+}