summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holthuis2018-09-19 20:04:30 +0200
committerJan Holthuis2018-09-19 20:04:30 +0200
commitb6a0364a94420e843f26aaab04b48925fd841595 (patch)
tree707eb9cd10673891fd0f6dcaf3ce86986cf81e49
downloadaur-b6a0364a94420e843f26aaab04b48925fd841595.tar.gz
Add initial version
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD47
-rw-r--r--libcmmk-git.install23
3 files changed, 85 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..f191810f142
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = libcmmk-git
+ pkgdesc = An unofficial LED control API for Coolermaster Masterkey keyboards
+ pkgver = r65.9894101
+ pkgrel = 1
+ url = https://github.com/chmod222/libcmmk
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = cmake
+ depends = libusb
+ source = git+https://github.com/chmod222/libcmmk.git
+ sha256sums = SKIP
+
+pkgname = libcmmk-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..f2a506b41e7
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Jan Holthuis <holthuis.jan@googlemail.com>
+pkgname=libcmmk-git
+_pkgname=libcmmk
+pkgver=r65.9894101
+pkgrel=1
+pkgdesc="An unofficial LED control API for Coolermaster Masterkey keyboards"
+arch=(i686 x86_64)
+url="https://github.com/chmod222/libcmmk"
+license=('GPL')
+depends=(libusb)
+makedepends=(cmake)
+install="${pkgname}.install"
+source=("git+https://github.com/chmod222/libcmmk.git")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "$srcdir/$_pkgname"
+ (
+ set -o pipefail
+ git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+build() {
+ cd "$srcdir/$_pkgname"
+ mkdir -p build
+ cd build
+ cmake -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_BINDIR=bin \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ ..
+ make
+}
+
+package() {
+ cd "$srcdir/$_pkgname/build"
+ make DESTDIR="$pkgdir/" install
+
+ cd "$srcdir/$_pkgname"
+ install -d "$pkgdir/usr/share/doc/$_pkgname"
+ install -Dm755 "contrib/etc/udev/rules.d/20-coolermaster.rules" "$pkgdir/usr/share/doc/$_pkgname"
+ install -Dm755 "extra/reference/CoolerMaster LED Table.xls" "$pkgdir/usr/share/doc/$_pkgname"
+ install -Dm755 "PROTOCOL.md" "$pkgdir/usr/share/doc/$_pkgname"
+ install -Dm755 "README.md" "$pkgdir/usr/share/doc/$_pkgname"
+}
+# vim: set ts=2 sw=2 et:
diff --git a/libcmmk-git.install b/libcmmk-git.install
new file mode 100644
index 00000000000..de0e22d606b
--- /dev/null
+++ b/libcmmk-git.install
@@ -0,0 +1,23 @@
+## arg 1: the new package version
+post_install() {
+ echo "
+If you want to control the LEDs of your CoolerMaster keyboard as regular
+user, you need to install the appropriate udev rules. You can use the
+default rule file from the repository or provide your own. To use the
+default one, run this as root:
+
+ cp /usr/share/doc/libcmmk/20-coolermaster.rules /etc/udev/rules.d/
+ udevadm control --reload-rules && udevadm trigger
+"
+}
+
+## arg 1: the old package version
+post_remove() {
+ echo "
+If you installed an udev rule file to control your CoolerMaster keyboard
+as regular user, don't forget to remove it:
+
+ rm /etc/udev/rules.d/20-coolermaster.rules
+"
+}
+# vim: set ts=2 sw=2 et: