archrelease: copy trunk to extra-x86_64
[arch-packages.git] / bluez / trunk / PKGBUILD
blob03b3ff5482dab69ceca07d0760cb8cbbd45d1277
1 # Maintainer: Andreas Radke <andyrtr@archlinux.org>
2 # Contributor: Tom Gundersen <teg@jklm.no>
3 # Contributor: Andrea Scarpino <andrea@archlinux.org>
4 # Contributor: Geoffroy Carrier <geoffroy@archlinux.org>
6 pkgbase=bluez
7 pkgname=('bluez' 'bluez-utils' 'bluez-libs' 'bluez-cups' 'bluez-hid2hci' 'bluez-plugins')
8 pkgver=5.66
9 pkgrel=1
10 url="http://www.bluez.org/"
11 arch=('x86_64')
12 license=('GPL2')
13 makedepends=('dbus' 'libical' 'systemd' 'alsa-lib' 'json-c' 'ell' 'python-docutils')
14 source=(https://www.kernel.org/pub/linux/bluetooth/${pkgname}-${pkgver}.tar.{xz,sign}
15         bluetooth.modprobe
17 # see https://www.kernel.org/pub/linux/bluetooth/sha256sums.asc
18 sha256sums=('39fea64b590c9492984a0c27a89fc203e1cdc74866086efb8f4698677ab2b574'
19             'SKIP'
20             '46c021be659c9a1c4e55afd04df0c059af1f3d98a96338236412e449bf7477b4')
21 validpgpkeys=('E932D120BC2AEC444E558F0106CA9F5D1DCF2659') # Marcel Holtmann <marcel@holtmann.org>
23 build() {
24   cd "${pkgname}"-${pkgver}
25   ./configure \
26           --prefix=/usr \
27           --mandir=/usr/share/man \
28           --sysconfdir=/etc \
29           --localstatedir=/var \
30           --libexecdir=/usr/lib \
31           --with-dbusconfdir=/usr/share \
32           --enable-btpclient \
33           --enable-midi \
34           --enable-sixaxis \
35           --enable-mesh \
36           --enable-hid2hci \
37           --enable-experimental \
38           --enable-library # this is deprecated
39   make
42 check() {
43   cd "$pkgname"-$pkgver
44   make check
48 package_bluez() {
49   pkgdesc="Daemons for the bluetooth protocol stack"
50   depends=('libical' 'dbus' 'glib2' 'alsa-lib' 'json-c')
51   backup=('etc/bluetooth/main.conf')
52   conflicts=('obexd-client' 'obexd-server')
54   cd "${pkgbase}"-${pkgver}
55   make DESTDIR=${pkgdir} \
56        install-pkglibexecPROGRAMS \
57        install-dbussessionbusDATA \
58        install-systemdsystemunitDATA \
59        install-systemduserunitDATA \
60        install-dbussystembusDATA \
61        install-dbusDATA \
62        install-man8
64   # ship upstream main config file
65   install -dm555 "${pkgdir}"/etc/bluetooth
66   install -Dm644 "${srcdir}"/"${pkgbase}"-${pkgver}/src/main.conf "${pkgdir}"/etc/bluetooth/main.conf
68   # add basic documention
69   install -dm755 "${pkgdir}"/usr/share/doc/"${pkgbase}"/dbus-apis
70   cp -a doc/*.txt "${pkgdir}"/usr/share/doc/"${pkgbase}"/dbus-apis/
71   # fix module loading errors
72   install -dm755 "${pkgdir}"/usr/lib/modprobe.d
73   install -Dm644 "${srcdir}"/bluetooth.modprobe "${pkgdir}"/usr/lib/modprobe.d/bluetooth-usb.conf
74   # load module at system start required by some functions
75   # https://bugzilla.kernel.org/show_bug.cgi?id=196621
76   install -dm755 "$pkgdir"/usr/lib/modules-load.d
77   echo "crypto_user" > "$pkgdir"/usr/lib/modules-load.d/bluez.conf
78   
79   # fix obex file transfer - https://bugs.archlinux.org/task/45816
80   ln -fs /usr/lib/systemd/user/obex.service "${pkgdir}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
82   # FS#74157 - bluez systemd service fails without localstatedir present
83   install -dm700 "${pkgdir}"/var/lib/bluetooth
85   # cleanup  - these libs go into bluez-libs
86   rm "${pkgdir}"/usr/lib/libbluetooth.so*
89 package_bluez-utils() {
90   pkgdesc="Development and debugging utilities for the bluetooth protocol stack"
91   depends=('dbus' 'systemd' 'glib2')
92   optdepends=('ell: for btpclient')
93   backup=('etc/bluetooth/mesh-main.conf')
94   conflicts=('bluez-hcidump')
95   provides=('bluez-hcidump')
96   replaces=('bluez-hcidump' 'bluez<=4.101')
98   cd "${pkgbase}"-${pkgver}
99   make DESTDIR="${pkgdir}" \
100        install-binPROGRAMS \
101        install-dist_zshcompletionDATA \
102        install-man1
104   # add missing tools FS#41132, FS#41687, FS#42716
105   for files in `find tools/ -type f -perm -755`; do
106     filename=$(basename $files)
107     install -Dm755 "${srcdir}"/"${pkgbase}"-${pkgver}/tools/$filename "${pkgdir}"/usr/bin/$filename
108   done
109   
110   # ship upstream mesh config file
111   install -dm555 "${pkgdir}"/etc/bluetooth
112   install -Dm644 "${srcdir}"/"${pkgbase}"-${pkgver}/mesh/mesh-main.conf "${pkgdir}"/etc/bluetooth/mesh-main.conf
114   # libbluetooth.so* are part of libLTLIBRARIES and binPROGRAMS targets
115   #make DESTDIR=${pkgdir} uninstall-libLTLIBRARIES
116   #rmdir ${pkgdir}/usr/lib
117   rm -rf "${pkgdir}"/usr/lib
119   # move the hid2hci man page out
120   mv "${pkgdir}"/usr/share/man/man1/hid2hci.1 "${srcdir}"/
123 package_bluez-libs() {
124   pkgdesc="Deprecated libraries for the bluetooth protocol stack"
125   depends=('glibc')
126   provides=('libbluetooth.so')
127   license=('LGPL2.1')
129   cd "${pkgbase}"-${pkgver}
130   make DESTDIR="${pkgdir}" \
131        install-pkgincludeHEADERS \
132        install-libLTLIBRARIES \
133        install-pkgconfigDATA
136 package_bluez-cups() {
137   pkgdesc="CUPS printer backend for Bluetooth printers"
138   depends=('cups')
140   cd "${pkgbase}"-${pkgver}
141   make DESTDIR="${pkgdir}" install-cupsPROGRAMS
143   # cleanup  - these libs go into bluez-libs
144   rm "${pkgdir}"/usr/lib/libbluetooth.so*
147 package_bluez-hid2hci() {
148   pkgdesc="Put HID proxying bluetooth HCI's into HCI mode"
149   depends=('systemd')
151   cd "${pkgbase}"-${pkgver}
152   make DESTDIR=${pkgdir} \
153        install-udevPROGRAMS \
154        install-rulesDATA
155   
156   install -dm755 "${pkgdir}"/usr/share/man/man1
157   mv "${srcdir}"/hid2hci.1 "${pkgdir}"/usr/share/man/man1/hid2hci.1
159   # cleanup  - these libs go into bluez-libs
160   rm "${pkgdir}"/usr/lib/libbluetooth.so*
163 package_bluez-plugins() {
164   pkgdesc="bluez plugins (PS3 Sixaxis controller)"
165   depends=('systemd')
167   cd "${pkgbase}"-${pkgver}
168   make DESTDIR="${pkgdir}" \
169        install-pluginLTLIBRARIES
171   # cleanup  - these libs go into bluez-libs
172   rm "${pkgdir}"/usr/lib/libbluetooth.so*