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