Increase the version
[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.150
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
60 Requires(post): /usr/bin/vconftool
61 Requires(post): /sbin/ldconfig
62 Requires(postun): /sbin/ldconfig
63 Requires: psmisc
64
65 %description
66 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
67  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
68
69
70 %package devel
71 Summary:    Bluetooth framework for BlueZ and Obexd
72 Group:      Development/Libraries
73 Requires:   %{name} = %{version}-%{release}
74
75 %description devel
76 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
77 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
78
79 %package service
80 Summary:    Bluetooth Service daemon
81 Group:      Network & Connectivity/Bluetooth
82 Requires:   %{name} = %{version}-%{release}
83
84 %description service
85 This package is Bluetooth Service daemon to manage BT services.
86
87 %package core
88 Summary:    Bluetooth Core daemon
89 Group:      Network & Connectivity/Bluetooth
90 Requires:   %{name} = %{version}-%{release}
91
92 %description core
93 This package is Bluetooth core daemon to manage activation / deactivation.
94
95 %package test
96 Summary:    Bluetooth test application
97 Group:      Network & Connectivity/Bluetooth
98 Requires:   %{name} = %{version}-%{release}
99
100 %description test
101 This package is Bluetooth test application.
102
103 %prep
104 %setup -q
105 cp %{SOURCE1001} .
106
107
108 %build
109 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
110 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
111 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
112
113 %define _servicefile packaging/bluetooth-frwk-common.service
114 %define _servicedir starter.target.wants
115
116 %if "%{?profile}" == "mobile"
117 export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE -DTIZEN_BT_FLIGHTMODE_ENABLED -DTIZEN_MOBILE -DTIZEN_TELEPHONY_ENABLED"
118 %define _servicefile packaging/bluetooth-frwk-mobile.service
119 %define _servicedir multi-user.target.wants
120 %endif
121
122 %if "%{?profile}" == "wearable"
123 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
124 %define _servicefile packaging/bluetooth-frwk-wearable.service
125 %define _servicedir multi-user.target.wants
126 %endif
127
128 %if "%{?profile}" == "tv"
129 export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
130 %define _servicefile packaging/bluetooth-frwk-mobile.service
131 %define _servicedir multi-user.target.wants
132 %endif
133
134 %ifarch x86_64
135 export CFLAGS="$CFLAGS -Wall -g -fvisibility=hidden -fPIC"
136 %else
137 export CFLAGS="$CFLAGS -fpie"
138 export LDFLAGS="$CFLAGS -pie"
139 %endif
140
141 export CFLAGS="$CFLAGS -DRFCOMM_DIRECT"
142 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
143
144 cmake . -DCMAKE_INSTALL_PREFIX=/usr \
145 -DCMAKE_LIB_DIR=%{_libdir} \
146 -DTZ_SYS_USER_GROUP=%TZ_SYS_USER_GROUP \
147 -DTZ_SYS_DEFAULT_USER=%TZ_SYS_DEFAULT_USER \
148 %if %{with bluetooth_frwk_libnotify}
149         -DLIBNOTIFY_SUPPORT=On \
150 %else
151         -DLIBNOTIFY_SUPPORT=Off \
152 %endif
153 %if %{with bluetooth_frwk_libnotification}
154         -DLIBNOTIFICATION_SUPPORT=On
155 %else
156         -DLIBNOTIFICATION_SUPPORT=Off
157 %endif
158
159 make
160
161 %cmake \
162 %if "%{?profile}" == "wearable"
163         -DTIZEN_WEARABLE=YES \
164 %else
165         -DTIZEN_WEARABLE=NO \
166 %endif
167 %if "%{?profile}" == "common"
168         -DTIZEN_WEARABLE=NO \
169 %endif
170
171 %install
172 rm -rf %{buildroot}
173 %make_install
174
175 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
176 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
177 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
178
179 #mkdir -p %{buildroot}%{_libdir}/systemd/user
180 #install -m 0644 packaging/bluetooth-frwk-tv.service %{buildroot}%{_libdir}/systemd/user
181 mkdir -p %{buildroot}%{_libdir}/systemd/system/%{_servicedir}
182 install -m 0644 %{_servicefile} %{buildroot}%{_libdir}/systemd/system/bluetooth-frwk.service
183 ln -s ../bluetooth-frwk.service %{buildroot}%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
184
185 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
186 mkdir -p %{buildroot}%{_datadir}/icons/default
187 install -m 0644 %{SOURCE1002} %{buildroot}%{_datadir}/icons/default/bt-icon.png
188 %endif
189
190 # On IVI bt-service needs to be run as 'app' even if there is a 'guest' user.
191 %if "%{profile}"=="ivi"
192 sed -i 's/%TZ_SYS_DEFAULT_USER/app/' %{buildroot}%{_datadir}/dbus-1/system-services/org.projectx.bt.service
193 %endif
194
195
196 %post
197 /sbin/ldconfig
198 %if "%{?profile}" == "wearable"
199 vconftool set -f -t int db/bluetooth/status "1" -g 6520
200 %endif
201 %if "%{?profile}" == "mobile"
202 vconftool set -f -t int db/bluetooth/status "0" -g 6520
203 %endif
204 %if "%{?profile}" == "common"
205 vconftool set -f -t int db/bluetooth/status "0" -g 6520
206 %endif
207
208 vconftool set -f -t int db/bluetooth/status "0" -s User
209 vconftool set -f -t int db/bluetooth/lestatus "0" -s User
210 vconftool set -f -t int file/private/bt-core/flight_mode_deactivated "0" -s User
211 vconftool set -f -t int file/private/bt-core/powersaving_mode_deactivated "0" -s User
212 vconftool set -f -t int file/private/bt-service/bt_off_due_to_timeout "0" -s User
213 vconftool set -f -t string memory/bluetooth/sco_headset_name "" -g 6520 -i
214 vconftool set -f -t int memory/bluetooth/device "0" -g 6520 -i
215 vconftool set -f -t bool memory/bluetooth/btsco "0" -g 6520 -i
216 vconftool set -f -t bool memory/bluetooth/dutmode "0" -g 6520 -i
217
218
219 #%post service
220 #mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
221 #ln -sf %{_libdir}/systemd/user/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
222
223 %postun -p /sbin/ldconfig
224
225 %files
226 %manifest %{name}.manifest
227 %defattr(-, root, root)
228 %{_libdir}/libbluetooth-api.so.*
229 %{_datadir}/license/bluetooth-frwk
230 %{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
231 %{_libdir}/systemd/system/bluetooth-frwk.service
232
233 %files devel
234 %defattr(-, root, root)
235 %{_includedir}/bt-service/bluetooth-api.h
236 %{_includedir}/bt-service/bluetooth-hid-api.h
237 %{_includedir}/bt-service/bluetooth-audio-api.h
238 %{_includedir}/bt-service/bluetooth-telephony-api.h
239 %{_includedir}/bt-service/bluetooth-media-control.h
240 %{_includedir}/bt-service/bluetooth-scmst-api.h
241 %{_libdir}/pkgconfig/bluetooth-api.pc
242 %{_libdir}/libbluetooth-api.so
243 %{_datadir}/license/bluetooth-frwk-devel
244
245 %files service
246 %manifest %{name}.manifest
247 %defattr(-, root, root)
248 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
249
250 %{_bindir}/bt-service
251 #%{_libdir}/systemd/user/bluetooth-frwk-tv.service
252 %{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
253 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-service.conf
254 %{_bindir}/bluetooth-frwk-test
255 #%{_bindir}/bluetooth-gatt-test
256 #%{_bindir}/bluetooth-advertising-test
257 %{_varlibdir}/bluetooth
258 %{_prefix}/etc/bluetooth
259 #%attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
260 #%attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
261 #%{_dumpdir}/bluetooth_log_dump.sh
262 %{_datadir}/license/bluetooth-frwk-service
263 %if %{with bluetooth_frwk_libnotify} || %{with bluetooth_frwk_libnotification}
264 %{_datadir}/icons/default/bt-icon.png
265 %endif
266
267 %files core
268 %manifest %{name}.manifest
269 %defattr(-, root, root)
270 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
271 %{_bindir}/bt-core
272 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-core.conf
273
274 %files test
275 %manifest %{name}.manifest
276 %defattr(-, root, root)
277 %{_bindir}/bluetooth-frwk-test
278 %{_bindir}/bluetooth-gatt-test
279 %{_bindir}/bluetooth-advertising-test