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>
7 pkgname=('bluez' 'bluez-utils' 'bluez-libs' 'bluez-cups' 'bluez-hid2hci' 'bluez-plugins')
10 url="http://www.bluez.org/"
14 makedepends=('dbus' 'libical' 'systemd' 'alsa-lib' 'json-c' 'ell' 'python-docutils')
15 source=(https://www.kernel.org/pub/linux/bluetooth/${pkgname}-${pkgver}.tar.{xz,sign}
18 # see https://www.kernel.org/pub/linux/bluetooth/sha256sums.asc
19 sha256sums=('2565a4d48354b576e6ad92e25b54ed66808296581c8abb80587051f9993d96d4'
21 '46c021be659c9a1c4e55afd04df0c059af1f3d98a96338236412e449bf7477b4')
22 validpgpkeys=('E932D120BC2AEC444E558F0106CA9F5D1DCF2659') # Marcel Holtmann <marcel@holtmann.org>
25 cd "${pkgname}"-${pkgver}
28 --mandir=/usr/share/man \
30 --localstatedir=/var \
31 --libexecdir=/usr/lib \
32 --with-dbusconfdir=/usr/share \
38 --enable-experimental \
39 --enable-library # this is deprecated
50 pkgdesc="Daemons for the bluetooth protocol stack"
51 depends=('libical' 'dbus' 'glib2' 'alsa-lib' 'json-c')
52 backup=('etc/bluetooth/main.conf')
53 conflicts=('obexd-client' 'obexd-server')
55 cd "${pkgbase}"-${pkgver}
56 make DESTDIR=${pkgdir} \
57 install-pkglibexecPROGRAMS \
58 install-dbussessionbusDATA \
59 install-systemdsystemunitDATA \
60 install-systemduserunitDATA \
61 install-dbussystembusDATA \
65 # ship upstream main config file
66 install -dm755 "${pkgdir}"/etc/bluetooth
67 install -Dm644 "${srcdir}"/"${pkgbase}"-${pkgver}/src/main.conf "${pkgdir}"/etc/bluetooth/main.conf
69 # add basic documention
70 install -dm755 "${pkgdir}"/usr/share/doc/"${pkgbase}"/dbus-apis
71 cp -a doc/*.txt "${pkgdir}"/usr/share/doc/"${pkgbase}"/dbus-apis/
72 # fix module loading errors
73 install -dm755 "${pkgdir}"/usr/lib/modprobe.d
74 install -Dm644 "${srcdir}"/bluetooth.modprobe "${pkgdir}"/usr/lib/modprobe.d/bluetooth-usb.conf
75 # load module at system start required by some functions
76 # https://bugzilla.kernel.org/show_bug.cgi?id=196621
77 install -dm755 "$pkgdir"/usr/lib/modules-load.d
78 echo "crypto_user" > "$pkgdir"/usr/lib/modules-load.d/bluez.conf
80 # fix obex file transfer - https://bugs.archlinux.org/task/45816
81 ln -fs /usr/lib/systemd/user/obex.service "${pkgdir}"/usr/lib/systemd/user/dbus-org.bluez.obex.service
83 # FS#74157 - bluez systemd service fails without localstatedir present
84 install -dm700 "${pkgdir}"/var/lib/bluetooth
86 # cleanup - these libs go into bluez-libs
87 rm "${pkgdir}"/usr/lib/libbluetooth.so*
90 package_bluez-utils() {
91 pkgdesc="Development and debugging utilities for the bluetooth protocol stack"
92 depends=('dbus' 'systemd' 'glib2')
93 optdepends=('ell: for btpclient')
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 \
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
110 # libbluetooth.so* are part of libLTLIBRARIES and binPROGRAMS targets
111 #make DESTDIR=${pkgdir} uninstall-libLTLIBRARIES
112 #rmdir ${pkgdir}/usr/lib
113 rm -rf "${pkgdir}"/usr/lib
115 # move the hid2hci man page out
116 mv "${pkgdir}"/usr/share/man/man1/hid2hci.1 "${srcdir}"/
119 package_bluez-libs() {
120 pkgdesc="Deprecated libraries for the bluetooth protocol stack"
122 provides=('libbluetooth.so')
125 cd "${pkgbase}"-${pkgver}
126 make DESTDIR="${pkgdir}" \
127 install-pkgincludeHEADERS \
128 install-libLTLIBRARIES \
129 install-pkgconfigDATA
132 package_bluez-cups() {
133 pkgdesc="CUPS printer backend for Bluetooth printers"
136 cd "${pkgbase}"-${pkgver}
137 make DESTDIR="${pkgdir}" install-cupsPROGRAMS
139 # cleanup - these libs go into bluez-libs
140 rm "${pkgdir}"/usr/lib/libbluetooth.so*
143 package_bluez-hid2hci() {
144 pkgdesc="Put HID proxying bluetooth HCI's into HCI mode"
147 cd "${pkgbase}"-${pkgver}
148 make DESTDIR=${pkgdir} \
149 install-udevPROGRAMS \
152 install -dm755 "${pkgdir}"/usr/share/man/man1
153 mv "${srcdir}"/hid2hci.1 "${pkgdir}"/usr/share/man/man1/hid2hci.1
155 # cleanup - these libs go into bluez-libs
156 rm "${pkgdir}"/usr/lib/libbluetooth.so*
159 package_bluez-plugins() {
160 pkgdesc="bluez plugins (PS3 Sixaxis controller)"
163 cd "${pkgbase}"-${pkgver}
164 make DESTDIR="${pkgdir}" \
165 install-pluginLTLIBRARIES
167 # cleanup - these libs go into bluez-libs
168 rm "${pkgdir}"/usr/lib/libbluetooth.so*