c15b637d7350e5015d2cdacb7b4cd3dcce732858
[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.151
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 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
14 Source1002: bt-icon.png
15 %endif
16
17 Requires: dbus
18 Requires: syspopup
19 %if "%{?profile}" != "mobile"
20 Requires: bluetooth-tools
21 %endif
22 BuildRequires:  pkgconfig(aul)
23 BuildRequires:  pkgconfig(dbus-glib-1)
24 BuildRequires:  pkgconfig(dlog)
25 BuildRequires:  pkgconfig(glib-2.0)
26 BuildRequires:  pkgconfig(gio-2.0)
27 BuildRequires:  pkgconfig(gio-unix-2.0)
28 %if %{with bluetooth_frwk_libnotify}
29 BuildRequires:  pkgconfig(libnotify)
30 BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
31 BuildRequires:  pkgconfig(gtk+-3.0)
32 %elif %{without bluetooth_frwk_libnotification}
33 BuildRequires:  pkgconfig(syspopup-caller)
34 Requires:       syspopup
35 %else
36 BuildRequires:  pkgconfig(syspopup-caller)
37 %endif
38 BuildRequires:  pkgconfig(vconf)
39 BuildRequires:  pkgconfig(libxml-2.0)
40 BuildRequires:  pkgconfig(dbus-1)
41 %if %{with x}
42 BuildRequires:  pkgconfig(utilX)
43 %endif
44 BuildRequires:  pkgconfig(capi-network-connection)
45 BuildRequires:  pkgconfig(alarm-service)
46 BuildRequires:  pkgconfig(capi-content-mime-type)
47 BuildRequires:  pkgconfig(appcore-efl)
48 BuildRequires:  pkgconfig(pkgmgr)
49 #BuildRequires:  pkgconfig(journal)
50 BuildRequires:  pkgconfig(eventsystem)
51 BuildRequires:  pkgconfig(libsoup-2.4)
52 %if "%{?profile}" == "mobile"
53 BuildRequires:  pkgconfig(capi-network-tethering)
54 %endif
55 BuildRequires:  cmake
56 BuildRequires:  pkgconfig(cynara-client)
57 BuildRequires:  pkgconfig(cynara-creds-gdbus)
58 BuildRequires:  pkgconfig(libtzplatform-config)
59 BuildRequires:  pkgconfig(storage)
60
61 Requires(post): /usr/bin/vconftool
62 Requires(post): /sbin/ldconfig
63 Requires(postun): /sbin/ldconfig
64 Requires: psmisc
65
66 %description
67 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
68  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
69
70
71 %package devel
72 Summary:    Bluetooth framework for BlueZ and Obexd
73 Group:      Development/Libraries
74 Requires:   %{name} = %{version}-%{release}
75
76 %description devel
77 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
78 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
79
80 %package service
81 Summary:    Bluetooth Service daemon
82 Group:      Network & Connectivity/Bluetooth
83 Requires:   %{name} = %{version}-%{release}
84
85 %description service
86 This package is Bluetooth Service daemon to manage BT services.
87
88 %package httpproxy
89 Summary:    Bluetooth HTTP Proxy Service daemon
90 Group:      TO_BE/FILLED
91 Requires:   %{name} = %{version}-%{release}
92
93 %description httpproxy
94 This package is Bluetooth HTTP Proxy Service daemon
95
96 %package core
97 Summary:    Bluetooth Core daemon
98 Group:      Network & Connectivity/Bluetooth
99 Requires:   %{name} = %{version}-%{release}
100
101 %description core
102 This package is Bluetooth core daemon to manage activation / deactivation.
103
104 %package test
105 Summary:    Bluetooth test application
106 Group:      Network & Connectivity/Bluetooth
107 Requires:   %{name} = %{version}-%{release}
108
109 %description test
110 This package is Bluetooth test application.
111
112 %prep
113 %setup -q
114 cp %{SOURCE1001} .
115
116
117 %build
118 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
119 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
120 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
121
122 %define _servicefile packaging/bluetooth-frwk-common.service
123 %define _servicedir starter.target.wants
124
125 %if "%{?profile}" == "mobile"
126 export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE -DTIZEN_BT_FLIGHTMODE_ENABLED -DTIZEN_MOBILE -DTIZEN_TELEPHONY_ENABLED"
127 %if "%{?tizen_target_name}" == "TM1"
128 %define _servicefile packaging/bluetooth-frwk-mobile-sprd.service
129 %else
130 %define _servicefile packaging/bluetooth-frwk-mobile.service
131 %endif
132 %define _servicedir multi-user.target.wants
133 %endif
134
135 %if "%{?profile}" == "wearable"
136 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
137 %define _servicefile packaging/bluetooth-frwk-wearable.service
138 %define _servicedir multi-user.target.wants
139 %endif
140
141 %if "%{?profile}" == "tv"
142 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
143 %define _servicefile packaging/bluetooth-frwk-mobile.service
144 %define _servicedir multi-user.target.wants
145 %endif
146
147 %ifarch x86_64
148 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
149 %else
150 export CFLAGS="$CFLAGS -fpie"
151 export LDFLAGS="$CFLAGS -pie"
152 %endif
153
154 export CFLAGS="$CFLAGS -DRFCOMM_DIRECT"
155 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
156
157 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
158 -DCMAKE_LIB_DIR=%{_libdir} \
159 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
160 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
161 %if %{with bluetooth_frwk_libnotify}
162         -DLIBNOTIFY_SUPPORT=On \
163 %else
164         -DLIBNOTIFY_SUPPORT=Off \
165 %endif
166 %if %{with bluetooth_frwk_libnotification}
167         -DLIBNOTIFICATION_SUPPORT=On
168 %else
169         -DLIBNOTIFICATION_SUPPORT=Off
170 %endif
171
172 make
173
174 %cmake \
175 %if "%{?profile}" == "wearable"
176         -DTIZEN_WEARABLE=YES \
177 %else
178         -DTIZEN_WEARABLE=NO \
179 %endif
180 %if "%{?profile}" == "common"
181         -DTIZEN_WEARABLE=NO \
182 %endif
183
184 %install
185 rm -rf %{buildroot}
186 %make_install
187
188 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
189 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
190 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-httpproxy
191 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
192
193 #mkdir -p %{buildroot}%{_libdir}/systemd/user
194 #install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_libdir}/systemd/user
195 mkdir -p %{buildroot}%{_unitdir}/%{_servicedir}
196 install -m 0644 %{_servicefile} %{buildroot}%{_unitdir}/bluetooth-frwk.service
197 ln -s ../bluetooth-frwk.service %{buildroot}%{_unitdir}/%{_servicedir}/bluetooth-frwk.service
198
199 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
200 mkdir -p %{buildroot}%{_datadir}/icons/default
201 install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
202 %endif
203
204 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
205 %if "%{profile}"=="ivi"
206 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
207 %endif
208
209
210 #%post
211 #/sbin/ldconfig
212 #%if "%{?profile}" == "wearable"
213 #vconftool set -f -t int db/bluetooth/status "1" -g 6520
214 #%endif
215 #%if "%{?profile}" == "mobile"
216 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
217 #%endif
218 #%if "%{?profile}" == "common"
219 #vconftool set -f -t int db/bluetooth/status "0" -g 6520
220 #%endif
221
222 #vconftool set -f -t int db/bluetooth/status "0" -s User
223 #vconftool set -f -t int db/bluetooth/lestatus "0" -s User
224 #vconftool set -f -t int file/private/bt-core/flight_mode_deactivated "0" -s User
225 #vconftool set -f -t int file/private/bt-core/powersaving_mode_deactivated "0" -s User
226 #vconftool set -f -t int file/private/bt-service/bt_off_due_to_timeout "0" -s User
227 #vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
228 #vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
229 #vconftool set -f -t bool memory/bluetooth/btsco "0" -g 6520 -i
230 #vconftool set -f -t bool memory/bluetooth/dutmode "0" -g 6520 -i
231
232
233 #%post service
234 #mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
235 #ln -sf %{_libdir}/systemd/user/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
236
237 %postun -p /sbin/ldconfig
238
239 %files
240 %manifest %{name}.manifest
241 %defattr(-, root, root)
242 %{_libdir}/libbluetooth-api.so.*
243 %{_datadir}/license/bluetooth-frwk
244 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
245 %{_unitdir}/bluetooth-frwk.service
246
247 %files devel
248 %defattr(-, root, root)
249 %{_includedir}/bt-service/bluetooth-api.h
250 %{_includedir}/bt-service/bluetooth-hid-api.h
251 %{_includedir}/bt-service/bluetooth-audio-api.h
252 %{_includedir}/bt-service/bluetooth-telephony-api.h
253 %{_includedir}/bt-service/bluetooth-media-control.h
254 %{_includedir}/bt-service/bluetooth-scmst-api.h
255 %{_includedir}/bt-service/bluetooth-ipsp-api.h
256 %{_libdir}/pkgconfig/bluetooth-api.pc
257 %{_libdir}/libbluetooth-api.so
258 %{_datadir}/license/bluetooth-frwk-devel
259
260 %files service
261 %manifest %{name}.manifest
262 %defattr(-, root, root)
263 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
264 %{_bindir}/bt-service
265 #%{_libdir}/systemd/user/bluetooth-frwk-tv.service
266 %{_unitdir}/%{_servicedir}/bluetooth-frwk.service
267 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
268 %{_bindir}/bluetooth-frwk-test
269 #%{_bindir}/bluetooth-gatt-test
270 #%{_bindir}/bluetooth-advertising-test
271 %{_varlibdir}/bluetooth
272 %{_prefix}/etc/bluetooth
273 #%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
274 #%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
275 #%{_dumpdir}/bluetooth_log_dump.sh
276 %{_datadir}/license/bluetooth-frwk-service
277 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
278 %{_datadir}/icons/default/bt-icon.png
279 %endif
280
281 %files httpproxy
282 %manifest %{name}.manifest
283 %defattr(-, root, root)
284 %{_bindir}/bt-httpproxy
285 %{_datadir}/license/bluetooth-frwk-httpproxy
286 %{_datadir}/dbus-1/system-services/org.projectx.httpproxy.service
287
288 %files core
289 %manifest %{name}.manifest
290 %defattr(-, root, root)
291 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
292 %{_bindir}/bt-core
293 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
294
295 %files test
296 %manifest %{name}.manifest
297 %defattr(-, root, root)
298 %{_bindir}/bluetooth-frwk-test
299 %{_bindir}/bluetooth-gatt-test
300 %{_bindir}/bluetooth-advertising-test