9df8a2c926d307a961fe47d79984ff37d630c2a9
[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 # Build All (wearalbe/ivi/common/tv/mobile)
122 cmake . -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_FEATURE_BT_HFP_AG=1
123 make VERBOSE=1
124
125 %install
126 rm -rf %{buildroot}
127 %make_install
128
129 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service
130 # This usage of profile macro does NOT conflict 4.0 configurability.
131 #%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
132 # Original: wearable, ivi. Added: common, "undefined"
133 #mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
134 #mkdir -p %{buildroot}%{_bindir}/
135 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
136 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.projectx.bt_ipsp.service %{buildroot}%{_datadir}/dbus-1/system-services/
137 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
138 #install -D -m 0644 %{buildroot}/usr/bin/bt-ipsp %{buildroot}%{_bindir}/
139 #%endif
140 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
141
142 %post
143 %if 0%{?sec_product_feature_bt_map_server_enable}
144 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
145 %endif
146 ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
147
148 %files
149 %manifest %{name}.manifest
150 %license LICENSE
151 %defattr(-, root, root)
152
153 # This usage of profile macro does NOT conflict 4.0 configurability.
154 %if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
155 # Original: wearable, ivi. Added: common, "undefined"
156 %files profile_wearable
157 %license LICENSE
158 %{_bindir}/bluetooth-hf-agent
159 %{_bindir}/bluetooth-ag-agent
160 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
161 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
162 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
163 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
164 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
165 %endif
166
167 %files profile_ivi
168 %license LICENSE
169 %{_bindir}/bluetooth-hf-agent
170 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
171 %exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
172 %exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
173
174 # This usage of profile macro does NOT conflict 4.0 configurability.
175 %if "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
176 # Original: common, mobile, tv. Added: "undefined"
177 %files profile_common
178 %license LICENSE
179 %{_bindir}/bluetooth-ag-agent
180 %{_bindir}/bluetooth-map-agent
181 %{_bindir}/bluetooth-pb-agent
182 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
183 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
184 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
185 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
186 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
187 %{_libdir}/systemd/system/bluetooth-map-agent.service
188 %{_libdir}/systemd/system/bluetooth-pbap-agent.service
189 %endif
190
191 %files ipsp
192 %manifest %{name}.manifest
193 %license LICENSE
194 %defattr(-, root, root)
195 %{_datadir}/dbus-1/system-services/org.projectx.bt_ipsp.service
196 %{_bindir}/bt-ipsp
197 %{_sysconfdir}/dbus-1/system.d/bluetooth-frwk-ipsp.conf