From 352267912d243d4454d98370e998e70346e03572 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 18 Nov 2012 21:54:40 +0100 Subject: adopt qtsixa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- qtsixa/PKGBUILD | 110 ++++++++++++++++++++++++++++++++++++++++++++ qtsixa/qtsixa.install | 13 ++++++ qtsixa/sixad-bin.patch | 17 +++++++ qtsixa/sixad-init.patch | 54 ++++++++++++++++++++++ qtsixa/sixad-shared-h.patch | 11 +++++ qtsixa/watch | 17 +++++++ 6 files changed, 222 insertions(+) create mode 100755 qtsixa/PKGBUILD create mode 100644 qtsixa/qtsixa.install create mode 100644 qtsixa/sixad-bin.patch create mode 100644 qtsixa/sixad-init.patch create mode 100644 qtsixa/sixad-shared-h.patch create mode 100755 qtsixa/watch diff --git a/qtsixa/PKGBUILD b/qtsixa/PKGBUILD new file mode 100755 index 0000000..233b3bf --- /dev/null +++ b/qtsixa/PKGBUILD @@ -0,0 +1,110 @@ +# Maintainer: Mattias Andrée +pkgname=qtsixa +pkgver=1.5.1 +pkgrel=7 +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' 'qt' 'python2' 'bluez-hcidump' 'jack' 'libusb-compat') +makedepends=('patch') +source=(http://downloads.sourceforge.net/qtsixa/QtSixA-"$pkgver"-src.tar.gz + sixad-init.patch + sixad-bin.patch + sixad-shared-h.patch) +md5sums=('d61bef5d737367aeddd57a6bc11da52a' + 'a8c7585f628ac5b2eafeb735e3eab28b' + '0496d5e8c16b4519042bd024ad07b32d' + 'f7ed53be82bc4148b9a35cd565eb6ebe') +build() { + # patch for sixad daemon + echo "Patching sixad..." + patch -p0 < $srcdir/sixad-init.patch + patch -p0 < $srcdir/sixad-bin.patch + patch -p0 < $srcdir/sixad-shared-h.patch + + cd $srcdir/QtSixA-$pkgver/qtsixa/gui/ + echo "Fixed python version..." + find . -name "*.py" -exec sed -i "s/python/python2/g" '{}' \; + sed -i 's/python/python2/g' ../qtsixa + sed -i 's/python/python2/g' ../../sixad/sixad-dbus-blocker + echo "Fixed bluetooth daemon" + sed -i 's/init.d/rc.d/g' qtsixa_main.py + + cd $srcdir/QtSixA-$pkgver + + make all || exit 1 + +## Qtsixa installation, adapted from makefile of qtsixa folder ## +## make directories +mkdir -p \ + $pkgdir/usr/bin/ \ + $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/ \ + +cd qtsixa + +## Install files + install -m 655 qtsixa $pkgdir/usr/bin/ + install -m 655 sixad-lq $pkgdir/usr/bin/ + install -m 655 sixad-notify $pkgdir/usr/bin/ +# install -m 644 manual/* $pkgdir/usr/share/doc/qtsixa/manual/ + 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/usr/sbin/ \ + $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 644 sixad.log $pkgdir/etc/logrotate.d/sixad + install -m 755 sixad $pkgdir/usr/bin/ + install -m 755 bins/sixad-bin $pkgdir/usr/sbin/ + install -m 755 bins/sixad-sixaxis $pkgdir/usr/sbin/ + install -m 755 bins/sixad-remote $pkgdir/usr/sbin/ + install -m 755 bins/sixad-3in1 $pkgdir/usr/sbin/ + install -m 755 bins/sixad-raw $pkgdir/usr/sbin/ + install -m 755 sixad-dbus-blocker $pkgdir/usr/sbin/ + #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/sbin/ + install -m 755 bins/sixpair-kbd $pkgdir/usr/sbin/ + install -m 755 bins/hidraw-dump $pkgdir/usr/sbin/ + install -m 755 bins/sixad-jack $pkgdir/usr/bin/ + +} diff --git a/qtsixa/qtsixa.install b/qtsixa/qtsixa.install new file mode 100644 index 0000000..fd8ebfb --- /dev/null +++ b/qtsixa/qtsixa.install @@ -0,0 +1,13 @@ +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" + } + +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" +} diff --git a/qtsixa/sixad-bin.patch b/qtsixa/sixad-bin.patch new file mode 100644 index 0000000..f19d0ea --- /dev/null +++ b/qtsixa/sixad-bin.patch @@ -0,0 +1,17 @@ +--- QtSixA-1.5.1/sixad/sixad.orig 2011-10-12 18:39:33.000000000 +0200 ++++ QtSixA-1.5.1/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/qtsixa/sixad-init.patch b/qtsixa/sixad-init.patch new file mode 100644 index 0000000..afc0aeb --- /dev/null +++ b/qtsixa/sixad-init.patch @@ -0,0 +1,54 @@ +--- QtSixA-1.5.1/sixad/sixad.init.ori 2011-07-18 20:04:47.000000000 +0200 ++++ QtSixA-1.5.1/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/qtsixa/sixad-shared-h.patch b/qtsixa/sixad-shared-h.patch new file mode 100644 index 0000000..9940b97 --- /dev/null +++ b/qtsixa/sixad-shared-h.patch @@ -0,0 +1,11 @@ +--- QtSixA-1.5.1/sixad/shared.h.orig 2011-10-12 02:37:38.000000000 +0200 ++++ QtSixA-1.5.1/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/qtsixa/watch b/qtsixa/watch new file mode 100755 index 0000000..40b452e --- /dev/null +++ b/qtsixa/watch @@ -0,0 +1,17 @@ +#!/bin/sh + +wget http://sourceforge.net/projects/qtsixa/files/ >/dev/null 2>/dev/null +if [ $? = 0 ]; then + grep QtSixA < index.html | md5sum > new-sum + touch sum + if [ "$(cat sum)" = "$(cat new-sum)" ]; then + rm new-sum + else + mv new-sum sum + echo 'qtsixa' + fi + rm index.html +else + echo 'qtsixa (unfetchable)' +fi + -- cgit v1.2.3-70-g09d2