streamdeck v1.0.0

This commit is contained in:
Knut Ahlers 2020-09-20 03:30:28 +02:00
commit 8da454677d
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
4 changed files with 79 additions and 0 deletions

15
.SRCINFO Normal file
View file

@ -0,0 +1,15 @@
pkgbase = streamdeck
pkgdesc = Utility to control Elgato StreamDeck on Linux
pkgver = 1.0.0
pkgrel = 1
url = https://github.com/Luzifer/streamdeck
arch = i686
arch = x86_64
license = Apache
makedepends = go
depends = hidapi
source = streamdeck-1.0.0.tar.gz::https://github.com/Luzifer/streamdeck/archive/v1.0.0.tar.gz
sha512sums = 0f93d4a2dabd44588ab663a7c1f1bd745f347d69b274ab71cf533e84989b5b3705ff61d7d8b82535f0f714885b0127dfb858991de38efe4f319cb11c7144976b
pkgname = streamdeck

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.tar.gz
*.tar.zst

25
PKGBUILD Normal file
View file

@ -0,0 +1,25 @@
# Maintainer: Knut Ahlers <knut at ahlers dot me>
pkgname=streamdeck
pkgver=1.0.0
pkgrel=1
pkgdesc="Utility to control Elgato StreamDeck on Linux"
arch=('i686' 'x86_64')
url="https://github.com/Luzifer/$pkgname"
license=('Apache')
depends=(hidapi)
makedepends=('go')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha512sums=('0f93d4a2dabd44588ab663a7c1f1bd745f347d69b274ab71cf533e84989b5b3705ff61d7d8b82535f0f714885b0127dfb858991de38efe4f319cb11c7144976b')
build() {
cd "${srcdir}/${pkgname}-${pkgver}/cmd/streamdeck"
go build -a -v \
-ldflags="-X main.version=${pkgver}" \
-mod=readonly
}
package() {
install -Dm755 -t "${pkgdir}/usr/bin" "${srcdir}/${pkgname}-${pkgver}/cmd/streamdeck/streamdeck"
install -Dm644 -t "${pkgdir}/usr/share/licenses/${pkgname}" "${srcdir}/${pkgname}-${pkgver}/LICENSE"
}

37
update_version.sh Executable file
View file

@ -0,0 +1,37 @@
#!/bin/bash
set -euxo pipefail
# Read pkg name
PKG=$(awk -F '=' '/pkgname=/{ print $2 }' PKGBUILD)
# Get latest version
VER=$(git ls-remote --tags --sort -v:refname https://github.com/Luzifer/streamdeck.git |
head -n1 |
grep -Eo 'tags/v[0-9.]+' |
grep -Eo '[0-9.]+$')
# Insert latest version into PKGBUILD
sed -i \
-e "s/^pkgver=.*/pkgver=${VER}/" \
PKGBUILD
# Check whether this changed anything
if (git diff --exit-code PKGBUILD); then
echo "Package ${PKG} has most recent version ${VER}"
exit 0
fi
# Reset pkgrel
sed -i \
-e 's/pkgrel=.*/pkgrel=1/' \
PKGBUILD
# Update source hashes
updpkgsums
# Update .SRCINFO
makepkg --printsrcinfo >.SRCINFO
# Commit changes
git add PKGBUILD .SRCINFO
git commit -m "${PKG} v${VER}"