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