summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Weiss2017-01-24 14:42:18 +0100
committerLuca Weiss2017-01-24 14:42:18 +0100
commit497224c731c4d81ef18cb7311546178ab74b8ea2 (patch)
treec25b2b267e1f41bec7c091391bda005f78f42ccf
downloadaur-497224c731c4d81ef18cb7311546178ab74b8ea2.tar.gz
Initial commit, everything commented
-rw-r--r--.SRCINFO9
-rw-r--r--PKGBUILD117
-rw-r--r--razer-driver-arch.install21
-rw-r--r--razer-driver-dkms.install9
4 files changed, 156 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..fa871766cdd
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,9 @@
+# Generated by mksrcinfo v8
+# Tue Jan 24 13:41:00 UTC 2017
+pkgbase = razer-drivers
+ pkgver = 0.0.0.1
+ pkgrel = 1
+ arch = any
+
+pkgname = razer-drivers
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..34bfb13a889
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,117 @@
+# Maintainer: Luca Weiss <luca (at) z3ntu (dot) xyz>
+# Maintainer: Gabriele Musco <emaildigabry@gmail.com>
+
+# This PKGBUILD is configured to only build razer-driver-dkms, razer-daemon & python-razer by default.
+# Kernel modules for the stock kernel (package "linux") can be built into a package by setting the variable "build_kernel_modules" to "true".
+build_kernel_modules=false
+
+# Furthermore it is possible to build the package from a specific git commit by uncommenting the variable "_commit" and setting it to a valid commit. pkgrel should be bumped up too then.
+
+pkgname=razer-drivers
+arch=('any')
+pkgver=0.0.0.1
+pkgrel=1
+package() {
+echo "true"
+}
+
+if false; then # packages are in conflict until merged
+pkgbase=razer-drivers
+pkgname=('python-razer' 'razer-daemon' 'razer-driver-dkms')
+if $build_kernel_modules; then
+ pkgname+=('razer-driver-arch')
+fi
+pkgver=1.1.8
+#_commit=6ae1f7d55bf10cc6b5cb62a5ce99ff22c43e0701
+pkgrel=1
+pkgdesc="An entirely open source driver and user-space daemon that allows you to manage your Razer peripherals on GNU/Linux."
+arch=('any')
+url="https://github.com/terrycain/razer-drivers"
+license=('GPL2')
+makedepends=('make' 'python' 'python-setuptools')
+if $build_kernel_modules; then
+ makedepends+=('linux-headers>=4.8' 'linux-headers<4.9' 'linux>=4.8' 'linux<4.9')
+fi
+if [ -z $_commit ]; then
+ source=("https://github.com/terrycain/razer-drivers/archive/v$pkgver.tar.gz")
+else
+ source=("https://github.com/terrycain/razer-drivers/archive/$_commit.tar.gz")
+fi
+sha256sums=('b79df8ae7c1060c4656d1a70ddb3b2178ed9fd0708dfbc9308b539382891bc6e')
+
+package_python-razer() {
+ pkgdesc="A python library for controlling razer-daemon"
+ depends=('razer-daemon' 'python' 'python-dbus' 'python-numpy')
+ optdepends=('polychromatic: gtk frontend'
+ 'razercommander-git: gtk frontend')
+ if [ -z $_commit ]; then
+ cd $srcdir/$pkgbase-$pkgver
+ else
+ cd $srcdir/$pkgbase-$_commit
+ fi
+ make DESTDIR=$pkgdir python_library_install
+}
+
+package_razer-daemon() {
+ pkgdesc="A daemon for controlling razer-driver"
+ depends=('RAZER-DRIVERS-MODULES' 'python-dbus' 'python-gobject' 'python-setproctitle' 'xautomation' 'xdotool' 'libdbus' 'python-notify2' 'python-pyudev' 'gtk3')
+ # gtk3 for "gi.require_version('Gdk', '3.0')"
+
+ if [ -z $_commit ]; then
+ cd $srcdir/$pkgbase-$pkgver
+ else
+ cd $srcdir/$pkgbase-$_commit
+ fi
+ make DESTDIR=$pkgdir daemon_install
+}
+
+package_razer-driver-dkms() {
+ pkgdesc="An entirely open source driver for managing Razer peripherals on Linux. (DKMS)"
+ depends=('dkms' 'udev')
+ provides=('RAZER-DRIVERS-MODULES')
+ install=razer-driver-dkms.install
+
+ if [ -z $_commit ]; then
+ cd $srcdir/$pkgbase-$pkgver
+ else
+ cd $srcdir/$pkgbase-$_commit
+ fi
+ make DESTDIR=$pkgdir setup_dkms udev_install
+}
+
+if $build_kernel_modules; then
+# remember to also adjust the .install files and the package deps below
+_extramodules=extramodules-4.8-ARCH
+
+build() {
+ if [ -z $_commit ]; then
+ cd $srcdir/$pkgbase-$pkgver
+ else
+ cd $srcdir/$pkgbase-$_commit
+ fi
+
+ _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
+
+ make DESTDIR=$pkgdir KERNELDIR=/usr/lib/modules/$_kernver/build driver
+}
+
+package_razer-driver-arch() {
+ pkgdesc="An entirely open source driver for managing Razer peripherals on Linux. (for stock 'linux' kernel)"
+ depends=('udev')
+ depends=('linux>=4.8' 'linux<4.9')
+ provides=('RAZER-DRIVERS-MODULES')
+ install=razer-driver-arch.install
+
+ if [ -z $_commit ]; then
+ cd $srcdir/$pkgbase-$pkgver
+ else
+ cd $srcdir/$pkgbase-$_commit
+ fi
+ install -dm755 $pkgdir/usr/lib/modules/$_extramodules/
+ make DESTDIR=$pkgdir MODULEDIR=/usr/lib/modules/$_extramodules/ driver_install_packaging udev_install
+
+ # compress each module individually
+ find "$pkgdir" -name '*.ko' -exec gzip -9 {} +
+}
+fi
+fi
diff --git a/razer-driver-arch.install b/razer-driver-arch.install
new file mode 100644
index 00000000000..57bf46761ae
--- /dev/null
+++ b/razer-driver-arch.install
@@ -0,0 +1,21 @@
+_depmod() {
+ EXTRAMODULES=extramodules-4.8-ARCH
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
+
+post_install() {
+ cat << EOF
+==> Stuff about rebooting :)
+EOF
+ _depmod
+}
+
+post_upgrade() {
+ _depmod
+}
+
+post_remove() {
+ _depmod
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/razer-driver-dkms.install b/razer-driver-dkms.install
new file mode 100644
index 00000000000..b3d48dae270
--- /dev/null
+++ b/razer-driver-dkms.install
@@ -0,0 +1,9 @@
+post_install() {
+ getent group plugdev >/dev/null || groupadd -r plugdev
+
+ echo -e "\e[31m********************************************"
+ echo -e "\e[31m* To complete installation, please run: *"
+ echo -e "\e[31m* # sudo gpasswd -a <yourUsername> plugdev *"
+ echo -e "\e[31m********************************************"
+ echo -e -n "\e[39m"
+}