aboutsummaryrefslogtreecommitdiffstats
path: root/qtsixa/PKGBUILD
blob: fbbbeb6495b94df7c0096d887a045df760bd743f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Maintainer: Mattias Andrée <maandree@operamail.com>
pkgname=qtsixa
pkgver=1.5.1
pkgrel=8
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
	sixad.service)
md5sums=('d61bef5d737367aeddd57a6bc11da52a'
	 'a8c7585f628ac5b2eafeb735e3eab28b'
	 '0496d5e8c16b4519042bd024ad07b32d'
	 'f7ed53be82bc4148b9a35cd565eb6ebe'
	 '7d885a478cdf4dca1c1b724a91bcfdaf')
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/ \


##systemd
mkdir -p $pkgdir/usr/lib/systemd/system/
install -m 644 $srcdir/sixad.service $pkgdir/usr/lib/systemd/system/

cd 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 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/

}