Update AG and HF agent codes from wearable product
[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}" != "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(capi-system-device)
37 BuildRequires:  pkgconfig(dlog)
38 BuildRequires:  pkgconfig(vconf)
39 BuildRequires:  pkgconfig(syspopup-caller)
40 BuildRequires:  pkgconfig(capi-network-bluetooth)
41 BuildRequires:  pkgconfig(appsvc)
42 BuildRequires:  pkgconfig(capi-appfw-application)
43 BuildRequires:  pkgconfig(capi-network-connection)
44 BuildRequires:  pkgconfig(capi-network-bluetooth)
45 BuildRequires:  pkgconfig(capi-media-image-util)
46 BuildRequires:  pkgconfig(contacts-service2)
47 BuildRequires:  pkgconfig(libexif)
48 BuildRequires:  pkgconfig(gio-2.0)
49 BuildRequires:  cmake
50 Requires: security-config
51 Requires:       %{name}-compat = %{version}-%{release}
52 Recommends:     %{name}-profile_common = %{version}-%{release}
53
54 %description
55 Bluetooth agent packages that support various external profiles
56
57 %package profile_common
58 Summary:        Bluetooth agent for common/tv/mobile
59 Provides:       %{name}-compat = %{version}-%{release}
60 Provides:       %{name}-profile_mobile = %{version}-%{release}
61 Provides:       %{name}-profile_tv = %{version}-%{release}
62 Conflicts:      %{name}-profile_ivi
63 Conflicts:      %{name}-profile_wearable
64 %description profile_common
65 Bluetooth agent binary compiled for common, tv, mobile profiles
66
67 %package profile_ivi
68 Summary:        Bluetooth agent for ivi
69 Provides:       %{name}-compat = %{version}-%{release}
70 Conflicts:      %{name}-profile_common
71 Conflicts:      %{name}-profile_wearable
72 %description profile_ivi
73 Bluetooth agent binary compiled for ivi profile
74
75 %package profile_wearable
76 Summary:        Bluetooth agent for wearable
77 Provides:       %{name}-compat = %{version}-%{release}
78 Conflicts:      %{name}-profile_common
79 Conflicts:      %{name}-profile_ivi
80 %description profile_wearable
81 Bluetooth agent binary compiled for wearable profile
82
83 %package ipsp
84 Summary:    Bluetooth Ipsp daemon
85 Group:      Network & Connectivity/Bluetooth
86 Requires:   %{name} = %{version}-%{release}
87
88 %description ipsp
89 This package is Bluetooth ipsp daemon to manage activation / deactivation.
90
91 %prep
92 %setup -q
93 cp %{SOURCE1001} .
94
95 %build
96 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
97 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
98 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
99
100 #export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_MEDIA_ENHANCE"
101 #export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_DUAL_HF"
102
103 %ifarch aarch64
104 echo arch64
105 export CFLAGS+=" -DARCH64"
106 export CXXFLAGS+=" -DARCH64"
107 export FFLAGS+=" -DARCH64"
108 %endif
109
110 %ifarch x86_64
111 echo x86_64
112 export CFLAGS+=" -DARCH64"
113 export CXXFLAGS+=" -DARCH64"
114 export FFLAGS+=" -DARCH64"
115 %endif
116
117 export CFLAGS+=" -fpie -DTIZEN_FEATURE_BT_PBAP_SIM -fvisibility=hidden "
118 export CXXFLAGS+=" -fpie -DTIZEN_FEATURE_BT_PBAP_SIM -fvisibility=hidden "
119
120 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
121
122 export CFLAGS_DEFAULT="$CFLAGS"
123
124 # Build All (wearalbe/ivi/common/tv/mobile)
125 cmake . -DCMAKE_INSTALL_PREFIX=/usr
126 make VERBOSE=1
127
128 %install
129 rm -rf %{buildroot}
130 %make_install
131
132 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service
133 # This usage of profile macro does NOT conflict 4.0 configurability.
134 #%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
135 # Original: wearable, ivi. Added: common, "undefined"
136 #mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
137 #mkdir -p %{buildroot}%{_bindir}/
138 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
139 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
140 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
141 #install -D -m 0644 %{buildroot}/usr/bin/bt-ipsp %{buildroot}%{_bindir}/
142 #%endif
143 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
144
145 %post
146 %if 0%{?sec_product_feature_bt_map_server_enable}
147 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
148 %endif
149 ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
150
151 %files
152 %manifest %{name}.manifest
153 %license LICENSE
154 %defattr(-, root, root)
155
156 # This usage of profile macro does NOT conflict 4.0 configurability.
157 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
158 # Original: wearable, ivi. Added: common, "undefined"
159 %files profile_wearable
160 %license LICENSE
161 %{_bindir}/bluetooth-hf-agent
162 %{_bindir}/bluetooth-ag-agent
163 %{_bindir}/bluetooth-hid-agent
164 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
165 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
166 %{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service
167 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
168 %{_sysconfdir}/dbus-1/system.d/bluetooth-hf-agent.conf
169 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
170 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
171 %endif
172
173 %files profile_ivi
174 %license LICENSE
175 %{_bindir}/bluetooth-hf-agent
176 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
177 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
178 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
179
180 # This usage of profile macro does NOT conflict 4.0 configurability.
181 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
182 # Original: common, mobile, tv. Added: "undefined"
183 %files profile_common
184 %license LICENSE
185 %{_bindir}/bluetooth-ag-agent
186 %{_bindir}/bluetooth-map-agent
187 %{_bindir}/bluetooth-pb-agent
188 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
189 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
190 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
191 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
192 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
193 %{_libdir}/systemd/system/bluetooth-map-agent.service
194 %{_libdir}/systemd/system/bluetooth-pbap-agent.service
195 %endif
196
197 %files ipsp
198 %manifest %{name}.manifest
199 %license LICENSE
200 %defattr(-, root, root)
201 %{_datadir}/dbus-1/system-services/org.projectx.bt_ipsp.service
202 %{_bindir}/bt-ipsp
203 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-ipsp.conf