From a3b91db3514e14eee42daf6044bb2ee5b31daaec Mon Sep 17 00:00:00 2001 From: Marcel Saegebarth Date: Thu, 20 Jun 2013 08:26:12 -0300 Subject: games/qtsixa: Added (Sixaxis Joystick Manager) Signed-off-by: Niels Horn --- games/qtsixa/README | 29 +++++++++ games/qtsixa/doinst.sh | 36 +++++++++++ games/qtsixa/qtsixa-dbus.patch | 43 +++++++++++++ games/qtsixa/qtsixa.SlackBuild | 131 ++++++++++++++++++++++++++++++++++++++ games/qtsixa/qtsixa.info | 10 +++ games/qtsixa/sixad-init.patch | 52 +++++++++++++++ games/qtsixa/sixad-shared-h.patch | 11 ++++ games/qtsixa/sixad.patch | 83 ++++++++++++++++++++++++ games/qtsixa/slack-desc | 19 ++++++ 9 files changed, 414 insertions(+) create mode 100644 games/qtsixa/README create mode 100644 games/qtsixa/doinst.sh create mode 100644 games/qtsixa/qtsixa-dbus.patch create mode 100644 games/qtsixa/qtsixa.SlackBuild create mode 100644 games/qtsixa/qtsixa.info create mode 100644 games/qtsixa/sixad-init.patch create mode 100644 games/qtsixa/sixad-shared-h.patch create mode 100644 games/qtsixa/sixad.patch create mode 100644 games/qtsixa/slack-desc diff --git a/games/qtsixa/README b/games/qtsixa/README new file mode 100644 index 0000000000..b6cb594d20 --- /dev/null +++ b/games/qtsixa/README @@ -0,0 +1,29 @@ +QtSixA is the Sixaxis Joystick Manager. It can connect PS3 hardware +(Sixaxis/DualShock3 and Keypads) to a Linux-compatible machine. +Currently it supports Sixaxis buttons, axis, accelerometers and LEDs. + +Some patches thankfully taken from https://aur.archlinux.org/packages/qtsixa/. + +Notes: + +Be sure you are using a Bluetooth dongle with a HCI version higher than 1.1 +by using `hciconfig default version | grep HCI`. + +Please note that due to the behaviour of "sixpair" and a replaced "hidd", +the stock Bluetooth stack is getting disabled while running and no other +Bluetooth devices will work, until the "replaced" hidd is disabled again +from `sh /etc/rc.d/rc.sixad stop`. + +In case something like `kdesu` is not installed, you need to run `qtsixa` +with root rights. + +Steps: + +- connect your device through USB +- start "qtsixa" and pair your device (Tasks->Pair Device to PC) +- start "sixad" by `sh /etc/rc.d/rc.sixad start` +- press the PS button on your controller + +Pairing is just needed once. If wanted, you can add rc.sixad to your +rc.local and pressing the PS button again after a reboot without any +further interaction. diff --git a/games/qtsixa/doinst.sh b/games/qtsixa/doinst.sh new file mode 100644 index 0000000000..1d5f2a2178 --- /dev/null +++ b/games/qtsixa/doinst.sh @@ -0,0 +1,36 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/rc.d/rc.sixad.new +config etc/logrotate.d/sixad.new +config etc/default/sixad.new + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/games/qtsixa/qtsixa-dbus.patch b/games/qtsixa/qtsixa-dbus.patch new file mode 100644 index 0000000000..deab7c3677 --- /dev/null +++ b/games/qtsixa/qtsixa-dbus.patch @@ -0,0 +1,43 @@ +diff -urp qtsixa/gui/qtsixa_main.py qtsixa/gui/qtsixa_main.py +--- qtsixa/gui/qtsixa_main.py 2012-12-06 22:59:03.103868725 -0800 ++++ 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/qtsixa qtsixa/qtsixa +--- qtsixa/qtsixa 2012-12-06 22:59:03.107202042 -0800 ++++ 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 -urp sixad/Makefile sixad/Makefile +--- sixad/Makefile 2012-12-06 22:59:03.100535408 -0800 ++++ sixad/Makefile 2012-12-06 22:59:17.417127047 -0800 +@@ -34,7 +34,6 @@ install: + install -m 755 bins/sixad-remote $(DESTDIR)/usr/sbin/ + install -m 755 bins/sixad-3in1 $(DESTDIR)/usr/sbin/ + install -m 755 bins/sixad-raw $(DESTDIR)/usr/sbin/ +- install -m 755 sixad-dbus-blocker $(DESTDIR)/usr/sbin/ + @chmod 777 -R $(DESTDIR)/var/lib/sixad/ + @echo "Installation is Complete!" + +@@ -47,5 +46,4 @@ uninstall: + rm -f $(DESTDIR)/usr/sbin/sixad-sixaxis + rm -f $(DESTDIR)/usr/sbin/sixad-remote + rm -f $(DESTDIR)/usr/sbin/sixad-raw +- rm -f $(DESTDIR)/usr/sbin/sixad-dbus-blocker + rm -rf $(DESTDIR)/var/lib/sixad/ diff --git a/games/qtsixa/qtsixa.SlackBuild b/games/qtsixa/qtsixa.SlackBuild new file mode 100644 index 0000000000..372686c599 --- /dev/null +++ b/games/qtsixa/qtsixa.SlackBuild @@ -0,0 +1,131 @@ +#!/bin/sh + +# SlackBuild script for "qtsixa". + +# Copyright 2013 Marcel Saegebarth +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=qtsixa +VERSION=1.5.1 +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +SRCNAM=QtSixA + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION-src.tar.gz +cd $SRCNAM-$VERSION + +patch -p0 < $CWD/sixad.patch +patch -p0 < $CWD/qtsixa-dbus.patch +for file in init shared-h ; do + patch -p0 < $CWD/sixad-$file.patch +done + +chown -R root:root . +chmod -R u+w,go+r-w,a-s . + +make CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" + +mkdir -p $PKG/usr/bin $PKG/usr/sbin $PKG/usr/doc/$PRGNAM-$VERSION \ +$PKG/usr/share/pixmaps $PKG/usr/share/applications $PKG/usr/share/qtsixa \ +$PKG/usr/share/qtsixa/profiles $PKG/usr/share/qtsixa/game-profiles \ +$PKG/usr/share/qtsixa/gui/ui $PKG/usr/share/qtsixa/icons \ +$PKG/usr/share/qtsixa/pics $PKG/var/lib/sixad/profiles \ +$PKG/etc/default $PKG/etc/logrotate.d $PKG/etc/rc.d + +for file in qtsixa sixad-lq sixad-notify ; do + install -m 0755 $TMP/$SRCNAM-$VERSION/qtsixa/$file $PKG/usr/bin +done + +install -m 0755 $TMP/$SRCNAM-$VERSION/sixad/sixad $PKG/usr/bin +for file in 3in1 bin raw remote sixaxis ; do + install -s -m 0755 $TMP/$SRCNAM-$VERSION/sixad/bins/sixad-$file $PKG/usr/sbin +done + +for file in hidraw-dump sixad-jack sixpair sixpair-kbd ; do + install -s -m 0755 $TMP/$SRCNAM-$VERSION/utils/bins/$file $PKG/usr/sbin +done + +install -m 0644 $TMP/$SRCNAM-$VERSION/qtsixa/profiles/* \ +$PKG/usr/share/qtsixa/profiles +install -m 0644 $TMP/$SRCNAM-$VERSION/qtsixa/game-profiles/* \ +$PKG/usr/share/qtsixa/game-profiles +cp -r $TMP/$SRCNAM-$VERSION/qtsixa/gui $PKG/usr/share/qtsixa +chmod -R 755 $PKG/usr/share/qtsixa/gui +install -m 0644 $TMP/$SRCNAM-$VERSION/qtsixa/icons/* $PKG/usr/share/qtsixa/icons +install -m 0644 $TMP/$SRCNAM-$VERSION/qtsixa/pics/* $PKG/usr/share/qtsixa/pics +install -m 0644 $TMP/$SRCNAM-$VERSION/qtsixa/qtsixa.desktop \ +$PKG/usr/share/applications +install -m 0644 $TMP/$SRCNAM-$VERSION/qtsixa/sixad-notify.desktop \ +$PKG/usr/share/applications +install -m 0644 $TMP/$SRCNAM-$VERSION/qtsixa/qtsixa.xpm \ +$PKG/usr/share/pixmaps + +install -m 0644 $TMP/$SRCNAM-$VERSION/sixad/sixad.default $PKG/etc/default/sixad.new +install -m 0644 $TMP/$SRCNAM-$VERSION/sixad/sixad.init $PKG/etc/rc.d/rc.sixad.new +install -m 0644 $TMP/$SRCNAM-$VERSION/sixad/sixad.log $PKG/etc/logrotate.d/sixad.new + +for file in COPYING INSTALL README TODO manual.pdf ; do + install -m 0644 $TMP/$SRCNAM-$VERSION/$file $PKG/usr/doc/$PRGNAM-$VERSION +done + +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/games/qtsixa/qtsixa.info b/games/qtsixa/qtsixa.info new file mode 100644 index 0000000000..30fb9df892 --- /dev/null +++ b/games/qtsixa/qtsixa.info @@ -0,0 +1,10 @@ +PRGNAM="qtsixa" +VERSION="1.5.1" +HOMEPAGE="http://sourceforge.net/projects/qtsixa/" +DOWNLOAD="http://downloads.sourceforge.net/qtsixa/QtSixA-1.5.1-src.tar.gz" +MD5SUM="d61bef5d737367aeddd57a6bc11da52a" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="jack-audio-connection-kit" +MAINTAINER="Marcel Saegebarth" +EMAIL="marc@mos6581.de" diff --git a/games/qtsixa/sixad-init.patch b/games/qtsixa/sixad-init.patch new file mode 100644 index 0000000000..51ae0b11ff --- /dev/null +++ b/games/qtsixa/sixad-init.patch @@ -0,0 +1,52 @@ +--- sixad/sixad.init.orig 2013-03-30 18:09:41.713986598 +0100 ++++ sixad/sixad.init 2013-03-30 18:11:19.787352424 +0100 +@@ -19,40 +19,37 @@ + ps -e | grep sixad-bin > /dev/null + } + +-. /lib/lsb/init-functions +- + case "$1" in + start) + if (sixad_already_running_check "$1"); then +- log_warning_msg "sixad is already running" ++ echo "sixad is already running" ++ exit 1 + else + { +- log_daemon_msg "Starting sixad" ++ echo "Starting sixad" + $DAEMON --start &>>/var/log/sixad & +- log_end_msg 0 ++ exit 0 + } + fi + ;; + stop) + if (sixad_already_running_check "$1"); then + { +- log_daemon_msg "Stopping sixad" ++ echo "Stopping sixad" + $DAEMON --stop || true +- log_end_msg 0 ++ exit 0 + } + else +- log_warning_msg "sixad is not running" ++ echo "sixad is not running" ++ exit 1 + 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/rc.sixad {start|stop|restart}" >&2 + exit 1 + ;; + esac diff --git a/games/qtsixa/sixad-shared-h.patch b/games/qtsixa/sixad-shared-h.patch new file mode 100644 index 0000000000..7459e7b154 --- /dev/null +++ b/games/qtsixa/sixad-shared-h.patch @@ -0,0 +1,11 @@ +--- sixad/shared.h.orig 2011-10-12 02:37:38.000000000 +0200 ++++ sixad/shared.h 2012-04-10 13:36:49.119637000 +0200 +@@ -18,6 +18,8 @@ + #ifndef SHARED_H + #define SHARED_H + ++#include ++ + struct dev_led { + bool enabled; + bool anim; \ No newline at end of file diff --git a/games/qtsixa/sixad.patch b/games/qtsixa/sixad.patch new file mode 100644 index 0000000000..441559fe84 --- /dev/null +++ b/games/qtsixa/sixad.patch @@ -0,0 +1,83 @@ +--- sixad/sixad.orig 2011-10-12 18:39:33.000000000 +0200 ++++ sixad/sixad 2013-03-30 19:15:48.576679323 +0100 +@@ -48,13 +48,8 @@ + } + + bt_start () { +-$SUDO rm -f /tmp/.sixad-dbus-blocker.pid +-env sleep 1 +- +-if [ -f /lib/udev/rules.d/97-bluetooth.rules ]; then +- $SUDO /usr/sbin/bluetoothd --udev +-elif [ -f /etc/rc.d/bluetooth ]; then +- $SUDO /etc/rc.d/bluetooth start ++if [ -f /etc/rc.d/rc.bluetooth ]; then ++ $SUDO /etc/rc.d/rc.bluetooth start + else + $SUDO /etc/init.d/bluetooth start + fi +@@ -62,10 +57,12 @@ + + bt_stop() { + if (bluetoothd_running_check); then +- $SUDO pkill -KILL bluetoothd ++ if [ -f /etc/rc.d/rc.bluetooth ]; then ++ $SUDO /etc/rc.d/rc.bluetooth stop ++ else ++ $SUDO /etc/init.d/bluetooth stop ++ fi + fi +- +-$SUDO /usr/sbin/sixad-dbus-blocker & + } + + case $1 in +@@ -108,38 +105,6 @@ + bt_start + ;; + +- --boot-yes) +-# ArchLinux +-if [ -f /etc/arch-release ]; then +- $SUDO sed '/DAEMONS=/ s/)/ sixad)/g' -i /etc/rc.conf +-# Gentoo +-elif [ -f /etc/gentoo-release ]; then +- $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 +-fi +- ;; +- +- --boot-no) +-# ArchLinux +-if [ -f /etc/arch-release ]; then +- $SUDO sed "s/ sixad//" -i /etc/rc.conf +-# Gentoo +-elif [ -f /etc/gentoo-release ]; then +- $SUDO rc-update delete sixad +-# Debian (default) +-else +- if [ -f /etc/rc2.d/S90sixad ]; then $SUDO rm /etc/rc2.d/S90sixad; fi +- if [ -f /etc/rc3.d/S90sixad ]; then $SUDO rm /etc/rc3.d/S90sixad; fi +- if [ -f /etc/rc4.d/S90sixad ]; then $SUDO rm /etc/rc4.d/S90sixad; fi +- if [ -f /etc/rc5.d/S90sixad ]; then $SUDO rm /etc/rc5.d/S90sixad; fi +-fi +- ;; +- + --help|-help|help|-h) + echo "[Qt]SixA Daemon" + $0 +@@ -162,9 +127,6 @@ + + -r, --restore Restore regular bluetooth + +- --boot-yes Auto-starts sixad at boot time +- --boot-no Does not auto-start sixad at boot time +- + You can also check: sixad-raw, sixad-notify" + ;; + diff --git a/games/qtsixa/slack-desc b/games/qtsixa/slack-desc new file mode 100644 index 0000000000..aee15622ac --- /dev/null +++ b/games/qtsixa/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +qtsixa: QtSixA (Sixaxis Joystick Manager) +qtsixa: +qtsixa: QtSixA is the Sixaxis Joystick Manager. It can connect PS3 hardware +qtsixa: (Sixaxis/DualShock3 and Keypads) to a Linux-compatible machine. +qtsixa: Currently it supports Sixaxis buttons, axis, accelerometers and LEDs. +qtsixa: +qtsixa: Homepage: http://sourceforge.net/projects/qtsixa/ +qtsixa: +qtsixa: +qtsixa: +qtsixa: -- cgit v1.2.3