summaryrefslogtreecommitdiff
path: root/packaging/bluez.spec
blob: a6e57d2e200a03388fa6c39d1c43fb13319d89b6 (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
#%define with_libcapng --enable-capng
%define _libpath /usr/lib
%define upgrade_script_path /usr/share/upgrade/scripts
Name:       	bluez
Summary:    	Bluetooth Stack for Linux
Version:    	5.37
Release:    	3
Group:      	Network & Connectivity/Bluetooth
License:    	GPL-2.0+ and LGPL-2.1+ and Apache-2.0
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(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)

%description
The Bluetooth stack for Linux.

%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:       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.

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

%build
autoreconf -fiv

%if "%{?tizen_target_name}" == "TM1" || "%{?profile}" == "ivi"
%if "%{?tizen_target_name}" == "TM1"
export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BLUEZ_SPRD_QOS -DTIZEN_FEATURE_BLUEZ_SPRD_PAGE_SCAN"
%endif
%else
export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BLUEZ_BRCM_CHIP"
%endif

%if "%{?profile}" == "wearable"
export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_BLUEZ_SMS_ONLY -DTIZEN_FEATURE_BLUEZ_BRCM_QOS -DTIZEN_FEATURE_BLUEZ_ROLE_CHANGE -DTIZEN_FEATURE_BLUEZ_CONFIRM_ONLY"
%endif

export LDFLAGS=" -lncurses -Wl,--as-needed "
export CFLAGS+=" -DTIZEN_FEATURE_BLUEZ_MODIFY -DTIZEN_FEATURE_BLUEZ_PBAP_SIM -DTIZEN_FEATURE_BLUEZ_AVRCP_TARGET"
%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=no \
			--enable-tds=yes \
			--enable-dbusoob \
			--enable-test \
			--with-telephony=tizen \
			--enable-obex \
			--enable-library \
			--enable-gatt \
			--enable-experimental \
			--enable-autopair=no \
%if "%{?profile}" == "wearable"
			 --enable-wearable \
%else
			--enable-network \
%endif
			--enable-hid=yes \
			--enable-tizenunusedplugin=no


make %{?_smp_mflags} all V=1

%check
make check

%install
%make_install

# 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

%if "%{?profile}" == "wearable"
install -D -m 0644 src/main_w.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf
%else
install -D -m 0644 src/main_m.conf %{buildroot}%{_sysconfdir}/bluetooth/main.conf
%endif

#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 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 tools/obexctl %{buildroot}%{_bindir}/obexctl

#test
%if "%{?profile}" == "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-frwk.service %{buildroot}%{_libpath}/systemd/system/multi-user.target.wants/bluetooth.service
%endif

mkdir -p %{buildroot}%{upgrade_script_path}
cp -f packaging/500.bluez_upgrade.sh %{buildroot}%{upgrade_script_path}

%files
%manifest %{name}.manifest
%defattr(-, root, root)
%license COPYING
#%{_sysconfdir}/bluetooth/audio.conf
%{_sysconfdir}/bluetooth/main.conf
#%{_sysconfdir}/bluetooth/network.conf
#%{_sysconfdir}/bluetooth/rfcomm.conf
#%{_sysconfdir}/dbus-1/system.d/bluetooth.conf
#%{_datadir}/man/*/*
%{_bindir}/hcitool
%{_bindir}/l2ping
%{_bindir}/obexctl
%{_bindir}/rfcomm
%{_bindir}/btsnoop
%{_bindir}/mpris-proxy
%{_bindir}/sdptool
%{_bindir}/ciptool
#%{_bindir}/dfutool
%{_bindir}/hciattach
%{_bindir}/hciconfig
%{_libexecdir}/bluetooth/bluetoothd
%{_bindir}/bccmd
#%{_sbindir}/hid2hci
%dir /usr/lib/udev
/usr/lib/udev/*
%{upgrade_script_path}/500.bluez_upgrade.sh
%exclude %{_includedir}/bluetooth/*
%exclude %{_libdir}/pkgconfig/bluez.pc

#test -2
%if "%{?profile}" == "tv"
%{_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
%else
%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
%endif
%config %{_sysconfdir}/dbus-1/system.d/bluetooth.conf
%dir /var/lib/bluetooth
%dir %{_sysconfdir}/modprobe.d
%config(noreplace) %{_sysconfdir}/modprobe.d/50-bluetooth.conf
%{_libdir}/libbluetooth.so*


%files -n obexd
%manifest %{name}.manifest
%license COPYING
%defattr(-,root,root,-)
%{_libexecdir}/bluetooth/obexd
%{_libpath}/systemd/user/obex.service
%{_datadir}/dbus-1/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}/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

%changelog