updated on Sun Jan 15 16:02:00 UTC 2012
[aur-mirror.git] / bluez-git-wiimote / PKGBUILD
blob5c95b4fef9e684c0301de969bed8ff2f8f4638c6
1 # Maintainer: Arturo Martinez
3 pkgname=bluez-git-wiimote
4 pkgver=20111229
5 pkgrel=2
6 pkgdesc="Libraries and tools for the Bluetooth protocol stack"
8 url="http://www.bluez.org/"
9 arch=('i686' 'x86_64')
10 license=('GPL2')
11 depends=('dbus-core')
12 makedepends=('gstreamer0.10-base' 'libusb-compat' 'libnl' 'libsndfile')
13 optdepends=("gstreamer0.10-base: bluetooth GStreamer support"
14         "alsa-lib: Audio bluetooth devices support"
15         "dbus-python: to run bluez-simple-agent"
16         "pygobject: to run bluez-simple-agent"
17         "libusb-compat: USB adapters support"
18         "cups: CUPS backend"
19         "libnl: netlink plugin")
21 conflicts=('bluez' 'bluez-libs' 'bluez-utils')
22 provides=('bluez=4.97' 'bluez-libs' 'bluez-utils')
23 replaces=('bluez' 'bluez-libs' 'bluez-utils')
25 options=('!libtool' 'emptydirs')
26 backup=(etc/bluetooth/{main,rfcomm,audio,network,input,serial}.conf
27         'etc/conf.d/bluetooth' 'etc/dbus-1/system.d/bluetooth.conf')
28 source=('bluetooth.conf.d'
29         'rc.bluetooth' '0001-Fix-wiimote-device_get_address-to-use-new-API.patch' 
30 '0002-Detect-Wii-Remotes-by-device-name.patch' )
31 md5sums=('7412982b440f29fa7f76a41a87fef985'
32          '8f9498707f809506928b2e480d3b6789'
33         '1e98cc7494b375152ad0d97fd77ddd45'
34         'af9cfa5ce79201510a9bfbda6e7ed71e')
36 _gitroot="git://git.kernel.org/pub/scm/bluetooth/bluez.git"
37 _gitname="bluez"
39 build() {
40   cd ${srcdir}
41   msg "Connecting to GIT server...."
43   if [ -d ${srcdir}/${_gitname} ] ; then
44     cd ${_gitname} && git pull origin
45     msg "The local files are updated."
46   else
47     git clone ${_gitroot}
48   fi
50   msg "GIT checkout done or server timeout"
51   msg "Starting make..."
54   cd ${srcdir}/${_gitname}
55  patch -p1 -i $srcdir/0001-Fix-wiimote-device_get_address-to-use-new-API.patch || return 1
56  patch -p1 -i $srcdir/0002-Detect-Wii-Remotes-by-device-name.patch || return 1 
58   ./bootstrap || return 1
59   ./configure --prefix=/usr \
60     --sysconfdir=/etc \
61     --localstatedir=/var \
62     --libexecdir=/lib \
63     --enable-gstreamer \
64     --enable-alsa \
65     --enable-usb \
66     --enable-tools \
67     --enable-bccmd \
68     --enable-dfutool \
69     --enable-hid2hci \
70     --enable-hidd \
71     --enable-pand \
72     --enable-dund \
73     --enable-cups \
74     --enable-wiimote
75   make
77   
78 package() {
79   cd ${srcdir}/${_gitname}
80   make DESTDIR=${pkgdir} install || return 1
82   install -Dm755 ${srcdir}/rc.bluetooth ${pkgdir}/etc/rc.d/bluetooth
83   
84   install -d ${pkgdir}/etc/bluetooth
85   install -m644 network/network.conf \
86                 input/input.conf \
87                 audio/audio.conf \
88                 serial/serial.conf \
89     ${pkgdir}/etc/bluetooth/
90   
91   install -Dm644 ${srcdir}/bluetooth.conf.d \
92     ${pkgdir}/etc/conf.d/bluetooth
94   # FS#27630
95   install -Dm755 test/simple-agent "${pkgdir}"/usr/bin/bluez-simple-agent
96   install -Dm755 test/test-device "${pkgdir}"/usr/bin/bluez-test-device
97   install -Dm755 test/test-input "${pkgdir}"/usr/bin/bluez-test-input
98   sed -i 's#/usr/bin/python#/usr/bin/python2#' \
99     "${pkgdir}"/usr/bin/bluez-simple-agent \
100     "${pkgdir}"/usr/bin/bluez-test-device \
101     "${pkgdir}"/usr/bin/bluez-test-input
103   # http://mailman.archlinux.org/pipermail/arch-general/2011-April/019787.html
104   rm "${pkgdir}"/lib/udev/rules.d/97-bluetooth.rules