summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorK. Hampf2016-02-10 11:33:14 +0200
committerK. Hampf2016-02-10 11:33:14 +0200
commit6a196a0f5e36f21c3dc9700a4f9fe28d65f64332 (patch)
tree7392c7e1457626a67a0757d448fa16427e47c751 /PKGBUILD
parentb7e7b7b27cda4889c50e280e5c470ae5e316fda5 (diff)
downloadaur-6a196a0f5e36f21c3dc9700a4f9fe28d65f64332.tar.gz
Modified udev-rules. Systemd service, tmpfiles.d and install script added
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD61
1 files changed, 47 insertions, 14 deletions
diff --git a/PKGBUILD b/PKGBUILD
index da9fdc28a686..2ce9cdc50bab 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,41 +1,74 @@
-# Maintainer: Lukas Sabota <lukas@lwsabota.com>
-# Contributor: K. Hampf <khampf@users.sourceforge.net>
+# Maintainer: K. Hampf <khampf@users.sourceforge.net>
+# Original maintainer: Lukas Sabota <lukas@lwsabota.com>
pkgbase="g13"
pkgname="g13-git"
pkgver=20160120
-pkgrel=1
+pkgrel=2
pkgdesc="Userspace driver for the Logitech G13 Keyboard"
arch=('x86_64' 'i686')
url="https://github.com/ecraven/g13"
license=('unknown')
depends=('boost-libs')
makedepends=('git' 'boost')
-source=("${pkgname}::git://github.com/ecraven/g13")
-sha256sums=('SKIP')
+source=("${pkgname}::git://github.com/ecraven/g13" "g13.tmpfiles" "g13.service")
+install="g13.install"
+sha256sums=('SKIP'
+ 'f96966012da236b2f6fd142fbad3a19524a9c7bf7eea43efdc684a07414a3589'
+ 'c359fdd80ac37cbbfb0cfdcb071212e9a5390a98dff72a9d9e688d1d3df1c932')
pkgver() {
cd "${pkgname}"
+ msg "Trying to read git version ..."
local desc=$(git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
if [ -z "$desc" ]; then
+ msg "Git version failed, using date of last commit ..."
# date of last commit as YYYYMMDD
git log -1 --date=format:%Y%m%d --format=%cd
fi
}
+prepare() {
+ cd "${srcdir}/${pkgname}"
+ msg "Modifying udev 91-g13.rules ..."
+ sed -r -i -e 's/MODE="0666"/MODE="0660", OWNER="g13", GROUP="g13"\n/' 91-g13.rules
+ echo '
+# Other packages might already do this but uncomment if you get errors on uinput
+#KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
+
+# Uncomment the following to start g13d as a systemd service when G13 is plugged in
+#ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c21c", RUN+="/usr/bin/systemctl start g13.service"
+#ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c21c", RUN+="/usr/bin/systemctl stop g13.service"
+' >> 91-g13.rules
+}
+
build() {
- cd "${pkgname}"
+ cd "${srcdir}/${pkgname}"
make
}
package() {
- cd "${pkgname}"
- install -d -m755 "${pkgdir}/usr/bin"
- install -D -m755 g13d "${pkgdir}/usr/bin"
- install -D -m755 pbm2lpbm "${pkgdir}/usr/bin"
- install -d -m755 "${pkgdir}/usr/share/doc/${pkgname}"
- install -D -m644 README.md g13.png g13.svg "${pkgdir}/usr/share/doc/${pkgname}"
- install -d -m755 "${pkgdir}/usr/share/doc/${pkgname}/examples"
- install -D -m644 91-g13.rules clock.sh *.lpbm *.bind "${pkgdir}/usr/share/doc/${pkgname}/examples"
+ cd "${srcdir}/${pkgname}"
+
+ # binaries
+ install -dm 755 "${pkgdir}"/usr/bin
+ install -m 755 g13d "${pkgdir}"/usr/bin
+ install -m 755 pbm2lpbm "${pkgdir}/usr/bin"
+
+ # configuration (location of default.bind)
+ install -dm 755 "{pkgdir}"/etc/g13
+
+ # docs
+ install -dm 755 "${pkgdir}"/usr/share/doc/${pkgname}
+ install -m 644 README.md g13.png g13.svg "${pkgdir}"/usr/share/doc/${pkgname}
+ install -dm 755 "${pkgdir}"/usr/share/doc/${pkgname}/examples
+ install -m 644 clock.sh *.lpbm *.bind "${pkgdir}"/usr/share/doc/${pkgname}/examples
+
+ # systemd and udev stuff
+ install -dm 755 "${pkgdir}"/usr/lib/{systemd/system,tmpfiles.d,udev/rules.d}
+ install -m 644 91-g13.rules "${pkgdir}"/usr/lib/udev/rules.d/91-g13.rules
+ install -m 644 ../g13.service "${pkgdir}"/usr/lib/systemd/system/g13.service
+ install -m 644 ../g13.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/g13.conf
}
+# vim: set ts=2 sw=2 et: