Add the ag-agent to wearable profile
[platform/core/connectivity/bluetooth-agent.git] / packaging / bluetooth-agent.spec
1 %define _usrlibdir /usr/lib
2
3 Name:       bluetooth-agent
4 Summary:    Bluetooth agent packages that support various external profiles
5 Version:    0.1.3
6 Release:    1
7 Group:      Network & Connectivity/Bluetooth
8 License:    Apache-2.0
9 Source0:    %{name}-%{version}.tar.gz
10 Source1001:     bluetooth-agent.manifest
11
12 BuildRequires:  pkgconfig(aul)
13 BuildRequires:  pkgconfig(bluetooth-api)
14
15 # The profile macro usage with the following comments may be removed after
16 # Tizen OBS build projects are merged. However, each vendor may keep using
17 # such if/endif statement to skip building profiles not interested
18
19 # This usage of profile macro does NOT conflict 4.0 configurability.
20 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
21 # Original: wearable, ivi. Added: common, "undefined"
22 BuildRequires:  pkgconfig(alarm-service)
23 BuildRequires:  pkgconfig(capi-appfw-app-manager)
24 BuildRequires:  pkgconfig(capi-system-device)
25 %endif
26 # This usage of profile macro does NOT conflict 4.0 configurability.
27 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
28 # Original: common, mobile, tv. Added: "undefined"
29 BuildRequires:  pkgconfig(contacts-service2)
30 BuildRequires:  pkgconfig(msg-service)
31 BuildRequires:  pkgconfig(email-service)
32 %endif
33 BuildRequires:  pkgconfig(capi-system-info)
34 BuildRequires:  pkgconfig(dbus-glib-1)
35 BuildRequires:  pkgconfig(tapi)
36 BuildRequires:  pkgconfig(dlog)
37 BuildRequires:  pkgconfig(vconf)
38 BuildRequires:  pkgconfig(appsvc)
39 BuildRequires:  pkgconfig(capi-appfw-application)
40 BuildRequires:  pkgconfig(capi-network-connection)
41 BuildRequires:  pkgconfig(capi-network-bluetooth)
42 BuildRequires:  pkgconfig(capi-media-image-util)
43 BuildRequires:  pkgconfig(contacts-service2)
44 BuildRequires:  pkgconfig(libexif)
45 BuildRequires:  pkgconfig(gio-2.0)
46 BuildRequires:  cmake
47 Requires: security-config
48 Requires:       %{name}-compat = %{version}-%{release}
49 Recommends:     %{name}-profile_common = %{version}-%{release}
50
51 %description
52 Bluetooth agent packages that support various external profiles
53
54 %package profile_common
55 Summary:        Bluetooth agent for common/tv/mobile
56 Provides:       %{name}-compat = %{version}-%{release}
57 Provides:       %{name}-profile_mobile = %{version}-%{release}
58 Provides:       %{name}-profile_tv = %{version}-%{release}
59 Conflicts:      %{name}-profile_ivi
60 Conflicts:      %{name}-profile_wearable
61 %description profile_common
62 Bluetooth agent binary compiled for common, tv, mobile profiles
63
64 %package profile_ivi
65 Summary:        Bluetooth agent for ivi
66 Provides:       %{name}-compat = %{version}-%{release}
67 Conflicts:      %{name}-profile_common
68 Conflicts:      %{name}-profile_wearable
69 %description profile_ivi
70 Bluetooth agent binary compiled for ivi profile
71
72 %package profile_wearable
73 Summary:        Bluetooth agent for wearable
74 Provides:       %{name}-compat = %{version}-%{release}
75 Conflicts:      %{name}-profile_common
76 Conflicts:      %{name}-profile_ivi
77 %description profile_wearable
78 Bluetooth agent binary compiled for wearable profile
79
80 %package ipsp
81 Summary:    Bluetooth Ipsp daemon
82 Group:      Network & Connectivity/Bluetooth
83 Requires:   %{name} = %{version}-%{release}
84
85 %description ipsp
86 This package is Bluetooth ipsp daemon to manage activation / deactivation.
87
88 %prep
89 %setup -q
90 cp %{SOURCE1001} .
91
92 %build
93 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
94 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
95 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
96 #export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_MEDIA_ENHANCE"
97 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HFP_AG"
98 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_DUAL_HF"
99
100 %ifarch aarch64
101 echo arch64
102 export CFLAGS+=" -DARCH64"
103 export CXXFLAGS+=" -DARCH64"
104 export FFLAGS+=" -DARCH64"
105 %endif
106
107 %ifarch x86_64
108 echo x86_64
109 export CFLAGS+=" -DARCH64"
110 export CXXFLAGS+=" -DARCH64"
111 export FFLAGS+=" -DARCH64"
112 %endif
113
114 export CFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
115 export CXXFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
116
117 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
118
119 export CFLAGS_DEFAULT="$CFLAGS"
120
121 # This usage of profile macro does NOT conflict 4.0 configurability.
122 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
123 # Original: wearable, ivi. Added: common, "undefined"
124
125 # Build Wearable
126 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_PROFILE_WEARABLE"
127 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_LUNAR_DEVICE"
128 mkdir -p wearable_build
129 pushd wearable_build
130 cmake .. -DCMAKE_INSTALL_PREFIX=/usr/wearable -DTIZEN_PROFILE_WEARABLE=1 -DTIZEN_FEATURE_BT_HFP_AG=1
131 make VERBOSE=1
132 popd
133
134
135 # Build IVI
136 # TODO: BT-Agent Developers, Please Check if TIZEN_KIRAN is really need for ALL NON-WEARABLES.
137 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_KIRAN_DEVICE"
138 export CFLAGS="$CFLAGS -DTIZEN_PROFILE_IVI"
139 mkdir -p ivi_build
140 pushd ivi_build
141 cmake .. -DCMAKE_INSTALL_PREFIX=/usr/ivi -DTIZEN_PROFILE_WEARABLE=0 -DTIZEN_PROFILE_IVI=1 -DTIZEN_FEATURE_BT_HFP_AG=1
142 make VERBOSE=1
143 popd
144
145 %endif
146
147
148 # This usage of profile macro does NOT conflict 4.0 configurability.
149 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
150 # Original: common, mobile, tv. Added: "undefined"
151
152 # Build All Others (common/tv/mobile)
153 # TODO: BT-Agent Developers, Please Check if TIZEN_KIRAN is really need for ALL NON-WEARABLES.
154 export CFLAGS="$CFLAGS_DEFAULT -DTIZEN_FEATURE_BT_KIRAN_DEVICE"
155 mkdir -p common_build
156 pushd common_build
157 cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_PROFILE_WEARABLE=0 -DTIZEN_FEATURE_BT_HFP_AG=1
158 make VERBOSE=1
159 popd
160
161 %endif
162
163 %install
164 rm -rf %{buildroot}
165 # This usage of profile macro does NOT conflict 4.0 configurability.
166 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
167 # Original: wearable, ivi. Added: common, "undefined"
168 pushd wearable_build
169 %make_install
170 popd
171 pushd ivi_build
172 %make_install
173 popd
174 %endif
175
176 # This usage of profile macro does NOT conflict 4.0 configurability.
177 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
178 # Original: common, mobile, tv. Added: "undefined"
179 pushd common_build
180 %make_install
181 popd
182 %endif
183
184 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service
185 # This usage of profile macro does NOT conflict 4.0 configurability.
186 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
187 # Original: wearable, ivi. Added: common, "undefined"
188 mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
189 mkdir -p %{buildroot}%{_bindir}/
190 install -D -m 0644 %{buildroot}/usr/wearable/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
191 install -D -m 0644 %{buildroot}/usr/wearable/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
192 install -D -m 0644 %{buildroot}/usr/wearable/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
193 install -D -m 0644 %{buildroot}/usr/wearable/bin/bt-ipsp %{buildroot}%{_bindir}/
194 install -D -m 0644 %{buildroot}/usr/ivi/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
195 install -D -m 0644 %{buildroot}/usr/ivi/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/bluetooth-hf-agent.ivi
196 install -D -m 0644 %{buildroot}/usr/ivi/bin/bt-ipsp %{buildroot}%{_bindir}/
197 rm -Rf %{buildroot}/usr/ivi
198 rm -Rf %{buildroot}/usr/wearable
199 %endif
200 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
201
202 %post
203 %if 0%{?sec_product_feature_bt_map_server_enable}
204 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
205 %endif
206 ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
207
208 # This usage of profile macro does NOT conflict 4.0 configurability.
209 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
210 # Original: wearable, ivi. Added: common, "undefined"
211 %post profile_ivi
212 ln -sf bluetooth-hf-agent.ivi %{_bindir}/bluetooth-hf-agent
213 %preun profile_ivi
214 rm %{_bindir}/bluetooth-hf-agent
215 %endif
216
217 %files
218 %manifest %{name}.manifest
219 %license LICENSE
220 %defattr(-, root, root)
221
222 # This usage of profile macro does NOT conflict 4.0 configurability.
223 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
224 # Original: wearable, ivi. Added: common, "undefined"
225 %files profile_wearable
226 %license LICENSE
227 %{_bindir}/bluetooth-hf-agent
228 %{_bindir}/bluetooth-ag-agent
229 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
230 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
231 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
232 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
233 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
234
235 %files profile_ivi
236 %license LICENSE
237 %{_bindir}/bluetooth-hf-agent.ivi
238 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
239 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
240 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
241 %endif
242
243 # This usage of profile macro does NOT conflict 4.0 configurability.
244 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
245 # Original: common, mobile, tv. Added: "undefined"
246 %files profile_common
247 %license LICENSE
248 %{_bindir}/bluetooth-ag-agent
249 %{_bindir}/bluetooth-map-agent
250 %{_bindir}/bluetooth-pb-agent
251 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
252 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
253 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
254 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
255 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
256 %{_libdir}/systemd/system/bluetooth-map-agent.service
257 %{_libdir}/systemd/system/bluetooth-pbap-agent.service
258 %endif
259
260 %files ipsp
261 %manifest %{name}.manifest
262 %license LICENSE
263 %defattr(-, root, root)
264 %{_datadir}/dbus-1/system-services/org.projectx.bt_ipsp.service
265 %{_bindir}/bt-ipsp
266 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-ipsp.conf