summaryrefslogtreecommitdiff
path: root/bluez.spec
blob: ff528723eff723b1a4425b879f99faef4f58c4ab (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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# TODO:
# - verify/update bluetooth init script
# - separate obex?
#
# Conditional build:
%bcond_without	deprecated	# deprecated tools (ciptool,hciattach,hciconfig,hcidump,hcitool,rfcomm,sdptool)
%bcond_without	static_libs	# static library
%bcond_without	systemd		# systemd
#
Summary:	Bluetooth utilities
Summary(pl.UTF-8):	Narzędzia Bluetooth
Name:		bluez
Version:	5.73
Release:	1
License:	GPL v2+
Group:		Applications/System
Source0:	https://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.xz
# Source0-md5:	7812034c8b91bf11e4f1379734756a3b
Source1:	%{name}.init
Source2:	%{name}.sysconfig
# Scripts for automatically btattach-ing serial ports connected to Broadcom HCIs
# as found on some Atom based x86 hardware
Source3:	69-btattach-bcm.rules
Source4:	btattach-bcm@.service
Source5:	btattach-bcm-service.sh
Patch0:		0001-obex-Use-GLib-helper-function-to-manipulate-paths.patch
URL:		http://www.bluez.org/
BuildRequires:	alsa-lib-devel >= 1.0
BuildRequires:	autoconf >= 2.60
BuildRequires:	automake
BuildRequires:	check-devel >= 0.9.6
BuildRequires:	cups-devel
BuildRequires:	dbus-devel >= 1.10
BuildRequires:	docutils
BuildRequires:	ell-devel >= 0.39
BuildRequires:	glib2-devel >= 1:2.28
BuildRequires:	json-c-devel >= 0.13
BuildRequires:	libical-devel
BuildRequires:	libtool
BuildRequires:	pkgconfig >= 1:0.9.0
BuildRequires:	readline-devel
BuildRequires:	rpm-build >= 4.6
BuildRequires:	rpmbuild(macros) >= 2.011
%{?with_systemd:BuildRequires:	systemd-devel}
BuildRequires:	tar >= 1:1.22
BuildRequires:	udev-devel >= 1:196
BuildRequires:	xz
Requires(post,preun,postun):	systemd-units >= 1:250.1
Requires:	%{name}-libs = %{version}-%{release}
Requires:	dbus-libs >= 1.10
Requires:	ell >= 0.39
Requires:	glib2 >= 1:2.28
Requires:	hwdata >= 0.225
Requires:	json-c >= 0.13
Requires:	rc-scripts
Requires:	systemd-units >= 1:250.1
Requires:	udev >= 1:196
Provides:	bluez-hcidump = %{version}
Provides:	bluez-utils = %{version}-%{release}
Provides:	obexd = %{version}
Provides:	dbus(org.openobex.client)
Provides:	obex-data-server = %{version}
# moved somewhere or dropped?
#Obsoletes:	alsa-plugins-bluetooth
Obsoletes:	bluez-hcidump < 3
Obsoletes:	bluez-hciemu < 2
Obsoletes:	bluez-pan < 2
Obsoletes:	bluez-sdp < 2
Obsoletes:	bluez-systemd < 4.98-3
Obsoletes:	bluez-utils < 4
Obsoletes:	bluez-utils-init < 4
Obsoletes:	obexd < 1
Obsoletes:	obex-data-server < 1
# moved somewhere or dropped?
#Obsoletes:	gstreamer-bluetooth < 4.101-3
#Obsoletes:	gstreamer0.10-bluetooth < 5
Conflicts:	bluez-bluefw
ExcludeArch:	s390 s390x
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

# currently lib, not %{_lib} (see cups.spec)
%define		cupsdir		/usr/lib/cups/backend
%define		udevdir		/lib/udev

%description
Bluetooth utilities:
 - bluetoothd
 - hciattach
 - hciconfig
 - hcidump
 - hcitool
 - l2ping
 - start scripts (PLD)

The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.

%description -l pl.UTF-8
Narzędzia Bluetooth:
 - bluetoothd
 - hciattach
 - hciconfig
 - hcidump
 - hcitool
 - l2ping
 - skrypty startowe (PLD)

Znaki towarowe BLUETOOTH są własnością Bluetooth SIG, Inc. z USA.

%package -n cups-backend-bluetooth
Summary:	Bluetooth backend for CUPS
Summary(pl.UTF-8):	Backend Bluetooth dla CUPS-a
Group:		Applications/Printing
Requires:	%{name}-libs = %{version}-%{release}
Requires:	cups

%description -n cups-backend-bluetooth
Bluetooth backend for CUPS.

%description -n cups-backend-bluetooth -l pl.UTF-8
Backend Bluetooth dla CUPS-a.

%package -n zsh-completion-bluez
Summary:	Zsh completion for bluez commands
Summary(pl.UTF-8):	Dopełnianie parametrów w zsh dla poleceń z pakietu bluez
Group:		Applications/Shells
Requires:	%{name} = %{version}-%{release}
Requires:	zsh
BuildArch:	noarch

%description -n zsh-completion-bluez
Zsh completion for bluez commands (bluezctl utility).

%description -n zsh-completion-bluez -l pl.UTF-8
Dopełnianie parametrów w zsh dla poleceń z pakietu bluez (narzędzia
bluezctl).

%package libs
Summary:	Bluetooth libraries
Summary(pl.UTF-8):	Biblioteki Bluetooth
Group:		Libraries
Obsoletes:	bluez-sdp < 2

%description libs
Libraries for use in Bluetooth applications.

The BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.

%description libs -l pl.UTF-8
Biblioteki do używania w aplikacjach Bluetooth.

Znaki towarowe BLUETOOTH są własnością Bluetooth SIG, Inc. z USA.

%package libs-devel
Summary:	Header files for Bluetooth applications
Summary(pl.UTF-8):	Pliki nagłówkowe dla aplikacji Bluetooth
Group:		Development/Libraries
Requires:	%{name}-libs = %{version}-%{release}
Obsoletes:	bluez-sdp-devel < 2

%description libs-devel
bluez-libs-devel contains header files for use in Bluetooth
applications.

%description libs-devel -l pl.UTF-8
Ten pakiet zawiera pliki nagłówkowe do używania w aplikacjach
Bluetooth.

%package libs-static
Summary:	Static Bluetooth libraries
Summary(pl.UTF-8):	Biblioteki statyczne Bluetooth
Group:		Development/Libraries
Requires:	%{name}-libs-devel = %{version}-%{release}
Obsoletes:	bluez-sdp-static < 2

%description libs-static
bluez-libs-static contains development static libraries for use in
Bluetooth applications.

%description libs-static -l pl.UTF-8
Ten pakiet zawiera biblioteki statyczne, których można używać do
aplikacji Bluetooth.

%prep
%setup -q
%patch0 -p1

# external ell is broken if ell/ell.h is in place due to deps generation and Makefile.am rules
%{__rm} -r ell

%build
%{__libtoolize}
%{__aclocal}
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
	--disable-silent-rules \
	--enable-btpclient \
	%{?with_deprecated:--enable-deprecated} \
	--enable-experimental \
	--enable-external-ell \
	--enable-external-plugins \
	--enable-health \
	--enable-hid2hci \
	--enable-library \
	--enable-tools \
	--enable-cups \
	--enable-testing \
	--enable-mesh \
	--enable-midi \
	--enable-nfc \
	--enable-sap \
	--enable-sixaxis \
	%{__enable_disable static_libs static} \
	--with-udevdir=%{udevdir} \
	%{?with_systemd:--with-systemdsystemunitdir=%{systemdunitdir}} \
	%{?with_systemd:--with-systemduserunitdir=%{systemduserunitdir}} \
	%{!?with_systemd:--disable-systemd}

%{__make} \
	cupsdir=%{cupsdir}

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig} \
	$RPM_BUILD_ROOT{%{_libdir}/{bluetooth,obex}/plugins,%{_sysconfdir}/bluetooth}

%{__make} install \
	DESTDIR=$RPM_BUILD_ROOT \
	cupsdir=%{cupsdir} \
	rulesdir=%{udevdir}/rules.d \
	udevdir=%{udevdir}

install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/bluetooth
install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/bluetooth

#serial port connected Broadcom HCIs scripts
install %{SOURCE3} $RPM_BUILD_ROOT%{udevdir}/rules.d
%{?with_systemd:install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}}
install %{SOURCE5} $RPM_BUILD_ROOT%{_libexecdir}/bluetooth

# Install the HCI emulator, useful for testing
install emulator/btvirt $RPM_BUILD_ROOT%{_libexecdir}/bluetooth

%{__rm} $RPM_BUILD_ROOT%{_libdir}/libbluetooth.la

%clean
rm -rf $RPM_BUILD_ROOT

%post
/sbin/chkconfig --add bluetooth
%service bluetooth restart
%systemd_post bluetooth.service
%systemd_user_post obex.service

%preun
if [ "$1" = "0" ]; then
	%service bluetooth stop
	/sbin/chkconfig --del bluetooth
fi
%systemd_preun bluetooth.service
%systemd_user_preun obex.service

%postun
%systemd_reload

%triggerpostun -- bluez < 5.13-1
%service rfcomm stop
/sbin/chkconfig --del rfcomm
# bluez < 4.98-3
%systemd_trigger bluetooth.service

%post   libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog README
%attr(755,root,root) %{_bindir}/bluemoon
%attr(755,root,root) %{_bindir}/bluetoothctl
%attr(755,root,root) %{_bindir}/btattach
%attr(755,root,root) %{_bindir}/btmon
%attr(755,root,root) %{_bindir}/hex2hcd
%attr(755,root,root) %{_bindir}/isotest
%attr(755,root,root) %{_bindir}/l2ping
%attr(755,root,root) %{_bindir}/l2test
%attr(755,root,root) %{_bindir}/mesh-cfgclient
%attr(755,root,root) %{_bindir}/mesh-cfgtest
%attr(755,root,root) %{_bindir}/meshctl
%attr(755,root,root) %{_bindir}/mpris-proxy
%attr(755,root,root) %{_bindir}/rctest
%if %{with deprecated}
%attr(755,root,root) %{_bindir}/ciptool
%attr(755,root,root) %{_bindir}/hciattach
%attr(755,root,root) %{_bindir}/hciconfig
%attr(755,root,root) %{_bindir}/hcidump
%attr(755,root,root) %{_bindir}/hcitool
%attr(755,root,root) %{_bindir}/rfcomm
%attr(755,root,root) %{_bindir}/sdptool
%endif
%if "%{_libexecdir}" != "%{_libdir}"
%dir %{_libexecdir}/bluetooth
%endif
%attr(755,root,root) %{_libexecdir}/bluetooth/bluetooth-meshd
%attr(755,root,root) %{_libexecdir}/bluetooth/bluetoothd
%attr(755,root,root) %{_libexecdir}/bluetooth/btattach-bcm-service.sh
%attr(755,root,root) %{_libexecdir}/bluetooth/btvirt
%attr(755,root,root) %{_libexecdir}/bluetooth/obexd
%dir %{_libdir}/bluetooth
%dir %{_libdir}/bluetooth/plugins
%dir %{_libdir}/obex
%dir %{_libdir}/obex/plugins
%dir %{_sysconfdir}/bluetooth
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bluetooth/input.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bluetooth/main.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bluetooth/mesh-main.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/bluetooth/network.conf
%attr(754,root,root) /etc/rc.d/init.d/bluetooth
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/bluetooth
%if %{with systemd}
%{systemdunitdir}/bluetooth.service
%{systemdunitdir}/bluetooth-mesh.service
%{systemdunitdir}/btattach-bcm@.service
%{systemduserunitdir}/dbus-org.bluez.obex.service
%{systemduserunitdir}/obex.service
%{_datadir}/dbus-1/services/org.bluez.obex.service
%{_datadir}/dbus-1/system-services/org.bluez.service
%{_datadir}/dbus-1/system-services/org.bluez.mesh.service
%{_datadir}/dbus-1/system.d/bluetooth.conf
%{_datadir}/dbus-1/system.d/bluetooth-mesh.conf
%endif
%attr(755,root,root) %{udevdir}/hid2hci
%{udevdir}/rules.d/69-btattach-bcm.rules
%{udevdir}/rules.d/97-hid2hci.rules
%{_mandir}/man1/bluetoothctl.1*
%{_mandir}/man1/bluetoothctl-admin.1*
%{_mandir}/man1/bluetoothctl-advertise.1*
%{_mandir}/man1/bluetoothctl-endpoint.1*
%{_mandir}/man1/bluetoothctl-gatt.1*
%{_mandir}/man1/bluetoothctl-mgmt.1*
%{_mandir}/man1/bluetoothctl-monitor.1*
%{_mandir}/man1/bluetoothctl-player.1*
%{_mandir}/man1/bluetoothctl-scan.1*
%{_mandir}/man1/bluetoothctl-transport.1*
%{_mandir}/man1/btattach.1*
%{_mandir}/man1/btmgmt.1*
%{_mandir}/man1/btmon.1*
%{_mandir}/man1/hid2hci.1*
%{_mandir}/man1/isotest.1*
%{_mandir}/man1/l2ping.1*
%{_mandir}/man1/rctest.1*
%if %{with deprecated}
%{_mandir}/man1/ciptool.1*
%{_mandir}/man1/hciattach.1*
%{_mandir}/man1/hciconfig.1*
%{_mandir}/man1/hcidump.1*
%{_mandir}/man1/hcitool.1*
%{_mandir}/man1/rfcomm.1*
%{_mandir}/man1/sdptool.1*
%endif
%{_mandir}/man5/org.bluez.*.5*
%{_mandir}/man8/bluetooth-meshd.8*
%{_mandir}/man8/bluetoothd.8*

%files -n cups-backend-bluetooth
%defattr(644,root,root,755)
%attr(755,root,root) %{_prefix}/lib/cups/backend/bluetooth

%files -n zsh-completion-bluez
%defattr(644,root,root,755)
%{zsh_compdir}/_bluetoothctl

%files libs
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libbluetooth.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libbluetooth.so.3

%files libs-devel
%defattr(644,root,root,755)
%attr(755,root,root) %{_libdir}/libbluetooth.so
%{_includedir}/bluetooth
%{_pkgconfigdir}/bluez.pc

%if %{with static_libs}
%files libs-static
%defattr(644,root,root,755)
%{_libdir}/libbluetooth.a
%endif