summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD46
1 files changed, 46 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..30a6dcf8c11
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Jakub "Kubuxu" Sztandera <kubuxu@protonmail.ch>
+# vim: set expandtab ts=2 sw=2:
+
+pkgname=gx-go
+pkgver=0.2.0
+pkgrel=1
+epoch=
+pkgdesc="A tool to use with the gx package manager for packages written in go."
+arch=('i686' 'x86_64' 'armv7h')
+url="https://github.com/whyrusleeping/$pkgname"
+license=('MIT')
+makedepends=('git' 'go')
+source=("git+${url}.git")
+md5sums=('SKIP')
+
+pkgver_DISABLED() {
+ # Renable after tags are placed in the repo.
+ cd "$srcdir/$pkgname"
+ git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ mkdir -p "$srcdir"/src/github.com/whyrusleeping/
+ ln -fs "$srcdir/$pkgname" "$srcdir"/src/github.com/whyrusleeping/"$pkgname"
+}
+
+build() {
+ # Required for go get
+ export GOPATH="$srcdir"
+ cd "$srcdir"/src/github.com/whyrusleeping/"$pkgname"
+
+ msg2 'Installing dependencies...'
+ go get -v
+
+ msg2 'Building binary...'
+ go install -v
+}
+
+package() {
+ msg2 'Packaging binary...'
+ install -Dm 755 bin/gx-go "${pkgdir}/usr/bin/gx-go"
+
+ msg2 'Packaging auxiliary files...'
+ cd "$pkgname"
+ install -Dm 644 -t "${pkgdir}/usr/share/licenses/${pkgname}" LICENSE
+}