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