summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Borzek2023-05-09 19:46:44 +0200
committerDavid Borzek2023-05-09 19:46:44 +0200
commitf2a8344c7d51a621dfd1bfb295bdc187f4eb91d2 (patch)
tree353bbf7c5ec111f18d11b5354ed7770b4fab23a5
parent271fc8859a7f53d6304beff81a49e0269ca59ec6 (diff)
downloadaur-spofi-git.tar.gz
determine version from git commit
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD27
2 files changed, 18 insertions, 13 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 953ffe2d809e..d63b0fd8bdcc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = spofi-git
pkgdesc = Control spotify using rofi.
- pkgver = 1.0
- pkgrel = 2
+ pkgver = r16.125421b
+ pkgrel = 1
url = https://github.com/davidborzek/spofi
arch = x86_64
license = MIT
diff --git a/PKGBUILD b/PKGBUILD
index a54b9e474a77..20ea8b5734eb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,8 @@
# Maintainer: David Borzek <dev@davidborzek.de>
_pkgname=spofi
pkgname=spofi-git
-pkgver=1.0
-pkgrel=2
+pkgver=r16.125421b
+pkgrel=1
pkgdesc="Control spotify using rofi."
arch=(x86_64)
url="https://github.com/davidborzek/spofi"
@@ -13,17 +13,22 @@ provides=(spofi)
source=("$_pkgname"::"git+$url#branch=main")
md5sums=('SKIP')
+pkgver() {
+ cd "$srcdir/spofi"
+ printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
build() {
- cd "${_pkgname}"
- if [[ "$GOPATH" == "" ]]; then
- GOPATH="$HOME/go" go build -o spofi
- else
- go build -o spofi
- fi
+ cd "${_pkgname}"
+ if [[ "$GOPATH" == "" ]]; then
+ GOPATH="$HOME/go" go build -o spofi
+ else
+ go build -o spofi
+ fi
}
package() {
- cd "${_pkgname}"
- install -Dm755 spofi "${pkgdir}/usr/bin/spofi"
- install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}"
+ cd "${_pkgname}"
+ install -Dm755 spofi "${pkgdir}/usr/bin/spofi"
+ install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${_pkgname}"
}