Reverse dependency direction.
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
1 %bcond_with x
2 %define _dumpdir /opt/etc/dump.d/module.d
3 %define _varlibdir /opt/var/lib
4
5 Name:       bluetooth-frwk
6 Summary:    Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
7 Version:    0.2.157
8 Release:    1
9 Group:      Network & Connectivity/Bluetooth
10 License:    Apache-2.0
11 Source0:    %{name}-%{version}.tar.gz
12 Source1001: bluetooth-frwk.manifest
13
14 Requires: syspopup
15 %if "%{?profile}" != "mobile"
16 Requires: bluetooth-tools
17 %endif
18 BuildRequires:  pkgconfig(aul)
19 BuildRequires:  pkgconfig(dlog)
20 BuildRequires:  pkgconfig(glib-2.0)
21 BuildRequires:  pkgconfig(gio-2.0)
22 BuildRequires:  pkgconfig(gio-unix-2.0)
23 BuildRequires:  pkgconfig(syspopup-caller)
24 BuildRequires:  pkgconfig(vconf)
25 BuildRequires:  pkgconfig(libxml-2.0)
26 BuildRequires:  pkgconfig(capi-network-connection)
27 BuildRequires:  pkgconfig(alarm-service)
28 BuildRequires:  pkgconfig(capi-content-mime-type)
29 BuildRequires:  pkgconfig(appcore-efl)
30 BuildRequires:  pkgconfig(pkgmgr)
31 #BuildRequires:  pkgconfig(journal)
32 BuildRequires:  pkgconfig(eventsystem)
33 BuildRequires:  pkgconfig(libsoup-2.4)
34 BuildRequires:  pkgconfig(capi-network-tethering)
35 BuildRequires:  cmake
36 BuildRequires:  pkgconfig(cynara-client)
37 BuildRequires:  pkgconfig(cynara-creds-gdbus)
38 BuildRequires:  pkgconfig(libtzplatform-config)
39 BuildRequires:  pkgconfig(storage)
40 BuildRequires:  pkgconfig(capi-system-info)
41
42 Requires(post): /usr/bin/vconftool
43 Requires(post): /sbin/ldconfig
44 Requires(postun): /sbin/ldconfig
45 Requires: psmisc
46
47 %description
48 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
49  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
50
51 %package profile_common
52 Summary:    bluetooth-frwk service and conf files for common profile
53 Requires:   %{name} = %{version}-%{release}
54 Conflicts:  %{name}-profile_mobile
55 Conflicts:  %{name}-profile_wearable
56 Conflicts:  %{name}-profile_tv
57 Conflicts:  %{name}-profile_ivi
58 %description profile_common
59 Bluetooth framework configuration and service files for Tizen common profile
60
61 %package profile_mobile
62 Summary:    bluetooth-frwk service and conf files for mobile profile
63 Requires:   %{name} = %{version}-%{release}
64 Conflicts:  %{name}-profile_common
65 Conflicts:  %{name}-profile_wearable
66 Conflicts:  %{name}-profile_tv
67 Conflicts:  %{name}-profile_ivi
68 %description profile_mobile
69 Bluetooth framework configuration and service files for Tizen mobile profile
70
71 %package profile_wearable
72 Summary:    bluetooth-frwk service and conf files for wearable profile
73 Requires:   %{name} = %{version}-%{release}
74 Conflicts:  %{name}-profile_mobile
75 Conflicts:  %{name}-profile_common
76 Conflicts:  %{name}-profile_tv
77 Conflicts:  %{name}-profile_ivi
78 %description profile_wearable
79 Bluetooth framework configuration and service files for Tizen wearable profile
80
81 %package profile_tv
82 Summary:    bluetooth-frwk service and conf files for tv profile
83 Requires:   %{name} = %{version}-%{release}
84 Conflicts:  %{name}-profile_mobile
85 Conflicts:  %{name}-profile_wearable
86 Conflicts:  %{name}-profile_common
87 Conflicts:  %{name}-profile_ivi
88 %description profile_tv
89 Bluetooth framework configuration and service files for Tizen tv profile
90
91 %package profile_ivi
92 Summary:    bluetooth-frwk service and conf files for ivi profile
93 Requires:   %{name} = %{version}-%{release}
94 Conflicts:  %{name}-profile_mobile
95 Conflicts:  %{name}-profile_wearable
96 Conflicts:  %{name}-profile_tv
97 Conflicts:  %{name}-profile_common
98 %description profile_ivi
99 Bluetooth framework configuration and service files for Tizen ivi profile
100
101 %package devel
102 Summary:    Bluetooth framework for BlueZ and Obexd
103 Group:      Development/Libraries
104 Requires:   %{name} = %{version}-%{release}
105
106 %description devel
107 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
108 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
109
110 %package service
111 Summary:    Bluetooth Service daemon
112 Group:      Network & Connectivity/Bluetooth
113 Requires:   %{name} = %{version}-%{release}
114
115 %description service
116 This package is Bluetooth Service daemon to manage BT services.
117
118 %package httpproxy
119 Summary:    Bluetooth HTTP Proxy Service daemon
120 Group:      TO_BE/FILLED
121 Requires:   %{name} = %{version}-%{release}
122
123 %description httpproxy
124 This package is Bluetooth HTTP Proxy Service daemon
125
126 %package core
127 Summary:    Bluetooth Core daemon
128 Group:      Network & Connectivity/Bluetooth
129 Requires:   %{name} = %{version}-%{release}
130
131 %description core
132 This package is Bluetooth core daemon to manage activation / deactivation.
133
134 %package test
135 Summary:    Bluetooth test application
136 Group:      Network & Connectivity/Bluetooth
137 Requires:   %{name} = %{version}-%{release}
138
139 %description test
140 This package is Bluetooth test application.
141
142 %prep
143 %setup -q
144 cp %{SOURCE1001} .
145
146
147 %build
148 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
149 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
150 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
151
152 %ifarch x86_64
153 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
154 %else
155 export CFLAGS="$CFLAGS -fpie"
156 export LDFLAGS="$CFLAGS -pie"
157 %endif
158
159 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_RFCOMM_DIRECT"
160 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
161
162 %if "%{?_with_emulator}" == "1"
163 export CFLAGS="$CFLAGS -DTIZEN_TEST_EMUL"
164 export CXXFLAGS="$CXXFLAGS -DTIZEN_TEST_EMUL"
165 export FFLAGS="$FFLAGS -DTIZEN_TEST_EMUL"
166 %endif
167
168
169 %if "%{?tizen_target_name}" == "TM1"
170 export CFLAGS="${CFLAGS} -DTIZEN_FEATURE_RADIO"
171 export CXXFLAGS="$CXXFLAGS -DTIZEN_FEATURE_RADIO"
172 export FFLAGS="$FFLAGS -DTIZEN_FEATURE_RADIO"
173 %endif
174
175 %ifarch aarch64
176 echo arch64
177 export CFLAGS+=" -DARCH64"
178 export CXXFLAGS+=" -DARCH64"
179 export FFLAGS+=" -DARCH64"
180 %endif
181
182 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
183 -DCMAKE_LIB_DIR=%{_libdir} \
184 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
185 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
186         -DLIBNOTIFY_SUPPORT=Off \
187         -DLIBNOTIFICATION_SUPPORT=Off
188 make
189
190 %cmake
191
192 %install
193 rm -rf %{buildroot}
194 %make_install
195
196 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
197 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
198 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-httpproxy
199 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
200
201 mkdir -p %{buildroot}%{_unitdir}/starter.target.wants
202 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
203
204 # Rename the postfix (.mobile, .tv, ..) at post script
205 # mobile
206 %if "%{?tizen_target_name}" == "TM1"
207 install -m 0644 packaging/bluetooth-frwk-mobile-sprd.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
208 %else
209 install -m 0644 packaging/bluetooth-frwk-mobile.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.mobile
210 %endif
211
212 # wearable / ivi
213 install -m 0644 packaging/bluetooth-frwk-wearable.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.wearable
214 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
215 cp %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
216 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
217
218 # tv
219 install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.tv
220
221 # common
222 install -m 0644 packaging/bluetooth-frwk-common.service %{buildroot}%{_unitdir}/bluetooth-frwk.service.common
223
224 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
225 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/starter.target.wants/bluetooth-frwk.service
226
227 %postun -p /sbin/ldconfig
228
229 %files
230 %manifest %{name}.manifest
231 %defattr(-, root, root)
232 %{_libdir}/libbluetooth-api.so.*
233 %{_datadir}/license/bluetooth-frwk
234
235 %files devel
236 %defattr(-, root, root)
237 %{_includedir}/bt-service/bluetooth-api.h
238 %{_includedir}/bt-service/bluetooth-hid-api.h
239 %{_includedir}/bt-service/bluetooth-audio-api.h
240 %{_includedir}/bt-service/bluetooth-telephony-api.h
241 %{_includedir}/bt-service/bluetooth-media-control.h
242 %{_includedir}/bt-service/bluetooth-scmst-api.h
243 %{_includedir}/bt-service/bluetooth-ipsp-api.h
244 %{_libdir}/pkgconfig/bluetooth-api.pc
245 %{_libdir}/libbluetooth-api.so
246 %{_datadir}/license/bluetooth-frwk-devel
247
248 %files service
249 %manifest %{name}.manifest
250 %defattr(-, root, root)
251 %{_bindir}/bt-service
252 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
253 %{_bindir}/bluetooth-frwk-test
254 %{_varlibdir}/bluetooth
255 %{_prefix}/etc/bluetooth
256 %{_datadir}/license/bluetooth-frwk-service
257
258 %files httpproxy
259 %manifest %{name}.manifest
260 %defattr(-, root, root)
261 %{_bindir}/bt-httpproxy
262 %{_datadir}/license/bluetooth-frwk-httpproxy
263 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
264 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-httpproxy.conf
265
266 %files core
267 %manifest %{name}.manifest
268 %defattr(-, root, root)
269 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
270 %{_bindir}/bt-core
271 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
272
273 %files test
274 %manifest %{name}.manifest
275 %defattr(-, root, root)
276 %{_bindir}/bluetooth-frwk-test
277 #{_bindir}/bluetooth-gatt-test
278 #{_bindir}/bluetooth-advertising-test
279
280 %post profile_common
281 pushd %{_unitdir}
282 mv bluetooth-frwk.service.common bluetooth-frwk.service
283 popd
284 %preun profile_common
285 pushd %{_unitdir}
286 mv bluetooth-frwk.service bluetooth-frwk.service.common
287 popd
288 %files profile_common
289 %{_unitdir}/starter.target.wants/bluetooth-frwk.service
290 %{_unitdir}/bluetooth-frwk.service.common
291 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
292
293 %post profile_mobile
294 pushd %{_unitdir}
295 mv bluetooth-frwk.service.mobile bluetooth-frwk.service
296 popd
297 %preun profile_mobile
298 pushd %{_unitdir}
299 mv bluetooth-frwk.service bluetooth-frwk.service.mobile
300 popd
301 %files profile_mobile
302 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
303 %{_unitdir}/bluetooth-frwk.service.mobile
304 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
305
306 %post profile_wearable
307 pushd %{_unitdir}
308 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
309 popd
310 %preun profile_wearable
311 pushd %{_unitdir}
312 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
313 popd
314 %files profile_wearable
315 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
316 %{_unitdir}/bluetooth-frwk.service.wearable
317 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
318
319 %post profile_tv
320 pushd %{_unitdir}
321 mv bluetooth-frwk.service.tv bluetooth-frwk.service
322 popd
323 %preun profile_tv
324 pushd %{_unitdir}
325 mv bluetooth-frwk.service bluetooth-frwk.service.tv
326 popd
327 %files profile_tv
328 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
329 %{_unitdir}/bluetooth-frwk.service.tv
330 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
331
332 # Note: ivi reuses bluetooth-frwk.service.wearable
333 %post profile_ivi
334 pushd %{_unitdir}
335 mv bluetooth-frwk.service.wearable bluetooth-frwk.service
336 popd
337 pushd %{_datadir}/dbus-1/system-services
338 mv org.projectx.bt.service.ivi org.projectx.bt.service
339 popd
340 %preun profile_ivi
341 pushd %{_unitdir}
342 mv bluetooth-frwk.service bluetooth-frwk.service.wearable
343 popd
344 pushd %{_datadir}/dbus-1/system-services
345 mv org.projectx.bt.service org.projectx.bt.service.ivi
346 popd
347 %files profile_ivi
348 %{_unitdir}/multi-user.target.wants/bluetooth-frwk.service
349 %{_unitdir}/bluetooth-frwk.service.wearable
350 %{_datadir}/dbus-1/system-services/org.projectx.bt.service.ivi
351
352 ### added /usr/etc/bluetooth/wearable/stack_info (others: /usr/etc/bluetooth/stack_info))
353 # (for PROFILE WEARABLE)
354