Browse Source

rog-core: added to repo

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
master
Steven Noonan 1 year ago
parent
commit
0f65488ee5
Signed by: steven GPG Key ID: 408EEB508ED0CD4D
  1. 1
      rog-core/.gitignore
  2. 37
      rog-core/PKGBUILD
  3. 14
      rog-core/install-dir.patch
  4. 20
      rog-core/update.sh

1
rog-core/.gitignore

@ -0,0 +1 @@
/rog-core

37
rog-core/PKGBUILD

@ -0,0 +1,37 @@
# Maintainer: Steven Noonan <steven@uplinklabs.net>
pkgname=rog-core
pkgbase=rog-core
pkgver=0.15.3+6+gc6d40d3
pkgrel=1
pkgdesc="A utility for Linux to control many aspects (eventually) of the ASUS ROG laptops like the Zephyrus GX502GW"
arch=('x86_64')
url="https://github.com/flukejones/rog-core"
license=('MPL2')
depends=(dbus libusb)
makedepends=(rust clang git)
source=("rog-core::git+${url}.git"
"install-dir.patch")
sha256sums=('SKIP'
'78ec239b5255d1d6dd4e7ef67d61eab58f79b4d03a27de648c790f6077ad0e46')
pkgver() {
cd "$srcdir"/$pkgname
git describe --tags | sed 's/^v//;s/-/+/g'
}
prepare() {
patch -d "$srcdir"/$pkgname -p1 < install-dir.patch
}
build() {
cd "$srcdir"/$pkgname
make
}
package() {
cd "$srcdir"/$pkgname
DESTDIR="$pkgdir"/ make install
}
# vim: set ts=2 sts=2 sw=2 et:

14
rog-core/install-dir.patch

@ -0,0 +1,14 @@
--- a/Makefile 2020-07-07 10:50:09.000000000 +0200
+++ b/Makefile 2020-07-08 11:45:59.863155274 +0200
@@ -34,9 +34,9 @@
install: all
install -D -m 0755 "target/release/$(BIN)" "$(DESTDIR)$(bindir)/$(BIN)"
- install -D -m 0644 "data/$(BIN).rules" "$(DESTDIR)/lib/udev/rules.d/99-$(BIN).rules"
+ install -D -m 0644 "data/$(BIN).rules" "$(DESTDIR)/usr/lib/udev/rules.d/99-$(BIN).rules"
install -D -m 0644 "data/$(BIN).conf" "$(DESTDIR)$(sysconfdir)/dbus-1/system.d/$(BIN).conf"
- install -D -m 0644 "data/$(BIN).service" "$(DESTDIR)/lib/systemd/system/$(BIN).service"
+ install -D -m 0644 "data/$(BIN).service" "$(DESTDIR)/usr/lib/systemd/system/$(BIN).service"
uninstall:
rm -f "$(DESTDIR)$(bindir)/$(BIN)"

20
rog-core/update.sh

@ -0,0 +1,20 @@
#!/bin/sh
set -e
source ./PKGBUILD
TAG_NAME=$(curl https://api.github.com/repos/flukejones/rog-core/releases/latest 2> /dev/null | jq --raw-output '.tag_name')
VERSION=$(echo $TAG_NAME | sed "s/^v\(.*\)$/\1/")
if [ "$pkgver" != "$VERSION" ]
then
echo $pkgver "->" $VERSION
sed -i "s/^pkgver=.*$/pkgver=$VERSION/" PKGBUILD
sed -i "s/^pkgrel=.*$/pkgrel=1/" PKGBUILD
sed -i "s/^sha256sums=.*/$(makepkg --geninteg 2> /dev/null | tr '\n' ' ' | sed -e "s/ */ /g" -e "s/ *$//")/" PKGBUILD
makepkg --printsrcinfo > .SRCINFO
git add PKGBUILD .SRCINFO
git commit -m "Version "$VERSION
fi
Loading…
Cancel
Save