aboutsummaryrefslogtreecommitdiffstats
path: root/main/bluez/APKBUILD
blob: bb32ae6a1619e3b0669c6a26f77bbe73babedf89 (plain)
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=bluez
pkgver=5.60
pkgrel=3
pkgdesc="Tools for the Bluetooth protocol stack"
url="http://www.bluez.org/"
arch="all"
license="GPL-2.0-or-later"
depends="dbus"
replaces="udev"
makedepends="dbus-dev libusb-compat-dev eudev-dev json-c-dev
	libical-dev readline-dev glib-dev linux-headers
	autoconf automake libtool ell-dev py3-docutils"
subpackages="
	$pkgname-dev
	$pkgname-doc
	$pkgname-libs
	$pkgname-openrc
	$pkgname-btmgmt
	$pkgname-btmon
	$pkgname-cups
	$pkgname-deprecated
	$pkgname-deprecated-openrc
	$pkgname-hid2hci
	$pkgname-meshctl
	$pkgname-obexd
	$pkgname-plugins
	$pkgname-zsh-completion
	"
source="https://www.kernel.org/pub/linux/bluetooth/bluez-$pkgver.tar.xz
	bluetooth.initd
	rfcomm.initd
	rfcomm.confd
	org.bluez.obex.service
	mpris-proxy.desktop
	001-bcm43xx-Add-bcm43xx-3wire-variant.patch
	002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
	003-Increase-firmware-load-timeout-to-30s.patch
	004-Move-the-43xx-firmware-into-lib-firmware.patch
	005-hostname-Use-phone-class-for-handhelds.patch
	disable-lock-test.patch
	fix-endianness.patch
	musl.patch
	test-mesh-crypto.patch
	fix-musl.patch
	"

case "$CARCH" in
# crypto tests assume little-endian
mips*)	options="!check";;
esac

# secfixes:
#   5.54-r0:
#     - CVE-2020-0556

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--libexecdir=/usr/lib \
		--disable-systemd \
		--enable-library \
		--enable-deprecated \
		--enable-hid2hci \
		--enable-mesh \
		--enable-sixaxis \
		--with-dbusconfdir=/usr/share
	make
}

check() {
	make check
}

package() {
	make install DESTDIR="$pkgdir"
	install -D -m644 src/main.conf "$pkgdir"/etc/bluetooth/main.conf

	install -Dm755 "$srcdir"/bluetooth.initd "$pkgdir"/etc/init.d/bluetooth
	install -Dm755 "$srcdir"/rfcomm.initd "$pkgdir"/etc/init.d/rfcomm
	install -Dm644 "$srcdir"/rfcomm.confd "$pkgdir"/etc/conf.d/rfcomm

	# Fix shebang for the installed binary
	sed 's|^#!/usr/bin/python$|#!/usr/bin/env python3|g' -i test/simple-agent
	install -Dm755 test/simple-agent "$pkgdir"/usr/bin/bluez-simple-agent

	# Autostart mpris-proxy to pass through MPRIS control over BlueZ
	install -Dm644 "$srcdir"/mpris-proxy.desktop -t "$pkgdir"/etc/xdg/autostart/
}

btmgmt() {
	pkgdesc="Bluez tool for the Bluetooth Management API"
	install -Dm755 "$builddir"/tools/btmgmt "$subpkgdir"/usr/bin/btmgmt
}

btmon() {
	pkgdesc="Bluez bluetooth monitor"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/btmon "$subpkgdir"/usr/bin/
}

cups() {
	pkgdesc="Bluez backend for CUPS"
	mkdir -p "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/cups "$subpkgdir"/usr/lib/
}

hid2hci() {
	pkgdesc="Put HID proxying bluetooth HCI's into HCI mode"
	replaces="bluez"
	mkdir -p "$subpkgdir"
	mv "$pkgdir"/lib "$subpkgdir"/
}

deprecated() {
	pkgdesc="Deprecated bluetooth tools"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/ciptool \
		"$builddir"/attrib/gatttool \
		"$pkgdir"/usr/bin/hciattach \
		"$pkgdir"/usr/bin/hciconfig \
		"$pkgdir"/usr/bin/hcidump \
		"$pkgdir"/usr/bin/hcitool \
		"$pkgdir"/usr/bin/rfcomm \
		"$pkgdir"/usr/bin/sdptool \
		"$subpkgdir"/usr/bin/
}

meshctl() {
	pkgdesc="Bluez tool for interacting with bluetooth mesh networks"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/meshctl "$subpkgdir"/usr/bin/
}

obexd() {
	pkgdesc="Bluez OBEX daemon"
	mkdir -p "$subpkgdir"/usr/lib/bluetooth
	mv "$pkgdir"/usr/lib/bluetooth/obexd "$subpkgdir"/usr/lib/bluetooth
	install -Dm644 "$srcdir"/org.bluez.obex.service \
		"$subpkgdir"/usr/share/dbus-1/services/org.bluez.obex.service
}

plugins() {
	pkgdesc="Bluez plugins (PS3 Sixaxis controller)"
	cd "$builddir"
	make DESTDIR="$subpkgdir" install-pluginLTLIBRARIES

	# These are installed but should not be part of this package
	rm $subpkgdir/usr/lib/libbluetooth.so*
}

openrc() {
	case "$subpkgname" in
		"$pkgname"-deprecated-openrc)
			# Make this the same as deprecated()
			# the default_openrc function will add
			# the correct (OpenRC init scripts) suffix
			pkgdesc="Deprecated bluez tools"
			;;
	esac

	default_openrc

	case "$subpkgname" in
		"$pkgname"-openrc)
			# Move the rfcomm .initd and .confd back to the
			# mainpkg so the -deprecated-openrc subpackage
			# can move them later
			mkdir -p "$pkgdir"/etc/init.d "$pkgdir"/etc/conf.d
			mv "$subpkgdir"/etc/init.d/rfcomm "$pkgdir"/etc/init.d
			mv "$subpkgdir"/etc/conf.d/rfcomm "$pkgdir"/etc/conf.d
			rmdir "$subpkgdir"/etc/conf.d # Only rfcomm was here
			;;
	esac
}

sha512sums="
069e054360b4ab72f1daa033572f0fd822fb0f47e52069f4f3dcdfecfa312b9a5366cc04967e639aef39b980c0e1007389f1ee757e7c3bae43a5e66f8ed21a6b  bluez-5.60.tar.xz
e1d64fac673cceb657684b1bc5c36ff6d05f7cc5832d940863129adacd5b8ade1315b14df039a61f061950ac99e155266530efe2d2d35ea3c145b0469698a726  bluetooth.initd
8d7b7c8938a2316ce0a855e9bdf1ef8fcdf33d23f4011df828270a088b88b140a19c432e83fef15355d0829e3c86be05b63e7718fef88563254ea239b8dc12ac  rfcomm.initd
a70aa0dbbabe7e29ee81540a6f98bf191a850da55a28f678975635caf34b363cf4d461a801b3484120ee28fdd21240bd456a4f5d706262700924bd2e9a0972fb  rfcomm.confd
d6766a4992ed4141569d6d82a802a771a5cb4c08873bfb0fdbedeea4d738bf9b56d9e0452ec19b7635418b1af4ab9b1735692043d629cbed3ce0eda6f51e1c6f  org.bluez.obex.service
72f9bc6cafe910ed7d105d4f3a537b16cd897622b2391ea545e6a302fcce2ed79e490e2841c6290aa1290489870a67638d71b0de5bc57f9d650e2248d9e4f0a4  mpris-proxy.desktop
73202915fda01d420b2864da77b1c25af5a55c815e9be6546400a0940bfb6097d83322790bc22a80ec0fcd557144fdd1877e243a79285a7f040ff96ba3600b94  001-bcm43xx-Add-bcm43xx-3wire-variant.patch
d5fd1c962bd846eaa6fff879bab85f753eb367d514f82d133b5d3242e1da989af5eddd942c60a87d5b67783e060f91bfa0f74fb1e8e6699cdee6e5bbe6a431ea  002-bcm43xx-The-UART-speed-must-be-reset-after-the-firmw.patch
784e9644c8de4e2693e2eeed988a245608b8cb14e1fc0dff8795c60c527b2e8d0c87862cfbfd6b850b47ae80cdf993a5ed3f477078ea1068fd7374899c7a1a77  003-Increase-firmware-load-timeout-to-30s.patch
42ac04044a8c66e07487598b3a75ef52efc32999ebce4e7c63f6198e2f603f4a1442e74600e43a0938cb4f52d4db0298aa99050b18144b84990cda71748e9de5  004-Move-the-43xx-firmware-into-lib-firmware.patch
ac635f9bca0e983835940572eb1b96ad70cf60fb84d5b0fde38c76ea6d1b13ef7d9adf81468b9fed779c890ab69dd5dfabf21970bff018466115c424668b82fb  005-hostname-Use-phone-class-for-handhelds.patch
04c4889372c8e790bb338dde7ffa76dc32fcf7370025c71b9184fcf17fd01ade4a6613d84d648303af3bbc54043ad489f29fc0cd4679ec8c9029dcb846d7e026  disable-lock-test.patch
118d55183860f395fc4bdc93efffb13902ebf7388cad722b9061cd2860d404333e500af521741c3d92c0f8a161f6810348fbeb6682e49c372383f417aed8c76a  fix-endianness.patch
641e425333d269833eed624edec0e29cba04bb0ff6570f6afda178a164fc2bb77456fa88957fe49f36000d3601ac00bb7ba089400977c1577e9c226e74baa3d6  musl.patch
9c57bb1abf1b4927441a2a25c3c2599b0da82850e6b945d09e824e25be7c7efa99e54999cf5b799a1093303202badf08833cc4ccb36203901dfa516031ea8eb0  test-mesh-crypto.patch
2e92639512c11e69d3c47e222a012b4f58fa7727d18b3639130e8fe91654773b1205ddbe650efe49a26ec41a64d39ddba2806503272e09252c51d194e3ced33d  fix-musl.patch
"