Update the version to 5.55
[platform/upstream/bluez.git] / packaging / bluez.spec
1 # Do not create provides fro extension-tm1 because the main package
2 # should anchor any reverse-dependencies
3 %global __provides_exclude_from ^(.*\\.tm1)$
4
5 #%define __spec_check_pre exit 0
6
7 #%define with_libcapng --enable-capng
8 %define _libpath /usr/lib
9 Name:           bluez
10 Summary:        Bluetooth Stack for Linux
11 Version:        5.55
12 Release:        1
13 Group:          Network & Connectivity/Bluetooth
14 License:        GPL-2.0+ and LGPL-2.1+
15 URL:            http://www.bluez.org/
16 Source:         bluez-%{version}.tar.gz
17 Source2:        bluez-coldplug.init
18 Source3:        bluetooth.sysconfig
19 Source4:        bluetooth.sh
20 Source5:        baselibs.conf
21 Source7:        bluetooth.modprobe
22 Source101:      obex-root-setup
23 Source102:      create-symlinks
24 Source103:      obex.sh
25 Source1001:     bluez.manifest
26 #Patch1 :    bluez-ncurses.patch
27 #Patch2 :    disable-eir-unittest.patch
28 #Requires:   dbus >= 0.60
29 #BuildRequires:  pkgconfig(libudev)
30 BuildRequires:  pkgconfig(dbus-1)
31 BuildRequires:  pkgconfig(iniparser)
32 BuildRequires:  pkgconfig(libxml-2.0)
33 BuildRequires:  pkgconfig(json-c)
34 BuildRequires:  pkgconfig(ell)
35 #BuildRequires:  pkgconfig(glib-2.0)
36 #BuildRequires:  pkgconfig(ncurses)
37 #BuildRequires:  flex
38 #BuildRequires:  bison
39 #BuildRequires:  readline-devel
40 #BuildRequires:  openssl-devel
41 BuildRequires:  flex
42 BuildRequires:  libcap-ng-devel
43 BuildRequires:  systemd
44 %{?systemd_requires}
45 BuildRequires:  pkgconfig(alsa)
46 BuildRequires:  automake
47 BuildRequires:  check-devel
48 BuildRequires:  glib2-devel >= 2.16
49 BuildRequires:  libsndfile-devel
50 BuildRequires:  libtool
51 BuildRequires:  libudev-devel
52 BuildRequires:  pkg-config
53 BuildRequires:  readline-devel
54 BuildRequires:  udev
55 BuildRequires:  pkgconfig(libtzplatform-config)
56 Requires:       %{name}-compat = %{version}-%{release}
57 Requires:       security-config
58 Recommends:     %{name}-profile_common = %{version}-%{release}
59
60 %description
61 The Bluetooth stack for Linux.
62
63 %package extension-bredr
64 Summary:    Bluez extension for BREDR functionality
65 Requires:  %{name} = %{version}-%{release}
66 Conflicts:  %{name}-extension-le = %{version}-%{release}
67 %description extension-bredr
68 Bluez extension for BREDR functionality
69
70 %package extension-le
71 Summary:    Bluez extension for LE functionality
72 Requires:  %{name} = %{version}-%{release}
73 Conflicts:  %{name}-extension-bredr = %{version}-%{release}
74 %description extension-le
75 Bluez extension for LE functionality
76
77 %package -n obexd
78 Summary:        OBEX Server A basic OBEX server implementation
79 Group:          Network & Connectivity/Bluetooth
80 Requires:       tizen-platform-config-tools
81
82 %description -n obexd
83 OBEX Server A basic OBEX server implementation.
84
85 %package test
86 Summary:        Tools for testing of various Bluetooth-functions
87 License:        GPL-2.0+
88 Group:          Development/Tools
89 Requires:       dbus-python
90 Requires:       python-gobject
91
92 %description test
93 Contains a few tools for testing various bluetooth functions. The
94 BLUETOOTH trademarks are owned by Bluetooth SIG, Inc., U.S.A.
95
96 %package profile_common
97 Summary:        Modified bluez for mobile/common profile
98 Provides:       %{name}-compat = %{version}-%{release}
99 Provides:       %{name}-profile_mobile = %{version}-%{release}
100 Provides:       %{name}-profile_ivi = %{version}-%{release}
101 Conflicts:      %{name}-profile_wearable
102 Conflicts:      %{name}-profile_tv
103 %description profile_common
104 Bluez default service script for Tizen (mobile/common profile)
105
106 %package profile_wearable
107 Summary:        Modified bluez for wearable profile
108 Provides:       %{name}-compat = %{version}-%{release}
109 Conflicts:      %{name}-profile_common
110 Conflicts:      %{name}-profile_tv
111 %description profile_wearable
112 Bluez modified service script for Tizen wearable
113
114 %package profile_tv
115 Summary:        Modified bluez for wearable profile
116 Provides:       %{name}-compat = %{version}-%{release}
117 Conflicts:      %{name}-profile_common
118 Conflicts:      %{name}-profile_wearable
119 %description profile_tv
120 Bluez modified service script for Tizen TV
121
122 %package plugin-headless
123 Summary:        Bluez headless plugin
124 Requires:       %{name}-compat = %{version}-%{release}
125 %description plugin-headless
126 This package is Bluez plugin to manager headless device
127
128 %package plugin-keyboard
129 Summary:        Bluez keyboard plugin
130 Requires:       %{name}-compat = %{version}-%{release}
131 %description plugin-keyboard
132 This package is Bluez plugin to manager keyboard device
133
134 %package mesh
135 Summary:        contains binaries for bluetooth mesh
136 Requires:       %{name}-compat = %{version}-%{release}
137 License:        GPL-2.0+
138 %description mesh
139 Contains bluetooth mesh daemon
140
141 %prep
142 %setup -q
143 cp %{SOURCE1001} .
144
145 %build
146 autoreconf -fiv
147
148 #if "{?profile}" == "ivi"
149 # TIZEN_FEATURE_BLUEZ_BRCM_CHIP: only in tools/hciattach.c ==> RUNTIME! (profile.h)
150 #endif
151
152 #if "{?profile}" == "wearable"
153 # TIZEN_FEATURE_BLUEZ_SMS_ONLY: only in obexd/plugins/messages-tizen.c ==> RUNTIME! (profile.h)
154 # TIZEN_FEATURE_BLUEZ_BRCM_QOS: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
155 # TIZEN_FEATURE_BLUEZ_ROLE_CHANGE: only in profiles/audio/avdtp.c ==> RUNTIME! (profile.h)
156 # TIZEN_FEATURE_BLUEZ_CONFIRM_ONLY: only in src/device.c ==> RUNTIME! (profile.h)
157 #endif
158
159
160 # For LE only
161
162 export CFLAGS_DEFAULT="$CFLAGS"
163
164 # Add GCC9 exception
165 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
166
167 export LDFLAGS=" -lncurses -Wl,--as-needed "
168 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"
169
170 %ifarch aarch64
171 echo arch64
172 export CFLAGS+=" -DARCH64"
173 %endif
174
175 %ifarch x86_64
176 echo x86_64
177 export CFLAGS+=" -DARCH64"
178 %endif
179
180 %reconfigure --disable-static \
181                         --sysconfdir=%{_sysconfdir} \
182                         --localstatedir=%{_localstatedir} \
183                         --with-systemdsystemunitdir=%{_libpath}/systemd/system \
184                         --with-systemduserunitdir=%{_libpath}/systemd/user \
185                         --libexecdir=%{_libexecdir} \
186                         --enable-debug \
187                         --enable-pie \
188                         --enable-usb=no \
189                         --enable-tools \
190                         --disable-bccmd \
191                         --enable-pcmcia=no \
192                         --enable-hid2hci=yes \
193                         --enable-alsa=no \
194                         --enable-gstreamer=no \
195                         --disable-dfutool \
196                         --disable-cups \
197                         --enable-proximity=yes \
198                         --enable-tds=yes \
199                         --enable-dbusoob \
200                         --enable-test \
201                         --enable-mesh=yes \
202                         --with-telephony=tizen \
203                         --enable-obex \
204                         --enable-library \
205                         --enable-gatt \
206                         --enable-testing \
207                         --enable-experimental \
208                         --enable-autopyypair=no \
209                         --enable-tizenunusedplugin=no \
210                         --disable-crypto-tests \
211                         --enable-external-ell
212
213 make %{?_smp_mflags} all V=1
214
215 mkdir -p le
216
217 #%make_install
218 cp -a  %{buildroot}%{_libexecdir}/bluetooth/bluetoothd le/
219
220
221 # For BREDR only
222 make distclean
223
224 autoreconf -fiv
225
226 export CFLAGS="$CFLAGS_DEFAULT"
227
228 # Add GCC9 exception
229 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
230
231 export LDFLAGS=" -lncurses -Wl,--as-needed "
232 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"
233
234 %ifarch aarch64
235 echo arch64
236 export CFLAGS+=" -DARCH64"
237 %endif
238
239 %ifarch x86_64
240 echo x86_64
241 export CFLAGS+=" -DARCH64"
242 %endif
243
244 %reconfigure --disable-static \
245                         --sysconfdir=%{_sysconfdir} \
246                         --localstatedir=%{_localstatedir} \
247                         --with-systemdsystemunitdir=%{_libpath}/systemd/system \
248                         --with-systemduserunitdir=%{_libpath}/systemd/user \
249                         --libexecdir=%{_libexecdir} \
250                         --enable-debug \
251                         --enable-pie \
252                         --enable-serial \
253                         --enable-input \
254                         --enable-usb=no \
255                         --enable-tools \
256                         --disable-bccmd \
257                         --enable-pcmcia=no \
258                         --enable-hid2hci=yes \
259                         --enable-alsa=no \
260                         --enable-gstreamer=no \
261                         --disable-dfutool \
262                         --disable-cups \
263                         --enable-health=yes \
264                         --enable-dbusoob \
265                         --enable-test \
266                         --enable-mesh=yes \
267                         --with-telephony=tizen \
268                         --enable-obex \
269                         --enable-library \
270                         --enable-testing \
271                         --enable-experimental \
272                         --enable-autopair=no \
273                         --enable-hid=yes \
274                         --enable-bredr=yes \
275                         --enable-tizenunusedplugin=no \
276                         --disable-crypto-tests \
277                         --enable-external-ell
278
279 make %{?_smp_mflags} all V=1
280
281 mkdir -p bredr
282
283 #%make_install
284 cp -a  %{buildroot}%{_libexecdir}/bluetooth/bluetoothd bredr/
285
286
287 # For BREDR + LE
288 make distclean
289
290 autoreconf -fiv
291
292 export CFLAGS="$CFLAGS_DEFAULT"
293
294 # Add GCC9 exception
295 export CFLAGS+=" -Wno-stringop-truncation -Wno-format-truncation -Wno-address-of-packed-member"
296
297 export LDFLAGS=" -lncurses -Wl,--as-needed "
298 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"
299
300 %ifarch aarch64
301 echo arch64
302 export CFLAGS+=" -DARCH64"
303 %endif
304
305 %ifarch x86_64
306 echo x86_64
307 export CFLAGS+=" -DARCH64"
308 %endif
309
310 %reconfigure --disable-static \
311                         --sysconfdir=%{_sysconfdir} \
312                         --localstatedir=%{_localstatedir} \
313                         --with-systemdsystemunitdir=%{_libpath}/systemd/system \
314                         --with-systemduserunitdir=%{_libpath}/systemd/user \
315                         --libexecdir=%{_libexecdir} \
316                         --enable-debug \
317                         --enable-pie \
318                         --enable-serial \
319                         --enable-input \
320                         --enable-usb=no \
321                         --enable-tools \
322                         --disable-bccmd \
323                         --enable-pcmcia=no \
324                         --enable-hid2hci=yes \
325                         --enable-alsa=no \
326                         --enable-gstreamer=no \
327                         --disable-dfutool \
328                         --disable-cups \
329                         --enable-health=yes \
330                         --enable-proximity=yes \
331                         --enable-tds=yes \
332                         --enable-dbusoob \
333                         --enable-test \
334                         --with-telephony=tizen \
335                         --enable-obex \
336                         --enable-mesh=yes \
337                         --enable-library \
338                         --enable-gatt \
339                         --enable-testing \
340                         --enable-experimental \
341                         --enable-autopair=no \
342                         --enable-hid=yes \
343                         --enable-bredr=yes \
344                         --enable-tizenunusedplugin=no \
345                         --disable-crypto-tests \
346                         --enable-external-ell
347
348 make %{?_smp_mflags} all V=1
349
350 %check
351 make check
352
353 %install
354 %make_install
355
356 pushd bredr
357 for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.bredr"; done
358 popd
359
360 pushd le
361 for FILE in bluetoothd; do mv "$FILE" "%{buildroot}%{_libexecdir}/bluetooth/$FILE.le"; done
362 popd
363
364 # bluez-test
365 rm -rvf $RPM_BUILD_ROOT/%{_libdir}/gstreamer-*
366 #install --mode=0755 -D %{S:4} $RPM_BUILD_ROOT/usr/lib/udev/bluetooth.sh
367 install --mode=0644 -D %{S:7} $RPM_BUILD_ROOT/%{_sysconfdir}/modprobe.d/50-bluetooth.conf
368
369 # no idea why this is suddenly necessary...
370 install --mode 0755 -d $RPM_BUILD_ROOT/var/lib/bluetooth
371
372 install -D -m 0644 src/main_w.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.wearable
373 install -D -m 0644 src/main_m.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf
374 install -D -m 0644 src/main_headless.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.headless
375 install -D -m 0644 src/main_keyboard.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf.keyboard
376
377 #install -D -m 0644 src/org.bluez.service %{buildroot}%{_datadir}/dbus-1/system-services/org.bluez.service
378
379 install -D -m 0644 src/bluetooth.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/bluetooth.conf
380 #install -D -m 0644 profiles/audio/audio.conf %{buildroot}%{_sysconfdir}/bluetooth/audio.conf
381 #install -D -m 0644 profiles/network/network.conf %{buildroot}%{_sysconfdir}/bluetooth/network.conf
382
383 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/bluez
384 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth3
385 #install -D -m 0644 COPYING %{buildroot}%{_datadir}/license/libbluetooth-devel
386
387 #install -D -m 0755 %SOURCE101 %{buildroot}%{_bindir}/obex-root-setup
388 #install -D -m 0755 %SOURCE102 %{buildroot}%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
389 #install -D -m 0755 %SOURCE103 %{buildroot}%{_bindir}/obex.sh
390 install -D -m 0755 tools/btiotest $RPM_BUILD_ROOT/%{_bindir}/
391 install -D -m 0755 tools/bluetooth-player $RPM_BUILD_ROOT/%{_bindir}/
392 #install -D -m 0755 tools/mpris-player $RPM_BUILD_ROOT/%{_bindir}/
393 install -D -m 0755 tools/btmgmt $RPM_BUILD_ROOT/%{_bindir}/
394 install -D -m 0755 tools/scotest $RPM_BUILD_ROOT/%{_bindir}/
395 install -D -m 0755 tools/bluemoon $RPM_BUILD_ROOT/%{_bindir}/
396 install -D -m 0755 attrib/gatttool $RPM_BUILD_ROOT/%{_bindir}/
397 install -D -m 0755 tools/meshctl $RPM_BUILD_ROOT/%{_bindir}/
398 install -D -m 0755 tools/mesh-cfgclient $RPM_BUILD_ROOT/%{_bindir}/
399
400 # mesh conf
401 install -D -m 0644 mesh/mesh-main.conf %{buildroot}%{_sysconfdir}/bluetooth/mesh-main.conf
402
403 install -D -m 0755 tools/obexctl %{buildroot}%{_bindir}/obexctl
404
405 install -D -m 0644 obexd/src/obex.service %{buildroot}%{_libpath}/systemd/system/
406
407 install -D -m 0644 src/bluetooth.service %{buildroot}%{_libpath}/systemd/system/bluez-start.service
408
409 %post -n bluez-extension-bredr
410 pushd %{_libexecdir}/bluetooth
411 for FILE in bluetoothd.bredr; do mv "$FILE" "${FILE%.bredr}"; done
412 popd
413 /sbin/ldconfig
414
415 %post -n bluez-extension-le
416 pushd %{_libexecdir}/bluetooth
417 for FILE in bluetoothd.le; do mv "$FILE" "${FILE%.le}"; done
418 popd
419 /sbin/ldconfig
420
421 %files
422 %manifest %{name}.manifest
423 %defattr(-, root, root)
424 %license COPYING
425 #%{_sysconfdir}/bluetooth/audio.conf
426 #%{_sysconfdir}/bluetooth/network.conf
427 #%{_sysconfdir}/bluetooth/rfcomm.conf
428 %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
429 #%{_datadir}/man/*/*
430 %attr(750, network_fw, network_fw)%{_bindir}/hcitool
431 %{_bindir}/l2ping
432 %{_bindir}/obexctl
433 %{_bindir}/rfcomm
434 %{_bindir}/btsnoop
435 %{_bindir}/mpris-proxy
436 %{_bindir}/sdptool
437 %{_bindir}/ciptool
438 #%{_bindir}/dfutool
439 %{_bindir}/btmon
440 %attr(750, network_fw, network_fw)%{_bindir}/btattach
441 %attr(750, network_fw, network_fw)%{_bindir}/hciattach
442 %attr(750, network_fw, network_fw)%{_bindir}/hciconfig
443 %attr(755, network_fw, network_fw)%{_libexecdir}/bluetooth/bluetoothd
444 %exclude %{_libexecdir}/bluetooth/bluetoothd.bredr
445 %exclude %{_libexecdir}/bluetooth/bluetoothd.le
446 %exclude %{_includedir}/bluetooth/*
447 %exclude %{_libdir}/pkgconfig/bluez.pc
448 %{_bindir}/bccmd
449 #%{_sbindir}/hid2hci
450 %dir /usr/lib/udev
451 /usr/lib/udev/*
452 %{_unitdir}/bluez-start.service
453 %exclude %{_unitdir}/bluetooth.service
454
455 %files -n bluez-extension-bredr
456 %manifest %{name}.manifest
457 %defattr(-, root, root)
458 %{_libexecdir}/bluetooth/bluetoothd.bredr
459
460 %files -n bluez-extension-le
461 %manifest %{name}.manifest
462 %defattr(-, root, root)
463 %{_libexecdir}/bluetooth/bluetoothd.le
464 %config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
465 %dir /var/lib/bluetooth
466 %dir %{_sysconfdir}/modprobe.d
467 %config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
468
469 %files mesh
470 %manifest %{name}.manifest
471 %defattr(-, root, root)
472 %license COPYING
473 %{_sysconfdir}/dbus-1/system.d/bluetooth-mesh.conf
474 %attr(755, network_fw, network_fw)%{_libexecdir}/bluetooth/bluetooth-meshd
475 %{_libpath}/systemd/system/bluetooth-mesh.service
476 %exclude %{_datadir}/dbus-1/system-services/org.bluez.mesh.service
477 %exclude /usr/lib/debug/*
478 %{_sysconfdir}/bluetooth/mesh-main.conf
479
480 %files -n obexd
481 %manifest %{name}.manifest
482 %defattr(-,root,root,-)
483 %{_libexecdir}/bluetooth/obexd
484 %{_libpath}/systemd/system/obex.service
485 %{_datadir}/dbus-1/system-services/org.bluez.obex.service
486 #%{_sysconfdir}/obex/root-setup.d/000_create-symlinks
487 #%{_bindir}/obex-root-setup
488 #%{_bindir}/obex.sh
489
490
491 %files test
492 %manifest %{name}.manifest
493 %defattr(-,root,root)
494 %{_libdir}/bluez/test/*
495 %{_bindir}/l2test
496 %{_bindir}/rctest
497 %{_bindir}/bluetoothctl
498 %{_bindir}/meshctl
499 %{_bindir}/mesh-cfgclient
500 %{_bindir}/btiotest
501 #%{_bindir}/mpris-player
502 %{_bindir}/bluetooth-player
503 #%{_bindir}/btmon
504 %{_bindir}/hcidump
505 %{_bindir}/btmgmt
506 %{_bindir}/scotest
507 %{_bindir}/bluemoon
508 %{_bindir}/gatttool
509 %{_bindir}/hex2hcd
510 #%{_bindir}/btattach
511 %exclude /usr/lib/debug/*
512 %{_libdir}/libbluetooth.so*
513
514 %docs_package
515
516 %post profile_wearable
517 ln -sf main.conf.wearable %{_sysconfdir}/bluetooth/main.conf
518 %preun profile_wearable
519 rm %{_sysconfdir}/bluetooth/main.conf
520 %files profile_wearable
521 %manifest %{name}.manifest
522 %{_sysconfdir}/bluetooth/main.conf.wearable
523
524 %files profile_tv
525 %manifest %{name}.manifest
526 %{_sysconfdir}/bluetooth/main.conf
527 %exclude %{_datadir}/dbus-1/system-services/org.bluez.service
528
529 %files profile_common
530 %manifest %{name}.manifest
531 %{_sysconfdir}/bluetooth/main.conf
532
533 %post plugin-headless
534 ln -sf main.conf.headless %{_sysconfdir}/bluetooth/main.conf
535 %preun plugin-headless
536 rm %{_sysconfdir}/bluetooth/main.conf
537 %files plugin-headless
538 %manifest %{name}.manifest
539 %{_sysconfdir}/bluetooth/main.conf.headless
540
541 %post plugin-keyboard
542 ln -sf main.conf.keyboard %{_sysconfdir}/bluetooth/main.conf
543 %preun plugin-keyboard
544 rm %{_sysconfdir}/bluetooth/main.conf
545 %files plugin-keyboard
546 %manifest %{name}.manifest
547 %{_sysconfdir}/bluetooth/main.conf.keyboard
548
549 %changelog