summaryrefslogtreecommitdiff
path: root/packaging/bluez.spec
blob: 218ec3c8df443db0217b02e865f6f20c1f4388a1 (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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# Do not create provides fro extension-tm1 because the main package
# should anchor any reverse-dependencies
%global __provides_exclude_from ^(.*\\.tm1)$

#%define __spec_check_pre exit 0

#%define with_libcapng --enable-capng
%define _libpath /usr/lib
Name:       	bluez
Summary:    	Bluetooth Stack for Linux
Version:    	5.50
Release:    	1
Group:      	Network & Connectivity/Bluetooth
License:    	GPL-2.0+ and LGPL-2.1+
URL:        	http://www.bluez.org/
Source:         bluez-%{version}.tar.gz
Source2:        bluez-coldplug.init
Source3:        bluetooth.sysconfig
Source4:        bluetooth.sh
Source5:        baselibs.conf
Source7:        bluetooth.modprobe
Source101:    	obex-root-setup
Source102:    	create-symlinks
Source103:      obex.sh
Source1001:     bluez.manifest
#Patch1 :    bluez-ncurses.patch
#Patch2 :    disable-eir-unittest.patch
#Requires:   dbus >= 0.60
#BuildRequires:  pkgconfig(libudev)
BuildRequires:  pkgconfig(dbus-1)
BuildRequires:  pkgconfig(iniparser)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(json-c)
#BuildRequires:  pkgconfig(glib-2.0)
#BuildRequires:  pkgconfig(ncurses)
#BuildRequires:  flex
#BuildRequires:  bison
#BuildRequires:  readline-devel
#BuildRequires:  openssl-devel
BuildRequires:  flex
BuildRequires:  libcap-ng-devel
BuildRequires:  systemd
%{?systemd_requires}
BuildRequires:  pkgconfig(alsa)
BuildRequires:  automake
BuildRequires:  check-devel
BuildRequires:  glib2-devel >= 2.16
BuildRequires:  libsndfile-devel
BuildRequires:  libtool
BuildRequires:  libudev-devel
BuildRequires:  libusb-devel
BuildRequires:  pkg-config
BuildRequires:  readline-devel
BuildRequires:  udev
BuildRequires:  pkgconfig(libtzplatform-config)
Requires:	%{name}-compat = %{version}-%{release}
Requires:	security-config
Recommends:	%{name}-profile_common = %{version}-%{release}

%description
The Bluetooth stack for Linux.

%package devel
Summary:        Files needed for BlueZ development
License:        GPL-2.0+
Group:          Development/Libraries
Requires:       libbluetooth = %{version}

%description devel
Files needed to develop applications for the BlueZ Bluetooth protocol
stack.

%package extension-bredr
Summary:    Bluez extension for BREDR functionality
Requires:  %{name} = %{version}-%{release}
Conflicts:  %{name}-extension-le = %{version}-%{release}
%description extension-bredr
Bluez extension for BREDR functionality

%package extension-le
Summary:    Bluez extension for LE functionality
Requires:  %{name} = %{version}-%{release}
Conflicts:  %{name}-extension-bredr = %{version}-%{release}
%description extension-le
Bluez extension for LE functionality

%package -n libbluetooth
Summary:        Bluetooth Libraries
License:        GPL-2.0+
Group:          Network & Connectivity/Bluetooth

%description -n libbluetooth
Bluetooth protocol stack libraries.

%package -n obexd
Summary:        OBEX Server A basic OBEX server implementation
Group:          Network & Connectivity/Bluetooth
Requires:       tizen-platform-config-tools

%description -n obexd
OBEX Server A basic OBEX server implementation.

%package test
Summary:        Tools for testing of various Bluetooth-functions
License:        GPL-2.0+
Group:          Development/Tools
Requires:       dbus-python
Requires:       libbluetooth = %{version}
Requires:       python-gobject

%description test
Contains a few tools for testing various bluetooth functions. The
BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.

%package profile_common
Summary:	Modified bluez for mobile/common profile
Provides:	%{name}-compat = %{version}-%{release}
Provides:	%{name}-profile_mobile = %{version}-%{release}
Provides:	%{name}-profile_ivi = %{version}-%{release}
Conflicts:	%{name}-profile_wearable
Conflicts:	%{name}-profile_tv
%description profile_common
Bluez default service script for Tizen (mobile/common profile)

%package profile_wearable
Summary:	Modified bluez for wearable profile
Provides:	%{name}-compat = %{version}-%{release}
Conflicts:	%{name}-profile_common
Conflicts:	%{name}-profile_tv
%description profile_wearable
Bluez modified service script for Tizen wearable

%package profile_tv
Summary:	Modified bluez for wearable profile
Provides:	%{name}-compat = %{version}-%{release}
Conflicts:	%{name}-profile_common
Conflicts:	%{name}-profile_wearable
%description profile_tv
Bluez modified service script for Tizen TV

%package plugin-headless
Summary:	Bluez headless plugin
Requires:	%{name}-compat = %{version}-%{release}
%description plugin-headless
This package is Bluez plugin to manager headless device

%prep
%setup -q
cp %{SOURCE1001} .

%build
autoreconf -fiv

#if "{?profile}" == "ivi"
# TIZEN_FEATURE_BLUEZ_BRCM_CHIP: only in tools/hciattach.c ==> RUNTIME! (profile.h)
#endif

#if "{?profile}" == "wearable"
# TIZEN_FEATURE_BLUEZ_SMS_ONLY: only in obexd/plugins/messages-tizen.c ==> RUNTIME! (profile.h)
# TIZEN_FEATURE_BLUEZ_BRCM_QOS: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
# TIZEN_FEATURE_BLUEZ_ROLE_CHANGE: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
# TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY: only in src/device.c ==> RUNTIME! (profile.h)
#endif


# For LE only

export CFLAGS_DEFAULT="$CFLAGS"

export LDFLAGS=" -lncurses -Wl,--as-needed "
export CFLAGS+=" -Werror -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DTIZEN_FEATURE_BLUEZ_AVRCP_CONTROL -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DENABLE_AVRCP_CATEGORY1 -DTIZEN_BT_HID_DEVICE_ENABLE"

%ifarch aarch64
echo arch64
export CFLAGS+=" -DARCH64"
%endif

%ifarch x86_64
echo x86_64
export CFLAGS+=" -DARCH64"
%endif

%reconfigure --disable-static \
			--sysconfdir=%{_sysconfdir} \
			--localstatedir=%{_localstatedir} \
			--with-systemdsystemunitdir=%{_libpath}/systemd/system \
			--with-systemduserunitdir=%{_libpath}/systemd/user \
			--libexecdir=%{_libexecdir} \
			--enable-debug \
			--enable-pie \
			--enable-usb=no \
			--enable-tools \
			--disable-bccmd \
			--enable-pcmcia=no \
			--enable-hid2hci=no \
			--enable-alsa=no \
			--enable-gstreamer=no \
			--disable-dfutool \
			--disable-cups \
			--enable-proximity=yes \
			--enable-tds=yes \
			--enable-dbusoob \
			--enable-test \
			--enable-mesh=yes \
			--with-telephony=tizen \
			--enable-obex \
			--enable-library \
			--enable-gatt \
			--enable-testing \
			--enable-experimental \
			--enable-autopyypair=no \
			--enable-tizenunusedplugin=no \
			--disable-crypto-tests

make %{?_smp_mflags} all V=1

mkdir -p le

#%make_install
cp -a  %{buildroot}%{_libexecdir}/bluetooth/bluetoothd le/


# For BREDR only
make distclean

autoreconf -fiv

export CFLAGS="$CFLAGS_DEFAULT"

export LDFLAGS=" -lncurses -Wl,--as-needed "
export CFLAGS+=" -Werror -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DTIZEN_FEATURE_BLUEZ_AVRCP_CONTROL -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DENABLE_AVRCP_CATEGORY1 -DTIZEN_BT_HID_DEVICE_ENABLE"

%ifarch aarch64
echo arch64
export CFLAGS+=" -DARCH64"
%endif

%ifarch x86_64
echo x86_64
export CFLAGS+=" -DARCH64"
%endif

%reconfigure --disable-static \
			--sysconfdir=%{_sysconfdir} \
			--localstatedir=%{_localstatedir} \
			--with-systemdsystemunitdir=%{_libpath}/systemd/system \
			--with-systemduserunitdir=%{_libpath}/systemd/user \
			--libexecdir=%{_libexecdir} \
			--enable-debug \
			--enable-pie \
			--enable-serial \
			--enable-input \
			--enable-usb=no \
			--enable-tools \
			--disable-bccmd \
			--enable-pcmcia=no \
			--enable-hid2hci=no \
			--enable-alsa=no \
			--enable-gstreamer=no \
			--disable-dfutool \
			--disable-cups \
			--enable-health=yes \
			--enable-dbusoob \
			--enable-test \
			--enable-mesh=yes \
			--with-telephony=tizen \
			--enable-obex \
			--enable-library \
			--enable-testing \
			--enable-experimental \
			--enable-autopair=no \
			--enable-hid=yes \
			--enable-bredr=yes \
			--enable-tizenunusedplugin=no \
			--disable-crypto-tests

make %{?_smp_mflags} all V=1

mkdir -p bredr

#%make_install
cp -a  %{buildroot}%{_libexecdir}/bluetooth/bluetoothd bredr/


# For BREDR + LE
make distclean

autoreconf -fiv

export CFLAGS="$CFLAGS_DEFAULT"

export LDFLAGS=" -lncurses -Wl,--as-needed "
export CFLAGS+=" -Werror -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_A2DP_MULTISTREAM -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DTIZEN_FEATURE_BLUEZ_AVRCP_CONTROL -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET -DENABLE_AVRCP_CATEGORY1 -DTIZEN_BT_HID_DEVICE_ENABLE"

%ifarch aarch64
echo arch64
export CFLAGS+=" -DARCH64"
%endif

%ifarch x86_64
echo x86_64
export CFLAGS+=" -DARCH64"
%endif

%reconfigure --disable-static \
			--sysconfdir=%{_sysconfdir} \
			--localstatedir=%{_localstatedir} \
			--with-systemdsystemunitdir=%{_libpath}/systemd/system \
			--with-systemduserunitdir=%{_libpath}/systemd/user \
			--libexecdir=%{_libexecdir} \
			--enable-debug \
			--enable-pie \
			--enable-serial \
			--enable-input \
			--enable-usb=no \
			--enable-tools \
			--disable-bccmd \
			--enable-pcmcia=no \
			--enable-hid2hci=no \
			--enable-alsa=no \
			--enable-gstreamer=no \
			--disable-dfutool \
			--disable-cups \
			--enable-health=yes \
			--enable-proximity=yes \
			--enable-tds=yes \
			--enable-dbusoob \
			--enable-test \
			--with-telephony=tizen \
			--enable-obex \
			--enable-mesh=yes \
			--enable-library \
			--enable-gatt \
			--enable-testing \
			--enable-experimental \
			--enable-autopair=no \
			--enable-hid=yes \
			--enable-bredr=yes \
			--enable-tizenunusedplugin=no \
			--disable-crypto-tests

make %{?_smp_mflags} all V=1

%check
make check

%install
%make_install

pushd bredr
for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.bredr"; done
popd

pushd le
for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.le"; done
popd

# bluez-test
rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
#install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluetooth.conf

# no idea why this is suddenly necessary...
install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth

install -D -m 0644 src/main_w.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.wearable
install -D -m 0644 src/main_m.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf
install -D -m 0644 src/main_headless.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.headless

#install -D -m 0644 src/org.bluez.service %{buildroot}%{_datadir}/dbus-1/system-services/org.bluez.service

install -D -m 0644 src/bluetooth.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth.conf
#install -D -m 0644 profiles/audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/audio.conf
#install -D -m 0644 profiles/network/network.conf %{buildroot}%{_sysconfdir}/bluetooth/network.conf

#install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/bluez
#install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth3
#install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth-devel

#install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup
#install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
#install -D -m 0755 %SOURCE103 %{buildroot}%{_bindir}/obex.sh
install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT/%{_bindir}/
#install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 tools/btmgmt $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 tools/scotest $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 tools/bluemoon $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 attrib/gatttool $RPM_BUILD_ROOT/%{_bindir}/
install -D -m 0755 mesh/meshctl $RPM_BUILD_ROOT/%{_bindir}/


install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl

#test
#if "tv"
mkdir -p %{buildroot}%{_libpath}/systemd/system/multi-user.target.wants/
ln -sf bluetooth.service %{buildroot}%{_libpath}/systemd/system/dbus-org.bluez.service
ln -sf ../bluetooth.service %{buildroot}%{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service
#endif

%post -n libbluetooth -p /sbin/ldconfig

%postun -n libbluetooth -p /sbin/ldconfig

%post -n bluez-extension-bredr
pushd %{_libexecdir}/bluetooth
for FILE in bluetoothd.bredr; do mv "$FILE" "${FILE%.bredr}"; done
popd
/sbin/ldconfig

%post -n bluez-extension-le
pushd %{_libexecdir}/bluetooth
for FILE in bluetoothd.le; do mv "$FILE" "${FILE%.le}"; done
popd
/sbin/ldconfig

%files
%manifest %{name}.manifest
%defattr(-, root, root)
%license COPYING
#%{_sysconfdir}/bluetooth/audio.conf
#%{_sysconfdir}/bluetooth/network.conf
#%{_sysconfdir}/bluetooth/rfcomm.conf
%{_sysconfdir}/dbus-1/system.d/bluetooth.conf
#%{_datadir}/man/*/*
%attr(750, network_fw, network_fw)%{_bindir}/hcitool
%{_bindir}/l2ping
%{_bindir}/obexctl
%{_bindir}/rfcomm
%{_bindir}/btsnoop
%{_bindir}/mpris-proxy
%{_bindir}/sdptool
%{_bindir}/ciptool
#%{_bindir}/dfutool
%{_bindir}/btmon
%attr(750, network_fw, network_fw)%{_bindir}/btattach
%attr(750, network_fw, network_fw)%{_bindir}/hciattach
%attr(750, network_fw, network_fw)%{_bindir}/hciconfig
%attr(755, network_fw, network_fw)%{_libexecdir}/bluetooth/bluetoothd
%exclude %{_libexecdir}/bluetooth/bluetoothd.bredr
%exclude %{_libexecdir}/bluetooth/bluetoothd.le
%{_bindir}/bccmd
#%{_sbindir}/hid2hci
%dir /usr/lib/udev
/usr/lib/udev/*

%files -n bluez-extension-bredr
%manifest %{name}.manifest
%defattr(-, root, root)
%{_libexecdir}/bluetooth/bluetoothd.bredr

%files -n bluez-extension-le
%manifest %{name}.manifest
%defattr(-, root, root)
%{_libexecdir}/bluetooth/bluetoothd.le

#test -2
%exclude /%{_libpath}/systemd/system/bluetooth.service
%exclude %{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service
%exclude /%{_datadir}/dbus-1/system-services/org.bluez.service
%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
%dir /var/lib/bluetooth
%dir %{_sysconfdir}/modprobe.d
%config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf


%files devel
%manifest %{name}.manifest
%defattr(-, root, root)
%{_includedir}/bluetooth/*
%{_libdir}/libbluetooth.so
%{_libdir}/pkgconfig/bluez.pc

%files -n libbluetooth
%manifest %{name}.manifest
%defattr(-, root, root)
%{_libdir}/libbluetooth.so.*
%license COPYING

%files -n obexd
%manifest %{name}.manifest
%defattr(-,root,root,-)
%{_libexecdir}/bluetooth/obexd
%exclude %{_libpath}/systemd/system/obex.service
%{_datadir}/dbus-1/system-services/org.bluez.obex.service
#%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
#%{_bindir}/obex-root-setup
#%{_bindir}/obex.sh


%files test
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/bluez/test/*
%{_bindir}/l2test
%{_bindir}/rctest
%{_bindir}/bluetoothctl
%{_bindir}/meshctl
%{_bindir}/btiotest
#%{_bindir}/mpris-player
%{_bindir}/bluetooth-player
#%{_bindir}/btmon
%{_bindir}/hcidump
%{_bindir}/btmgmt
%{_bindir}/scotest
%{_bindir}/bluemoon
%{_bindir}/gatttool
%{_bindir}/hex2hcd
#%{_bindir}/btattach
%exclude /usr/lib/debug/*

%docs_package

%post profile_wearable
ln -sf main.conf.wearable %{_sysconfdir}/bluetooth/main.conf
%preun profile_wearable
rm %{_sysconfdir}/bluetooth/main.conf
%files profile_wearable
%manifest %{name}.manifest
%{_sysconfdir}/bluetooth/main.conf.wearable

%files profile_tv
%manifest %{name}.manifest
%{_sysconfdir}/bluetooth/main.conf
%{_libpath}/systemd/system/bluetooth.service
%{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service
%{_libpath}/systemd/system/dbus-org.bluez.service
%{_datadir}/dbus-1/system-services/org.bluez.service

%files profile_common
%manifest %{name}.manifest
%{_sysconfdir}/bluetooth/main.conf

%post plugin-headless
ln -sf main.conf.headless %{_sysconfdir}/bluetooth/main.conf
%preun plugin-headless
rm %{_sysconfdir}/bluetooth/main.conf
%files plugin-headless
%manifest %{name}.manifest
%{_sysconfdir}/bluetooth/main.conf.headless

%changelog