diff options
author | Lubosz Sarnecki | 2015-06-22 22:57:24 +0200 |
---|---|---|
committer | Lubosz Sarnecki | 2015-06-22 22:57:24 +0200 |
commit | 672d7d0095c5f40ed890e52067345f14cedf6b18 (patch) | |
tree | c34c5ad8cbab3dff27369ef557a8bdc6ceba5e29 | |
download | aur-672d7d0095c5f40ed890e52067345f14cedf6b18.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 48 | ||||
-rw-r--r-- | 97-sixpair.rules | 1 | ||||
-rwxr-xr-x | PKGBUILD | 153 | ||||
-rwxr-xr-x | bluetooth | 29 | ||||
-rw-r--r-- | qtsixa-dbus.patch | 26 | ||||
-rw-r--r-- | qtsixa-gksudo.patch | 71 | ||||
-rw-r--r-- | qtsixa.install | 15 | ||||
-rw-r--r-- | sixad-bin.patch | 17 | ||||
-rw-r--r-- | sixad-init.patch | 54 | ||||
-rw-r--r-- | sixad-lq.patch | 28 | ||||
-rw-r--r-- | sixad-notify.patch | 8 | ||||
-rw-r--r-- | sixad.service | 15 |
12 files changed, 465 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6b6268d8bc86 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,48 @@ +pkgbase = qtsixa-git + pkgdesc = An utility to configure and use sixaxis controller via bluetooth. + pkgver = 1.5.1.74.c2f4ed9 + pkgrel = 1 + url = http://sourceforge.net/projects/qtsixa/ + install = qtsixa.install + arch = i686 + arch = x86_64 + arch = ppc + license = GPL + makedepends = patch + makedepends = pyqt + makedepends = bluez-libs + depends = bluez + depends = python2-pyqt + depends = qt4 + depends = python2 + depends = bluez-utils + depends = bluez-libs + depends = jack + depends = libusb-compat + conflicts = sixpair + conflicts = qtsixa + replaces = qtsixa + backup = etc/default/sixad + source = git+git://qtsixa.git.sourceforge.net/gitroot/qtsixa/qtsixa + source = sixad-init.patch + source = sixad-bin.patch + source = sixad.service + source = qtsixa-dbus.patch + source = qtsixa-gksudo.patch + source = sixad-lq.patch + source = sixad-notify.patch + source = bluetooth + source = 97-sixpair.rules + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + +pkgname = qtsixa-git + diff --git a/97-sixpair.rules b/97-sixpair.rules new file mode 100644 index 000000000000..60c6308f8eb4 --- /dev/null +++ b/97-sixpair.rules @@ -0,0 +1 @@ +SUBSYSTEM=="usb", ATTRS{idVendor}=="054c", ENV{idProduct}="0268", RUN+="/usr/sbin/sixpair" diff --git a/PKGBUILD b/PKGBUILD new file mode 100755 index 000000000000..d5d04e657a10 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,153 @@ +# Contributor: Mattias Andrée <`base64 -d`(bWFhbmRyZWUK)@member.fsf.org> +# Original Maintainer: Nolan Haynes <nolan haynes at gmail dot com> +# Maintainer: Lubosz Sarnecki <lubosz@gmail.com> + +pkgname=qtsixa-git +pkgver=1.5.1.74.c2f4ed9 +pkgrel=1 +pkgdesc="An utility to configure and use sixaxis controller via bluetooth." +url="http://sourceforge.net/projects/qtsixa/" +arch=('i686' 'x86_64' 'ppc') +license=('GPL') +install=qtsixa.install +backup=('etc/default/sixad') +depends=('bluez' 'python2-pyqt' 'qt4' 'python2' 'bluez-utils' 'bluez-libs' 'jack' 'libusb-compat') +makedepends=('patch' 'pyqt' 'bluez-libs') +conflicts=('sixpair' 'qtsixa') +replaces=('qtsixa') +source=(git+git://qtsixa.git.sourceforge.net/gitroot/qtsixa/qtsixa + sixad-init.patch + sixad-bin.patch + sixad.service + qtsixa-dbus.patch + qtsixa-gksudo.patch + sixad-lq.patch + sixad-notify.patch + bluetooth + 97-sixpair.rules) + +md5sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP') + +pkgver() { + cd "$srcdir"/qtsixa + + version=$(grep "QtSixA version" qtsixa/gui/main.py | sed 's/ print "QtSixA version: //' | sed 's/"//') + hash=$(git log --pretty=format:'%h' -n 1) + revision=$(git rev-list --count HEAD) + + echo $version.$revision.$hash +} + +prepare() { + # patch files for Arch Linux's filesystem heirarchy + pushd "$srcdir"/qtsixa + sed -i 's:/sbin/:/bin/:g' qtsixa/gui/qtsixa_main.py + sed -i 's: /bin/: /usr/bin/:g' qtsixa/gui/qtsixa_main.py + sed -i 's:/sbin/:/bin/:g' utils/Makefile + sed -i 's:/sbin/:/bin/:g' sixad/Makefile + sed -i 's: /sbin/: /usr/bin/:g' sixad/sixad + sed -i 's: /usr/sbin/: /usr/bin/:g' sixad/sixad + sed -i 's:/sbin/:/bin/:g' sixad/bluetooth.cpp + popd + + # patch for sixad daemon + echo "Patching sixad..." + patch -p0 < "$srcdir"/sixad-init.patch + patch -p0 < "$srcdir"/sixad-bin.patch + patch -p0 < "$srcdir"/qtsixa-dbus.patch + patch -p0 < "$srcdir"/qtsixa-gksudo.patch + patch -p0 < "$srcdir"/sixad-lq.patch + patch -p0 < "$srcdir"/sixad-notify.patch + + cd "$srcdir"/qtsixa/qtsixa/gui/ + echo "Fixing python shebangs..." + find . -name "*.py" -exec sed -i "s/python/python2/g" '{}' \; + sed -i 's/python/python2/g' ../qtsixa +} + +build() { + cd "$srcdir"/qtsixa + + make all || exit 1 + +} + +package() { +## Qtsixa installation, adapted from makefile of qtsixa folder ## +## make directories +mkdir -p \ + "$pkgdir"/usr/bin/ \ + "$pkgdir"/usr/lib/udev/rules.d/ \ + "$pkgdir"/usr/share/applications/ \ + "$pkgdir"/usr/share/pixmaps/ \ + "$pkgdir"/usr/share/qtsixa/ \ + "$pkgdir"/usr/share/qtsixa/game-profiles/ \ + "$pkgdir"/usr/share/qtsixa/gui/ \ + "$pkgdir"/usr/share/qtsixa/icons/ \ + "$pkgdir"/usr/share/qtsixa/pics/ \ + "$pkgdir"/usr/share/qtsixa/profiles +# "$pkgdir"/usr/share/doc/qtsixa/manual +# "$pkgdir"/usr/share/qtsixa/lang/ \ +# "$pkgdir"/usr/share/doc/qtsixa/ \ + + +## systemd +mkdir -p "$pkgdir"/usr/lib/systemd/system/ +install -m 644 "$srcdir"/sixad.service "$pkgdir"/usr/lib/systemd/system/ + +cd "$srcdir/qtsixa/qtsixa" + +## Install files + install -m 755 qtsixa "$pkgdir"/usr/bin/ + install -m 755 sixad-lq "$pkgdir"/usr/bin/ + install -m 755 sixad-notify "$pkgdir"/usr/bin/ +# install -m 644 manual/* "$pkgdir"/usr/share/doc/qtsixa/manual/ + install -m 644 "$srcdir"/97-sixpair.rules "$pkgdir"/usr/lib/udev/rules.d/ + install -m 644 game-profiles/* "$pkgdir"/usr/share/qtsixa/game-profiles/ + install -m 644 gui/*.py "$pkgdir"/usr/share/qtsixa/gui/ + install -m 644 icons/* "$pkgdir"/usr/share/qtsixa/icons/ + install -m 644 pics/* "$pkgdir"/usr/share/qtsixa/pics/ + install -m 644 profiles/* "$pkgdir"/usr/share/qtsixa/profiles/ +# install -m 644 lang/* "$pkgdir"/usr/share/qtsixa/lang/ + install -m 644 sixad-notify.desktop "$pkgdir"/usr/share/qtsixa/ + install -m 644 qtsixa.desktop "$pkgdir"/usr/share/applications/ + install -m 644 qtsixa.xpm "$pkgdir"/usr/share/pixmaps/ + +## Sixad installation, adapted from makefile of sixad folder ## +## Make directories + + mkdir -p \ + "$pkgdir"/etc/default/ \ + "$pkgdir"/etc/rc.d/ \ + "$pkgdir"/etc/logrotate.d/ \ + "$pkgdir"/var/lib/sixad/ \ + "$pkgdir"/var/lib/sixad/profiles/ + + chmod 775 -R "$pkgdir"/var/lib/sixad/ + + cd ../sixad + +# Install files + install -m 644 sixad.default "$pkgdir"/etc/default/sixad + install -m 755 sixad.init "$pkgdir"/etc/rc.d/sixad + install -m 755 "$srcdir"/bluetooth "$pkgdir"/etc/rc.d/ + install -m 644 sixad.log "$pkgdir"/etc/logrotate.d/sixad + install -m 755 sixad "$pkgdir"/usr/bin/ + install -m 755 bins/sixad-bin "$pkgdir"/usr/bin/ + install -m 755 bins/sixad-sixaxis "$pkgdir"/usr/bin/ + install -m 755 bins/sixad-remote "$pkgdir"/usr/bin/ + install -m 755 bins/sixad-3in1 "$pkgdir"/usr/bin/ + install -m 755 bins/sixad-raw "$pkgdir"/usr/bin/ + #chmod 777 -R "$pkgdir"/var/lib/sixad/ + +## Utils installation, adapted from makefile of utils folder ## +## Install files + + cd ../utils + install -m 755 bins/sixpair "$pkgdir"/usr/bin/ + install -m 755 bins/sixpair-kbd "$pkgdir"/usr/bin/ + install -m 755 bins/hidraw-dump "$pkgdir"/usr/bin/ + install -m 755 bins/sixad-jack "$pkgdir"/usr/bin/ + +} + diff --git a/bluetooth b/bluetooth new file mode 100755 index 000000000000..2f1d82a526ac --- /dev/null +++ b/bluetooth @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Creator: Soul_Est +# Email: soul.est.soul.est@gmail.com +# +# Shim for QTSixA until it's fully compatible with systemd +# The ":" command idea taken from here: http://ynniv.com/blog/2005/04/doing-nothing-in-bash.html#c3664104150986936775 +# +case "$1" in + start) + # It does nothing and has a 0.00s runtime! + #: && exit 0 + # Uncomment the next line if you use regular bluetooth + systemctl start bluetooth.service && exit 0 + ;; + stop) + # It does nothing and has a 0.00s runtime! + #: && exit 0 + # Uncomment the next line if you use regular bluetooth + systemctl stop bluetooth.service && exit 0 + ;; + restart) + # It does nothing and has a 0.00s runtime! + #: && exit 0 + # Uncomment the next line if you use regular bluetooth + systemctl restart bluetooth.service && exit 0 + ;; +esac +exit 1 diff --git a/qtsixa-dbus.patch b/qtsixa-dbus.patch new file mode 100644 index 000000000000..41b2a3bcfe4d --- /dev/null +++ b/qtsixa-dbus.patch @@ -0,0 +1,26 @@ + diff -urp qtsixa.orig/qtsixa/gui/qtsixa_main.py qtsixa/qtsixa/gui/qtsixa_main.py +--- qtsixa.orig/qtsixa/gui/qtsixa_main.py 2012-12-06 22:59:03.103868725 -0800 ++++ qtsixa/qtsixa/gui/qtsixa_main.py 2012-12-06 22:59:55.033596582 -0800 +@@ -307,6 +307,8 @@ class MainW(QMainWindow, ui_qtsixa_mainw + def func_DBusDisconnect(self, mode, name, mac): + bus = dbus.SystemBus() + try: ++ if (getoutput("qtsixa "+"--check-bluetoothd") == "0"): ++ raise + bluez_bus = bus.get_object('org.bluez', '/') + bluez_id = bluez_bus.DefaultAdapter(dbus_interface='org.bluez.Manager') + adapter_bus = bus.get_object('org.bluez', bluez_id) +diff -urp qtsixa.orig/qtsixa/qtsixa qtsixa/qtsixa/qtsixa +--- qtsixa.orig/qtsixa/qtsixa 2012-12-06 22:59:03.107202042 -0800 ++++ qtsixa/qtsixa/qtsixa 2012-12-06 22:59:17.417127047 -0800 +@@ -68,6 +68,10 @@ fi + echo "$ROOT" + ;; + ++ check-bluetoothd|-check-bluetoothd|--check-bluetoothd) ++ps -e | grep bluetoothd > /dev/null && echo "1" || echo "0" ++ ;; ++ + *) + if [ -f ./gui/main.py ]; then + exec python2 ./gui/main.py "$@" diff --git a/qtsixa-gksudo.patch b/qtsixa-gksudo.patch new file mode 100644 index 000000000000..c7700dee7773 --- /dev/null +++ b/qtsixa-gksudo.patch @@ -0,0 +1,71 @@ +diff -urpN qtsixa.orig/qtsixa/qtsixa qtsixa/qtsixa/qtsixa +--- qtsixa.orig/qtsixa/qtsixa 2012-12-06 22:04:55.574316391 -0800 ++++ qtsixa/qtsixa/qtsixa 2012-12-06 22:33:20.185320845 -0800 +@@ -10,44 +10,53 @@ case $1 in + KDESU='kdesu -- ' + KDESUDO='kdesudo -i /usr/share/qtsixa/icons/qtsixa.png -- ' + GKSU='gksu --description /usr/share/applications/qtsixa.desktop -- ' ++GKSUDO='gksudo --description /usr/share/applications/qtsixa.desktop --' + + #taken from winetricks (modified): + if [ x"$KDE_FULL_SESSION" = x"true" ]; then + { #KDE + if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else + if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi + } #KDE (End) + else if [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then + { #Gnome +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else +- if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else ++ if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi + } #Gnome (End) + else if [ x"$DISPLAY" != x"" ]; then + { #Other X +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else +- if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else ++ if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi + } #Other X (End) + else + { #No known session +- if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else +- if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else +- if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else +- ROOT='sudo' ++ if [ -f /usr/bin/gksudo ]; then ROOT="$GKSUDO"; else ++ if [ -f /usr/bin/gksu ]; then ROOT="$GKSU"; else ++ if [ -f /usr/bin/kdesudo ]; then ROOT="$KDESUDO"; else ++ if [ -f /usr/bin/kdesu ]; then ROOT="$KDESU"; else ++ ROOT='sudo' ++ fi + fi + fi + fi diff --git a/qtsixa.install b/qtsixa.install new file mode 100644 index 000000000000..ae48a85b124c --- /dev/null +++ b/qtsixa.install @@ -0,0 +1,15 @@ +post_install() { + groupadd sixad &> /dev/null + chown -R root:sixad /var/lib/sixad/ + chmod 775 -R /var/lib/sixad/ + echo "You may need to add your user in sixad's group in order to use QTSixa" + echo "'sudo usermod -a -G sixad username'" +} + +post_upgrade() { + groupadd sixad &> /dev/null + chown -R root:sixad /var/lib/sixad/ + chmod 775 -R /var/lib/sixad/ + echo "You may need to add your user in sixad's group in order to use QTSixa" + echo "'sudo usermod -a -G sixad username'" +} diff --git a/sixad-bin.patch b/sixad-bin.patch new file mode 100644 index 000000000000..5fe851d979d6 --- /dev/null +++ b/sixad-bin.patch @@ -0,0 +1,17 @@ +--- qtsixa/sixad/sixad.orig 2011-10-12 18:39:33.000000000 +0200 ++++ qtsixa/sixad/sixad 2011-12-28 18:18:05.000000000 +0100 +@@ -117,10 +117,10 @@ + $SUDO rc-update add sixad + # Debian (default) + else +- if [ -f /etc/rc2.d/S90sixad ]; then true; else $SUDO ln -s /etc/init.d/sixad /etc/rc2.d/S90sixad; fi +- if [ -f /etc/rc3.d/S90sixad ]; then true; else $SUDO ln -s /etc/init.d/sixad /etc/rc3.d/S90sixad; fi +- if [ -f /etc/rc4.d/S90sixad ]; then true; else $SUDO ln -s /etc/init.d/sixad /etc/rc4.d/S90sixad; fi +- if [ -f /etc/rc5.d/S90sixad ]; then true; else $SUDO ln -s /etc/init.d/sixad /etc/rc5.d/S90sixad; fi ++ if [ -f /etc/rc2.d/S90sixad ]; then true; else $SUDO ln -s /etc/rc.d/sixad /etc/rc2.d/S90sixad; fi ++ if [ -f /etc/rc3.d/S90sixad ]; then true; else $SUDO ln -s /etc/rc.d/sixad /etc/rc3.d/S90sixad; fi ++ if [ -f /etc/rc4.d/S90sixad ]; then true; else $SUDO ln -s /etc/rc.d/sixad /etc/rc4.d/S90sixad; fi ++ if [ -f /etc/rc5.d/S90sixad ]; then true; else $SUDO ln -s /etc/rc.d/sixad /etc/rc5.d/S90sixad; fi + fi + ;; + diff --git a/sixad-init.patch b/sixad-init.patch new file mode 100644 index 000000000000..c2c66edef17d --- /dev/null +++ b/sixad-init.patch @@ -0,0 +1,54 @@ +--- qtsixa/sixad/sixad.init.ori 2011-07-18 20:04:47.000000000 +0200 ++++ qtsixa/sixad/sixad.init 2011-10-22 16:40:56.000000000 +0200 +@@ -19,40 +19,40 @@ + ps -e | grep sixad-bin > /dev/null + } + +-. /lib/lsb/init-functions ++. /etc/rc.conf ++. /etc/rc.d/functions + + case "$1" in + start) + if (sixad_already_running_check "$1"); then +- log_warning_msg "sixad is already running" ++ stat_busy "Sixad is already running." ++ stat_fail + else + { +- log_daemon_msg "Starting sixad" ++ stat_busy "Starting sixad" + $DAEMON --start &>>/var/log/sixad & +- log_end_msg 0 ++ stat_done + } + fi + ;; + stop) + if (sixad_already_running_check "$1"); then + { +- log_daemon_msg "Stopping sixad" ++ stat_busy "Stopping sixad" + $DAEMON --stop || true +- log_end_msg 0 ++ stat_done + } + else +- log_warning_msg "sixad is not running" ++ stat_busy "Stopping sixad... is not running" ++ stat_fail + fi + ;; + restart) + $0 stop + $0 start + ;; +- status) +- status_of_proc "sixad-bin" "sixad" && exit 0 || exit $? +- ;; + *) +- echo "Usage: /etc/init.d/sixad {start|stop|restart|status}" >&2 ++ echo "Usage: /etc/rc.d/sixad {start|stop|restart}" >&2 + exit 1 + ;; + esac diff --git a/sixad-lq.patch b/sixad-lq.patch new file mode 100644 index 000000000000..fc6afaec8bdc --- /dev/null +++ b/sixad-lq.patch @@ -0,0 +1,28 @@ +--- qtsixa/qtsixa/sixad-lq.orig 2013-09-29 21:43:43.156531023 -0400 ++++ qtsixa/qtsixa/sixad-lq 2013-09-29 21:47:58.981811765 -0400 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python2 + # -*- coding: utf-8 -*- + # + # Small utility that triggers an action when certain LQ (Link/Signal Quality) attributtes are achieved +@@ -10,10 +10,10 @@ + + #Check for system arguments + if (len(sys.argv) == 1): +- print "Usage: sixa_lq <addr (text)> <operation (text)> <value (int)> <alsoDisconnect? (bool-int)> <bash command (text, in commas)>" ++ print "Usage: sixad_lq <addr (text)> <operation (text)> <value (int)> <alsoDisconnect? (bool-int)> <bash command (text, in commas)>" + exit(0) + elif (len(sys.argv) < 5): +- print "Error: Unsufficient arguments" ++ print "Error: Insufficient arguments" + exit(-1) + + +@@ -98,4 +98,4 @@ + + else: + print "Error: Invalid operation selected" +- exit(-5) +\ No newline at end of file ++ exit(-5) diff --git a/sixad-notify.patch b/sixad-notify.patch new file mode 100644 index 000000000000..ae94dc9898ad --- /dev/null +++ b/sixad-notify.patch @@ -0,0 +1,8 @@ +--- qtsixa/qtsixa/sixad-notify.orig 2013-09-29 21:43:56.159793912 -0400 ++++ qtsixa/qtsixa/sixad-notify 2013-09-29 21:48:22.971681801 -0400 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python2 + # -*- coding: utf-8 -*- + # + # Small utility that displays notifications when a device* is connected diff --git a/sixad.service b/sixad.service new file mode 100644 index 000000000000..300720d4c338 --- /dev/null +++ b/sixad.service @@ -0,0 +1,15 @@ +[Unit] +Description=SixAxis daemon +# It does not conflict, if the input plugin is disabled. +#Conflicts=bluetooth.service +After=bluetooth.target +Requires=bluetooth.service + +[Service] +Type=simple +ExecStart=/usr/bin/sixad-bin 0 0 0 +Restart=on-failure + +[Install] +WantedBy=bluetooth.target +#WantedBy=multi-user.target |