Code Sync [Tizen3.0]: Merged the tizen_2.4 Spin code to tizen.org
[platform/core/connectivity/bluetooth-frwk.git] / packaging / bluetooth-frwk.spec
1 %define _dumpdir /opt/etc/dump.d/module.d
2 %define _varlibdir /opt/var/lib
3
4 Name:       bluetooth-frwk
5 Summary:    Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
6 Version:    0.2.146
7 Release:    1
8 Group:      Network & Connectivity/Bluetooth
9 License:    Apache License, Version 2.0
10 Source0:    %{name}-%{version}.tar.gz
11 Source1001: bluetooth-frwk.manifest
12 URL:        https://review.tizen.org/git/?p=platform/core/connectivity/bluetooth-frwk.git;a=summary
13 Requires: sys-assert
14 Requires: dbus
15 Requires: syspopup
16 BuildRequires:  pkgconfig(aul)
17 BuildRequires:  pkgconfig(dbus-glib-1)
18 BuildRequires:  pkgconfig(dlog)
19 BuildRequires:  pkgconfig(glib-2.0)
20 BuildRequires:  pkgconfig(gio-2.0)
21 BuildRequires:  pkgconfig(gio-unix-2.0)
22 BuildRequires:  pkgconfig(syspopup-caller)
23 BuildRequires:  pkgconfig(vconf)
24 BuildRequires:  pkgconfig(libxml-2.0)
25 BuildRequires:  pkgconfig(dbus-1)
26 BuildRequires:  pkgconfig(utilX)
27 BuildRequires:  pkgconfig(capi-network-connection)
28 BuildRequires:  pkgconfig(alarm-service)
29 BuildRequires:  pkgconfig(notification)
30 BuildRequires:  pkgconfig(security-server)
31 BuildRequires:  pkgconfig(capi-content-mime-type)
32 BuildRequires:  pkgconfig(appcore-efl)
33 BuildRequires:  pkgconfig(pkgmgr)
34 #BuildRequires:  pkgconfig(journal)
35
36 %if "%{?tizen_profile_name}" == "mobile"
37 BuildRequires:  pkgconfig(capi-network-tethering)
38 %endif
39
40 BuildRequires:  cmake
41
42 #Requires(post): vconf
43 #Requires(postun): eglibc
44 #Requires: psmisc
45 Requires(post): /usr/bin/vconftool
46 Requires(post): /sbin/ldconfig
47 Requires(postun): /sbin/ldconfig
48 Requires(postun): eglibc
49 Requires: psmisc
50
51 %description
52 Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
53  This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
54
55
56 %package devel
57 Summary:    Bluetooth framework for BlueZ and Obexd
58 Group:      Development/Libraries
59 Requires:   %{name} = %{version}-%{release}
60
61 %description devel
62 This package is development files for Bluetooth framework based on BlueZ and Obexd stack.
63 This package contains API set for BT GAP, BT SDP, and BT RFCOMM.
64
65 %package service
66 Summary:    Bluetooth Service daemon
67 Group:      Network & Connectivity/Bluetooth
68 Requires:   %{name} = %{version}-%{release}
69
70 %description service
71 This package is Bluetooth Service daemon to manage BT services.
72
73 %package core
74 Summary:    Bluetooth Core daemon
75 Group:      Network & Connectivity/Bluetooth
76 Requires:   %{name} = %{version}-%{release}
77
78 %description core
79 This package is Bluetooth core daemon to manage activation / deactivation.
80
81 %package test
82 Summary:    Bluetooth test application
83 Group:      Network & Connectivity/Bluetooth
84 Requires:   %{name} = %{version}-%{release}
85
86 %description test
87 This package is Bluetooth test application.
88
89 %prep
90 %setup -q
91 cp %{SOURCE1001} .
92
93
94 %build
95 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
96 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
97 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
98
99 %if "%{?tizen_profile_name}" == "mobile"
100 export CFLAGS="$CFLAGS -DTIZEN_NETWORK_TETHERING_ENABLE"
101 %endif
102
103 %if "%{?tizen_profile_name}" == "wearable"
104 export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
105 %define _servicefile packaging/bluetooth-frwk-wearable.service
106 %else
107 %define _servicefile packaging/bluetooth-frwk-mobile.service
108 %endif
109 %define _servicedir multi-user.target.wants
110
111 %if "%{?tizen_profile_name}" == "mobile"
112 %else
113 export CFLAGS="$CFLAGS -DTIZEN_TELEPHONY_ENABLED"
114 %endif
115
116 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
117
118 export CFLAGS+=" -fpie -DRFCOMM_DIRECT "
119 cmake . -DCMAKE_INSTALL_PREFIX=/usr
120
121 make
122
123 %cmake \
124 %if "%{?tizen_profile_name}" == "wearable"
125         -DTIZEN_WEARABLE=YES \
126 %else
127         -DTIZEN_WEARABLE=NO \
128 %endif
129
130 %install
131 rm -rf %{buildroot}
132 %make_install
133
134 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk
135 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-service
136 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-frwk-devel
137
138 mkdir -p %{buildroot}%{_libdir}/systemd/system/%{_servicedir}
139 install -m 0644 %{_servicefile} %{buildroot}%{_libdir}/systemd/system/bluetooth-frwk.service
140 ln -s ../bluetooth-frwk.service %{buildroot}%{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
141
142 mkdir -p %{buildroot}%{_dumpdir}
143 install -m 0755 bluetooth_log_dump.sh %{buildroot}%{_dumpdir}
144
145 %post
146 %if "%{?tizen_profile_name}" == "wearable"
147 vconftool set -tf int db/bluetooth/status "1" -g 5000 -s tizen::vconf::public::r::platform::rw
148 %else
149 vconftool set -tf int db/bluetooth/status "0" -g 5000 -s tizen::vconf::public::r::platform::rw
150 %endif
151 vconftool set -tf int db/bluetooth/lestatus "0" -g 5000 -s tizen::vconf::public::r::platform::rw
152 vconftool set -tf int file/private/bt-core/flight_mode_deactivated "0" -g 5000 -i -s tizen::vconf::platform::rw
153 vconftool set -tf int file/private/bt-core/powersaving_mode_deactivated "0" -g 5000 -i -s tizen::vconf::platform::rw
154 vconftool set -tf int file/private/bt-service/bt_off_due_to_timeout "0" -g 5000 -i -s tizen::vconf::platform::rw
155 vconftool set -tf string memory/bluetooth/sco_headset_name "" -g 5000 -i -s tizen::vconf::platform::rw
156 vconftool set -tf int memory/bluetooth/device "0" -g 5000 -i -s tizen::vconf::platform::rw
157 vconftool set -tf bool memory/bluetooth/dutmode "0" -g 5000 -i -s tizen::vconf::platform::rw
158
159 %post service
160 mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
161 ln -sf %{_libdir}/systemd/system/bluetooth-frwk.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
162
163 %postun -p /sbin/ldconfig
164
165 %files
166 %manifest %{name}.manifest
167 %defattr(-, root, root)
168 %{_libdir}/libbluetooth-api.so.*
169 %{_datadir}/license/bluetooth-frwk
170 %{_libdir}/systemd/system/%{_servicedir}/bluetooth-frwk.service
171 %{_libdir}/systemd/system/bluetooth-frwk.service
172
173 %files devel
174 %defattr(-, root, root)
175 %{_includedir}/bt-service/bluetooth-api.h
176 %{_includedir}/bt-service/bluetooth-hid-api.h
177 %{_includedir}/bt-service/bluetooth-audio-api.h
178 %{_includedir}/bt-service/bluetooth-telephony-api.h
179 %{_includedir}/bt-service/bluetooth-media-control.h
180 %{_includedir}/bt-service/bluetooth-scmst-api.h
181 %{_libdir}/pkgconfig/bluetooth-api.pc
182 %{_libdir}/libbluetooth-api.so
183 %{_datadir}/license/bluetooth-frwk-devel
184
185 %files service
186 %manifest %{name}.manifest
187 %defattr(-, root, root)
188 %{_sysconfdir}/rc.d/init.d/bluetooth-frwk-service
189 %{_datadir}/dbus-1/system-services/org.projectx.bt.service
190 %{_bindir}/bt-service
191 %{_bindir}/bluetooth-frwk-test
192 %{_bindir}/bluetooth-gatt-test
193 %{_bindir}/bluetooth-advertising-test
194 %{_varlibdir}/bluetooth
195 %{_prefix}/etc/bluetooth
196 %attr(0666,-,-) %{_varlibdir}/bluetooth/auto-pair-blacklist
197 %attr(0666,-,-) %{_prefix}/etc/bluetooth/stack_info
198 %{_dumpdir}/bluetooth_log_dump.sh
199 %{_datadir}/license/bluetooth-frwk-service
200
201 %files core
202 %manifest %{name}.manifest
203 %defattr(-, root, root)
204 %{_datadir}/dbus-1/system-services/org.projectx.bt_core.service
205 %{_bindir}/bt-core
206
207 %files test
208 %manifest %{name}.manifest
209 %defattr(-, root, root)
210 %{_bindir}/bluetooth-frwk-test
211 %{_bindir}/bluetooth-gatt-test
212 %{_bindir}/bluetooth-advertising-test