projects/aports·blob master · refs

219 lines · 7.6 KiB

1# Contributor: Leo <[email protected]>
2# Maintainer: Natanael Copa <[email protected]>
3pkgname=bluez
4# Make sure to also update the obexd-enhanced package if updating bluez
5pkgver=5.87
6pkgrel=0
7pkgdesc="Tools for the Bluetooth protocol stack"
8url="https://www.bluez.org/"
9arch="all"
10license="GPL-2.0-or-later AND BSD-2-Clause AND MIT"
11depends="dbus"
12replaces="udev"
13makedepends="
14 autoconf
15 automake
16 dbus-dev
17 ell-dev
18 eudev-dev
19 glib-dev
20 json-c-dev
21 libical-dev
22 libtool
23 linux-headers
24 py3-docutils
25 py3-pygments
26 readline-dev
27 "
28subpackages="
29 $pkgname-dbg
30 $pkgname-dev
31 $pkgname-doc
32 $pkgname-libs
33 $pkgname-openrc
34 $pkgname-systemd
35 $pkgname-btmgmt
36 $pkgname-btmon
37 $pkgname-cups
38 $pkgname-deprecated
39 $pkgname-deprecated-openrc
40 $pkgname-hid2hci
41 $pkgname-meshctl
42 $pkgname-obexd
43 $pkgname-zsh-completion
44 "
45source="https://www.kernel.org/pub/linux/bluetooth/bluez-$pkgver.tar.xz
46 bluetooth.initd
47 rfcomm.initd
48 rfcomm.confd
49 org.bluez.obex.service
50 mpris-proxy.desktop
51 001-bcm43xx-Add-bcm43xx-3wire-variant.patch
52 002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
53 003-Increase-firmware-load-timeout-to-30s.patch
54 004-Move-the-43xx-firmware-into-lib-firmware.patch
55 005-hostname-Use-phone-class-for-handhelds.patch
56 fix-endianness.patch
57 test-mesh-crypto.patch
58 modules-load.conf
59 systemd.patch
60 5.87_1-adapter-Fix-crash-on-dev_disconnected.patch
61 5.87_2-l2test-Fix-calling-getsockopt-BT_PHY.patch
62 5.87_3-adapter-Fix-crash-on-UUID-discovery-filter-match.patch
63 5.87_4-gobex-Fix-use-after-free-when-cancelling-SRM-PUT-transfer.patch
64 "
65
66# secfixes:
67# 5.54-r0:
68# - CVE-2020-0556
69
70prepare() {
71 default_prepare
72 autoreconf -vfi
73}
74
75build() {
76 CFLAGS="$CFLAGS -flto=auto" \
77 ./configure \
78 --build=$CBUILD \
79 --host=$CHOST \
80 --prefix=/usr \
81 --sysconfdir=/etc \
82 --mandir=/usr/share/man \
83 --localstatedir=/var \
84 --libexecdir=/usr/lib \
85 --with-systemdsystemunitdir=/usr/lib/systemd/system \
86 --with-systemduserunitdir=/usr/lib/systemd/user \
87 --disable-systemd \
88 --enable-library \
89 --enable-deprecated \
90 --enable-hid2hci \
91 --enable-mesh \
92 --enable-sixaxis \
93 --with-dbusconfdir=/usr/share
94 make
95}
96
97check() {
98 make check || {
99 cat test-suite.log
100 return 1
101 }
102}
103
104package() {
105 make DESTDIR="$pkgdir" install install-pluginLTLIBRARIES
106
107 install -D -m644 src/main.conf "$pkgdir"/etc/bluetooth/main.conf
108
109 install -Dm755 "$srcdir"/bluetooth.initd "$pkgdir"/etc/init.d/bluetooth
110 install -Dm755 "$srcdir"/rfcomm.initd "$pkgdir"/etc/init.d/rfcomm
111 install -Dm644 "$srcdir"/rfcomm.confd "$pkgdir"/etc/conf.d/rfcomm
112
113 install -Dm755 test/simple-agent "$pkgdir"/usr/bin/bluez-simple-agent
114 install -Dm755 tools/btmgmt -t "$pkgdir"/usr/bin/
115 install -Dm755 attrib/gatttool -t "$pkgdir"/usr/bin/
116
117 install -Dm644 "$srcdir"/org.bluez.obex.service \
118 "$pkgdir"/usr/share/dbus-1/services/org.bluez.obex.service
119
120 # Autostart mpris-proxy to pass through MPRIS control over BlueZ
121 install -Dm644 "$srcdir"/mpris-proxy.desktop -t "$pkgdir"/etc/xdg/autostart/
122
123 # modules which are required for some bluetooth accessories (keyboards, AVRCP, etc)
124 install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/bluez.conf
125}
126
127btmgmt() {
128 pkgdesc="Bluez tool for the Bluetooth Management API"
129 amove usr/bin/btmgmt
130}
131
132btmon() {
133 pkgdesc="Bluez bluetooth monitor"
134 amove usr/bin/btmon
135}
136
137cups() {
138 pkgdesc="Bluez backend for CUPS"
139 amove usr/lib/cups
140}
141
142hid2hci() {
143 pkgdesc="Put HID proxying bluetooth HCI's into HCI mode"
144 replaces="bluez"
145 amove usr/lib/udev
146}
147
148deprecated() {
149 pkgdesc="Deprecated bluetooth tools"
150 amove \
151 usr/bin/ciptool \
152 usr/bin/gatttool \
153 usr/bin/hciattach \
154 usr/bin/hciconfig \
155 usr/bin/hcitool \
156 usr/bin/rfcomm \
157 usr/bin/sdptool
158}
159
160meshctl() {
161 pkgdesc="Bluez tool for interacting with bluetooth mesh networks"
162 amove usr/bin/meshctl
163}
164
165obexd() {
166 pkgdesc="Bluez OBEX daemon"
167 provides="obexd"
168 provider_priority=100
169 amove \
170 usr/lib/bluetooth/obexd \
171 usr/share/dbus-1/services/org.bluez.obex.service
172}
173
174openrc() {
175 case "$subpkgname" in
176 "$pkgname"-deprecated-openrc)
177 # Make this the same as deprecated()
178 # the default_openrc function will add
179 # the correct (OpenRC init scripts) suffix
180 pkgdesc="Deprecated bluez tools"
181 ;;
182 esac
183
184 default_openrc
185
186 case "$subpkgname" in
187 "$pkgname"-openrc)
188 # Move the rfcomm .initd and .confd back to the
189 # mainpkg so the -deprecated-openrc subpackage
190 # can move them later
191 mkdir -p "$pkgdir"/etc/init.d "$pkgdir"/etc/conf.d
192 mv "$subpkgdir"/etc/init.d/rfcomm "$pkgdir"/etc/init.d
193 mv "$subpkgdir"/etc/conf.d/rfcomm "$pkgdir"/etc/conf.d
194 rmdir "$subpkgdir"/etc/conf.d # Only rfcomm was here
195 ;;
196 esac
197}
198
199sha512sums="
200f1e3bede9b0bbc3b5cfe9fed5f7945be7cbcf7a299729b5f82f1cba4bbbd6c4d2e372c9685f61458dfc374c9dfee352b6c2933a2c0d7727b8171ff394055e169 bluez-5.87.tar.xz
2015442f4f489718e51c50611c143803f2cc99e540b55a72af20ea2921b256774a6c7c5e273f2bedb745753d8c67d3fb7c938750fb48feac7460b32bd1cca029a28 bluetooth.initd
2028d7b7c8938a2316ce0a855e9bdf1ef8fcdf33d23f4011df828270a088b88b140a19c432e83fef15355d0829e3c86be05b63e7718fef88563254ea239b8dc12ac rfcomm.initd
203a70aa0dbbabe7e29ee81540a6f98bf191a850da55a28f678975635caf34b363cf4d461a801b3484120ee28fdd21240bd456a4f5d706262700924bd2e9a0972fb rfcomm.confd
204d6766a4992ed4141569d6d82a802a771a5cb4c08873bfb0fdbedeea4d738bf9b56d9e0452ec19b7635418b1af4ab9b1735692043d629cbed3ce0eda6f51e1c6f org.bluez.obex.service
20572f9bc6cafe910ed7d105d4f3a537b16cd897622b2391ea545e6a302fcce2ed79e490e2841c6290aa1290489870a67638d71b0de5bc57f9d650e2248d9e4f0a4 mpris-proxy.desktop
20673202915fda01d420b2864da77b1c25af5a55c815e9be6546400a0940bfb6097d83322790bc22a80ec0fcd557144fdd1877e243a79285a7f040ff96ba3600b94 001-bcm43xx-Add-bcm43xx-3wire-variant.patch
207d5fd1c962bd846eaa6fff879bab85f753eb367d514f82d133b5d3242e1da989af5eddd942c60a87d5b67783e060f91bfa0f74fb1e8e6699cdee6e5bbe6a431ea 002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
208784e9644c8de4e2693e2eeed988a245608b8cb14e1fc0dff8795c60c527b2e8d0c87862cfbfd6b850b47ae80cdf993a5ed3f477078ea1068fd7374899c7a1a77 003-Increase-firmware-load-timeout-to-30s.patch
2096d864d893aaf08d7a04f5cb27a6b2767c361cd41e479f27ed84d9fbbd2677298c15e31161a614af098df8faf3da54b71cf315fe8e9a9a2f671e4720c7b8b457b 004-Move-the-43xx-firmware-into-lib-firmware.patch
210ac635f9bca0e983835940572eb1b96ad70cf60fb84d5b0fde38c76ea6d1b13ef7d9adf81468b9fed779c890ab69dd5dfabf21970bff018466115c424668b82fb 005-hostname-Use-phone-class-for-handhelds.patch
211a08b9afb2278cfb06ae48998ab5c765244c23091eeabc1a8918df7879affce24fff0a857d2a31fa95976f99314407a45cdd1cbaf3a31dde929890acb6922f76a fix-endianness.patch
212b5d6f7d2df755a9b8cffaeef13d232ba1bab27544bc59e2299bbd6a8017768cf7781f3ca65e430a149a26f0b30ae74b8510529ce161705bb6f41ae512cc2dbac test-mesh-crypto.patch
213946e7abe25fcafab2b0051eeed811b61f16d0d222da1420389076451a8a363aaf8decdf0f18f8125cbc138307d61ceedd67fd105765351301db9f2f880fbfefa modules-load.conf
214f7612dcd96557cd2c82769de9d0f74644b8750ce5016454388fb4b9232f907dc0229797c1ee7ec969954faa880da6d333fea76884d019dae58e78818e2f1e99c systemd.patch
215d8b6de8399d6b39b7af5264b4635b5df316c8ae8ab2abdf17dba4ee2cab9ad52263a477c7899f71b4659a587b3c485a3ef2eb6b4743a3c17ff4c512212edc9cb 5.87_1-adapter-Fix-crash-on-dev_disconnected.patch
21606fe49669cce5f24a39e21f6c561aa45ebec25f8c9b05400dd7c0a20844311cf56cbdb54d9e3437576700e85c556463f8461545189bc4dd863feb139da3f3a77 5.87_2-l2test-Fix-calling-getsockopt-BT_PHY.patch
217e32f89676e8c545c7a092a22dbbf73d18abac46a36d54aef78a6aedc8b648bcd02c735409ad076691ceafa25e7191ece7083560a47950963af281cb3d2d41429 5.87_3-adapter-Fix-crash-on-UUID-discovery-filter-match.patch
218f43fbdc287f23279629fd7e634c57b7ed744d4eb45199cc6ea2d6a470214a88af50366f26236ffd99cf25c72e0ece0b6df8a05f4313fe886129e275ad68287fc 5.87_4-gobex-Fix-use-after-free-when-cancelling-SRM-PUT-transfer.patch
219"