Modify the service file path for 64bit target
[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-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 %if 0%{?gcov:1}
49 BuildRequires:  pkgconfig(gmock)
50 BuildRequires:  lcov
51 %endif
52
53 #Requires:      %{name}-compat = %{version}-%{release}
54 #Recommends:    %{name}-profile_common = %{version}-%{release}
55
56 %description
57 Bluetooth agent packages that support various external profiles
58
59 %package hfp_ag
60 Summary:        Bluetooth agent for HFP(Hands-Free Profile)'s AG(Audio Gate) role
61 Requires:   %{name} = %{version}-%{release}
62 Group:      Network & Connectivity/Bluetooth
63 %description hfp_ag
64 Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s AG(Audio Gate) role
65
66 %package hfp_hf
67 Summary:        Bluetooth agent for HFP(Hands-Free Profile)'s HF(Hands-Free) role
68 Requires:   %{name} = %{version}-%{release}
69 Group:      Network & Connectivity/Bluetooth
70 %description hfp_hf
71 Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s HF(Hands-Free) role
72
73 %package map
74 Summary:        Bluetooth agent for MAP(Message Access Profile) server
75 Requires:   %{name} = %{version}-%{release}
76 Group:      Network & Connectivity/Bluetooth
77 %description map
78 Bluetooth agent binary compiled for MAP(Message Access Profile) server
79
80 %package pbap
81 Summary:        Bluetooth agent for PBAP(PhoneBook Access Profile) server
82 Requires:   %{name} = %{version}-%{release}
83 Group:      Network & Connectivity/Bluetooth
84 %description pbap
85 Bluetooth agent binary compiled for PBAP(PhoneBook Access Profile) server
86
87 %package hid
88 Summary:        Bluetooth agent for HID(Human Interface Device)'s device role
89 Requires:   %{name} = %{version}-%{release}
90 Group:      Network & Connectivity/Bluetooth
91 %description hid
92 Bluetooth agent binary compiled for HID(Human Interface Device)'s device role
93
94 %package ipsp
95 Summary:        Bluetooth agent for IPSP(Internet Protocol Support Profile)
96 Requires:   %{name} = %{version}-%{release}
97 Group:      Network & Connectivity/Bluetooth
98 %description ipsp
99 Bluetooth agent binary compiled for IPSP(Internet Protocol Support Profile)
100
101 %if 0%{?gcov:1}
102 %package gcov
103 Summary: Test package for bluetooth-agent
104 Group:   TO_BE/FILLED
105 Requires: %{name} = %{version}-%{release}
106
107 %description gcov
108 This package is C-API test application.
109 %endif
110
111 %prep
112 %setup -q
113 cp %{SOURCE1001} .
114
115 %build
116 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
117 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
118 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
119 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_MEDIA_ENHANCE"
120 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HFP_AG"
121 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_DUAL_HF"
122
123 %ifarch aarch64 x86_64
124 echo arch64
125 export CFLAGS+=" -DARCH64"
126 export CXXFLAGS+=" -DARCH64"
127 export FFLAGS+=" -DARCH64"
128 %endif
129
130 export CFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
131 export CXXFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
132
133 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
134
135 export CFLAGS_DEFAULT="$CFLAGS"
136
137 %if 0%{?gcov:1}
138 export CFLAGS+=" -fprofile-arcs -ftest-coverage"
139 export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
140 export FFLAGS+=" -fprofile-arcs -ftest-coverage"
141 export LDFLAGS+=" -lgcov"
142 %endif
143
144 # Build All (wearalbe/ivi/common/tv/mobile)
145 %cmake . -DCMAKE_INSTALL_PREFIX=/usr \
146         -DTIZEN_FEATURE_BT_HFP_AG=1 \
147         -DBUILD_GTESTS=%{?gcov:1}%{!?gcov:0} \
148         -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
149
150 make VERBOSE=1
151
152 %if 0%{?gcov:1}
153 mkdir -p gcov-obj
154 find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
155 %endif
156
157 %install
158 rm -rf %{buildroot}
159 %make_install
160
161 %if 0%{?gcov:1}
162 mkdir -p %{buildroot}%{_datadir}/gcov/obj
163 install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
164 %endif
165
166 # This usage of profile macro does NOT conflict 4.0 configurability.
167 #%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
168 # Original: wearable, ivi. Added: common, "undefined"
169 #mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
170 #mkdir -p %{buildroot}%{_bindir}/
171 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
172 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.ipsp_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
173 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
174 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-ipsp-agent %{buildroot}%{_bindir}/
175 #%endif
176 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_unitdir}/bluetooth-map-agent.service
177 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_unitdir}/bluetooth-pbap-agent.service
178 install -D -m 0644 packaging/bluetooth-ag-agent.service %{buildroot}%{_unitdir}/bluetooth-ag-agent.service
179 install -D -m 0644 packaging/bluetooth-hf-agent.service %{buildroot}%{_unitdir}/bluetooth-hf-agent.service
180 install -D -m 0644 packaging/bluetooth-hid-agent.service %{buildroot}%{_unitdir}/bluetooth-hid-agent.service
181
182 %files
183 %manifest %{name}.manifest
184 %license LICENSE
185 %defattr(-, root, root)
186
187 %files hfp_ag
188 %manifest %{name}.manifest
189 %license LICENSE
190 %{_bindir}/bluetooth-ag-agent
191 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
192 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
193 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
194 %{_unitdir}/bluetooth-ag-agent.service
195 #%exclude %{_unitdir}/bluetooth-map-agent.service
196 #%exclude %{_unitdir}/bluetooth-pbap-agent.service
197
198 %files hfp_hf
199 %manifest %{name}.manifest
200 %license LICENSE
201 %{_bindir}/bluetooth-hf-agent
202 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
203 %{_sysconfdir}/dbus-1/system.d/bluetooth-hf-agent.conf
204 %{_unitdir}/bluetooth-hf-agent.service
205 #%exclude %{_unitdir}/bluetooth-map-agent.service
206 #%exclude %{_unitdir}/bluetooth-pbap-agent.service
207
208 %files map
209 %manifest %{name}.manifest
210 %license LICENSE
211 %{_bindir}/bluetooth-map-agent
212 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
213 %{_unitdir}/bluetooth-map-agent.service
214 %{_sysconfdir}/dbus-1/system.d/bluetooth_map_agent.conf
215
216 %files pbap
217 %manifest %{name}.manifest
218 %license LICENSE
219 %{_bindir}/bluetooth-pb-agent
220 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
221 %{_unitdir}/bluetooth-pbap-agent.service
222 %{_sysconfdir}/dbus-1/system.d/bluetooth_pb_agent.conf
223
224 %files hid
225 %manifest %{name}.manifest
226 %license LICENSE
227 %{_bindir}/bluetooth-hid-agent
228 %{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service
229 %{_unitdir}/bluetooth-hid-agent.service
230 %{_sysconfdir}/dbus-1/system.d/bluetooth-hid-agent.conf
231
232 %files ipsp
233 %manifest %{name}.manifest
234 %license LICENSE
235 %{_bindir}/bluetooth-ipsp-agent
236 %{_datadir}/dbus-1/system-services/org.bluez.ipsp_agent.service
237 %{_sysconfdir}/dbus-1/system.d/bluetooth-ipsp-agent.conf
238
239 %if 0%{?gcov:1}
240 %files gcov
241 %manifest %{name}.manifest
242 %{_bindir}/gtest-bluetooth-agent
243 %{_libdir}/lib*
244 %{_datadir}/gcov/obj/*
245 %endif