fhub: Apply lastest FHUB4.0 bluetooth-agent
[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.6.0
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 BuildRequires:  pkgconfig(capi-media-audio-io)
15
16 # The profile macro usage with the following comments may be removed after
17 # Tizen OBS build projects are merged. However, each vendor may keep using
18 # such if/endif statement to skip building profiles not interested
19
20 # This usage of profile macro does NOT conflict 4.0 configurability.
21 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
22 # Original: wearable, ivi. Added: common, "undefined"
23 BuildRequires:  pkgconfig(alarm-service)
24 BuildRequires:  pkgconfig(capi-appfw-app-manager)
25 BuildRequires:  pkgconfig(capi-system-device)
26 %endif
27 # This usage of profile macro does NOT conflict 4.0 configurability.
28 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
29 # Original: common, mobile, tv. Added: "undefined"
30 BuildRequires:  pkgconfig(contacts-service2)
31 BuildRequires:  pkgconfig(msg-service)
32 BuildRequires:  pkgconfig(email-service)
33 %endif
34 BuildRequires:  pkgconfig(capi-system-info)
35 BuildRequires:  pkgconfig(dbus-1)
36 BuildRequires:  pkgconfig(tapi)
37 BuildRequires:  pkgconfig(dlog)
38 BuildRequires:  pkgconfig(vconf)
39 BuildRequires:  pkgconfig(appsvc)
40 BuildRequires:  pkgconfig(capi-appfw-application)
41 BuildRequires:  pkgconfig(capi-network-connection)
42 BuildRequires:  pkgconfig(capi-network-bluetooth)
43 BuildRequires:  pkgconfig(capi-media-image-util)
44 BuildRequires:  pkgconfig(contacts-service2)
45 BuildRequires:  pkgconfig(libexif)
46 BuildRequires:  pkgconfig(gio-2.0)
47 BuildRequires:  cmake
48 Requires: security-config
49 %if 0%{?gcov:1}
50 BuildRequires:  gtest-devel
51 BuildRequires:  lcov
52 %endif
53
54 #Requires:      %{name}-compat = %{version}-%{release}
55 #Recommends:    %{name}-profile_common = %{version}-%{release}
56
57 %description
58 Bluetooth agent packages that support various external profiles
59
60 %package hfp_ag
61 Summary:        Bluetooth agent for HFP(Hands-Free Profile)'s AG(Audio Gate) role
62 Requires:   %{name} = %{version}-%{release}
63 Group:      Network & Connectivity/Bluetooth
64 %description hfp_ag
65 Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s AG(Audio Gate) role
66
67 %package hfp_hf
68 Summary:        Bluetooth agent for HFP(Hands-Free Profile)'s HF(Hands-Free) role
69 Requires:   %{name} = %{version}-%{release}
70 Group:      Network & Connectivity/Bluetooth
71 %description hfp_hf
72 Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s HF(Hands-Free) role
73
74 %package map
75 Summary:        Bluetooth agent for MAP(Message Access Profile) server
76 Requires:   %{name} = %{version}-%{release}
77 Group:      Network & Connectivity/Bluetooth
78 %description map
79 Bluetooth agent binary compiled for MAP(Message Access Profile) server
80
81 %package pbap
82 Summary:        Bluetooth agent for PBAP(PhoneBook Access Profile) server
83 Requires:   %{name} = %{version}-%{release}
84 Group:      Network & Connectivity/Bluetooth
85 %description pbap
86 Bluetooth agent binary compiled for PBAP(PhoneBook Access Profile) server
87
88 %package hid
89 Summary:        Bluetooth agent for HID(Human Interface Device)'s device role
90 Requires:   %{name} = %{version}-%{release}
91 Group:      Network & Connectivity/Bluetooth
92 %description hid
93 Bluetooth agent binary compiled for HID(Human Interface Device)'s device role
94
95 %package ipsp
96 Summary:        Bluetooth agent for IPSP(Internet Protocol Support Profile)
97 Requires:   %{name} = %{version}-%{release}
98 Group:      Network & Connectivity/Bluetooth
99 %description ipsp
100 Bluetooth agent binary compiled for IPSP(Internet Protocol Support Profile)
101
102 %package tool
103 Summary:       Test Application for HF
104
105 %description tool
106 Test Application for HF
107
108 %prep
109 %setup -q
110 cp %{SOURCE1001} .
111
112 %build
113 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
114 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
115 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
116 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_MEDIA_ENHANCE"
117 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HFP_AG"
118 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_DUAL_HF"
119
120 %ifarch aarch64 x86_64
121 echo arch64
122 export CFLAGS+=" -DARCH64"
123 export CXXFLAGS+=" -DARCH64"
124 export FFLAGS+=" -DARCH64"
125 %endif
126
127 export CFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
128 export CXXFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
129
130 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
131
132 export CFLAGS_DEFAULT="$CFLAGS"
133
134 %if 0%{?gcov:1}
135 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
136 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
137 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
138 export LDFLAGS+=" -lgcov"
139 %endif
140
141 # Build All (wearalbe/ivi/common/tv/mobile)
142 %cmake . -DCMAKE_INSTALL_PREFIX=/usr \
143         -DTIZEN_FEATURE_BT_HFP_AG=1 \
144         -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} \
145         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
146
147 make VERBOSE=1
148
149 %if 0%{?gcov:1}
150 mkdir -p gcov-obj
151 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
152 %endif
153
154 %install
155 rm -rf %{buildroot}
156 %make_install
157
158 mkdir -p %{buildroot}%{_libdir}/systemd/system/
159 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/
160
161 # This usage of profile macro does NOT conflict 4.0 configurability.
162 #%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
163 # Original: wearable, ivi. Added: common, "undefined"
164 #mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
165 #mkdir -p %{buildroot}%{_bindir}/
166 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
167 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.ipsp_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
168 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
169 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-ipsp-agent %{buildroot}%{_bindir}/
170 #%endif
171 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_unitdir}/bluetooth-map-agent.service
172 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_unitdir}/bluetooth-pbap-agent.service
173 install -D -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/bluetooth-ag-agent.service
174 install -D -m 0644 packaging/bluetooth-hf-agent.service %{buildroot}%{_unitdir}/bluetooth-hf-agent.service
175 install -D -m 0644 packaging/bluetooth-hid-agent.service %{buildroot}%{_unitdir}/bluetooth-hid-agent.service
176
177 %if 0%{?gcov:1}
178 mkdir -p %{buildroot}%{_datadir}/gcov/obj/%{name}
179 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name}/
180 %endif
181
182 %check
183 %if 0%{?gcov:1}
184 pushd unittest
185 ./run_coverage.sh
186 popd
187 %endif
188
189 install -D -m 0644 packaging/bluetooth-hf-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hf-agent.service
190 ln -s ../bluetooth-hf-agent.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hf-agent.service
191
192 %files
193 %manifest %{name}.manifest
194 %license LICENSE
195 %defattr(-, root, root)
196 %exclude %{_bindir}/gtest-bluetooth-agent
197 %exclude %{_libdir}/lib*
198 %exclude %{_datadir}/gcov/obj/*
199
200 %files hfp_ag
201 %manifest %{name}.manifest
202 %license LICENSE
203 %{_bindir}/bluetooth-ag-agent
204 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
205 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
206 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
207 %{_unitdir}/bluetooth-ag-agent.service
208 #%exclude %{_unitdir}/bluetooth-map-agent.service
209 #%exclude %{_unitdir}/bluetooth-pbap-agent.service
210
211 %files hfp_hf
212 %manifest %{name}.manifest
213 %license LICENSE
214 %{_bindir}/bluetooth-hf-agent
215 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
216 %{_sysconfdir}/dbus-1/system.d/bluetooth-hf-agent.conf
217 %{_unitdir}/bluetooth-hf-agent.service
218 #%exclude %{_unitdir}/bluetooth-map-agent.service
219 #%exclude %{_unitdir}/bluetooth-pbap-agent.service
220 %{_libdir}/systemd/system/bluetooth-hf-agent.service
221 %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hf-agent.service
222
223 %files map
224 %manifest %{name}.manifest
225 %license LICENSE
226 %{_bindir}/bluetooth-map-agent
227 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
228 %{_unitdir}/bluetooth-map-agent.service
229 %{_sysconfdir}/dbus-1/system.d/bluetooth_map_agent.conf
230
231 %files pbap
232 %manifest %{name}.manifest
233 %license LICENSE
234 %{_bindir}/bluetooth-pb-agent
235 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
236 %{_unitdir}/bluetooth-pbap-agent.service
237 %{_sysconfdir}/dbus-1/system.d/bluetooth_pb_agent.conf
238
239 %files hid
240 %manifest %{name}.manifest
241 %license LICENSE
242 %{_bindir}/bluetooth-hid-agent
243 %{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service
244 %{_unitdir}/bluetooth-hid-agent.service
245 %{_sysconfdir}/dbus-1/system.d/bluetooth-hid-agent.conf
246
247 %files ipsp
248 %manifest %{name}.manifest
249 %license LICENSE
250 %{_bindir}/bluetooth-ipsp-agent
251 %{_datadir}/dbus-1/system-services/org.bluez.ipsp_agent.service
252 %{_sysconfdir}/dbus-1/system.d/bluetooth-ipsp-agent.conf
253
254 %files tool
255 %{_bindir}/hf-test