summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Maclennan2018-07-19 13:10:16 +0300
committerCaleb Maclennan2018-07-19 13:27:18 +0300
commit3194dc350b5c84f497a5ed943f9bfa28a400e653 (patch)
treea7c0eeac7473b8ac237b0209122363a24900da53
parentebcd93fb5c8bf45ba263dd252a2b4b46ce2c079b (diff)
downloadaur-3194dc350b5c84f497a5ed943f9bfa28a400e653.tar.gz
Convert packaging to actually build binary
-rw-r--r--.SRCINFO14
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD37
3 files changed, 41 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0eda9689715c..3951d6941408 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,20 @@
+# Generated by mksrcinfo v8
+# Thu Jul 19 10:08:54 UTC 2018
pkgbase = lab
- pkgdesc = A hub-like tool for GitLab.
+ pkgdesc = A hub-like tool for GitLab (tagged release)
pkgver = 0.12.0
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/zaquestion/lab
arch = x86_64
license = custom:Unlicense
+ makedepends = go
+ makedepends = dep
depends = git
optdepends = hub
- source = https://github.com/zaquestion/lab/releases/download/v0.12.0/lab_0.12.0_linux_amd64.tar.gz
- sha512sums = b96911c4653d213f5a1dfb6e70a106ac219d44506be3fcdb6661bcfa7cc30d471b9b768222855647c282c165f1ee8688523ab12406edaff692fa4c316a9ee575
+ conflicts = lab-git
+ conflicts = lab-bin
+ source = https://github.com/zaquestion/lab/archive/v0.12.0.tar.gz
+ sha512sums = e47a3255d3d98640a005e4da2f790db44816e8353861987af327a1a24d0801477a4889814b565f1870afb0508e607775caee7ad6b5d98e448d4d58d64c8d6d37
pkgname = lab
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..44ebe5fe5845
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+!./.SRCINFO
+!./.gitignore
+!./PKGBUILD
+*
diff --git a/PKGBUILD b/PKGBUILD
index 0df77fabb71e..93fcd87f6921 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,21 +1,38 @@
-# Maintainer: Jeremy Asuncion <jeremyasuncion808@gmail.com>
-# Maintainer: Simon Legner <Simon.Legner@gmail.com>
+# Maintainer: Simon Legner <Simon.Legner@gmail.com>
+# Maintainer: Caleb Maclennan <caleb@alerque.com>
+# Contributor: Jeremy Asuncion <jeremyasuncion808@gmail.com>
pkgname=lab
pkgver=0.12.0
-pkgrel=1
-pkgdesc="A hub-like tool for GitLab."
+pkgrel=2
+pkgdesc="A hub-like tool for GitLab (tagged release)"
arch=('x86_64')
url="https://github.com/zaquestion/lab"
license=('custom:Unlicense')
depends=('git')
optdepends=('hub')
-source=("https://github.com/zaquestion/lab/releases/download/v${pkgver}/lab_${pkgver}_linux_amd64.tar.gz")
+makedepends=('go' 'dep')
+conflicts=("${pkgname}-git" "${pkgname}-bin")
+source=("https://github.com/zaquestion/lab/archive/v${pkgver}.tar.gz")
+sha512sums=('e47a3255d3d98640a005e4da2f790db44816e8353861987af327a1a24d0801477a4889814b565f1870afb0508e607775caee7ad6b5d98e448d4d58d64c8d6d37')
+_gourl="github.com/zaquestion/${pkgname}"
-package() {
- cd $srcdir
- install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
- install -Dm755 lab $pkgdir/usr/bin/lab
+prepare() {
+ export GOPATH="${srcdir}/go"
+ mkdir -p "$GOPATH"
+ mkdir -p "$(dirname "$GOPATH/src/${_gourl}")"
+ ln --no-target-directory -fs "${srcdir}/${pkgname}-${pkgver}" "$GOPATH/src/${_gourl}"
+}
+
+build () {
+ export GOPATH="${srcdir}/go"
+ cd "$GOPATH/src/${_gourl}"
+ dep ensure
+ go build -ldflags "-X \"main.version=${pkgver}\"" ${_gourl}
}
-sha512sums=('b96911c4653d213f5a1dfb6e70a106ac219d44506be3fcdb6661bcfa7cc30d471b9b768222855647c282c165f1ee8688523ab12406edaff692fa4c316a9ee575')
+package() {
+ cd "${pkgname%-bin}-${pkgver}"
+ install -Dm644 LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
+ install -Dm755 lab $pkgdir/usr/bin/lab
+}