Refactory the packages for each functionality
[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 #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 hfp_ag
55 Summary:        Bluetooth agent for HFP(Hands-Free Profile)'s AG(Audio Gate) role
56 Requires:   %{name} = %{version}-%{release}
57 Group:      Network & Connectivity/Bluetooth
58 %description hfp_ag
59 Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s AG(Audio Gate) role
60
61 %package hfp_hf
62 Summary:        Bluetooth agent for HFP(Hands-Free Profile)'s HF(Hands-Free) role
63 Requires:   %{name} = %{version}-%{release}
64 Group:      Network & Connectivity/Bluetooth
65 %description hfp_hf
66 Bluetooth agent binary compiled for HFP(Hands-Free Profile)'s HF(Hands-Free) role
67
68 %package map
69 Summary:        Bluetooth agent for MAP(Message Access Profile) server
70 Requires:   %{name} = %{version}-%{release}
71 Group:      Network & Connectivity/Bluetooth
72 %description map
73 Bluetooth agent binary compiled for MAP(Message Access Profile) server
74
75 %package pbap
76 Summary:        Bluetooth agent for PBAP(PhoneBook Access Profile) server
77 Requires:   %{name} = %{version}-%{release}
78 Group:      Network & Connectivity/Bluetooth
79 %description pbap
80 Bluetooth agent binary compiled for PBAP(PhoneBook Access Profile) server
81
82 %package hid
83 Summary:        Bluetooth agent for HID(Human Interface Device)'s device role
84 Requires:   %{name} = %{version}-%{release}
85 Group:      Network & Connectivity/Bluetooth
86 %description hid
87 Bluetooth agent binary compiled for HID(Human Interface Device)'s device role
88
89 %package ipsp
90 Summary:        Bluetooth agent for IPSP(Internet Protocol Support Profile)
91 Requires:   %{name} = %{version}-%{release}
92 Group:      Network & Connectivity/Bluetooth
93 %description ipsp
94 Bluetooth agent binary compiled for IPSP(Internet Protocol Support Profile)
95
96 %prep
97 %setup -q
98 cp %{SOURCE1001} .
99
100 %build
101 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
102 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
103 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
104 #export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_MEDIA_ENHANCE"
105 export CFLAGS="$CFLAGS -DTIZEN_FEATURE_BT_HFP_AG"
106 export CFLAGS="$CFLAGS -DTIZEN_SUPPORT_DUAL_HF"
107
108 %ifarch aarch64
109 echo arch64
110 export CFLAGS+=" -DARCH64"
111 export CXXFLAGS+=" -DARCH64"
112 export FFLAGS+=" -DARCH64"
113 %endif
114
115 %ifarch x86_64
116 echo x86_64
117 export CFLAGS+=" -DARCH64"
118 export CXXFLAGS+=" -DARCH64"
119 export FFLAGS+=" -DARCH64"
120 %endif
121
122 export CFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
123 export CXXFLAGS+=" -fpie -DTIZEN_FEATURE_BP_PBAP_SIM -fvisibility=hidden "
124
125 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
126
127 export CFLAGS_DEFAULT="$CFLAGS"
128
129 # Build All (wearalbe/ivi/common/tv/mobile)
130 cmake . -DCMAKE_INSTALL_PREFIX=/usr -DTIZEN_FEATURE_BT_HFP_AG=1
131 make VERBOSE=1
132
133 %install
134 rm -rf %{buildroot}
135 %make_install
136
137 install -D -m 0644 packaging/bluetooth-map-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-map-agent.service
138 # This usage of profile macro does NOT conflict 4.0 configurability.
139 #%if "%{?profile}" != "mobile" && "%{?profile}" != "tv"
140 # Original: wearable, ivi. Added: common, "undefined"
141 #mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services
142 #mkdir -p %{buildroot}%{_bindir}/
143 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.hf_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
144 #install -D -m 0644 %{buildroot}/usr/share/dbus-1/system-services/org.bluez.ipsp_agent.service %{buildroot}%{_datadir}/dbus-1/system-services/
145 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-hf-agent %{buildroot}%{_bindir}/
146 #install -D -m 0644 %{buildroot}/usr/bin/bluetooth-ipsp-agent %{buildroot}%{_bindir}/
147 #%endif
148 install -D -m 0644 packaging/bluetooth-pbap-agent.service %{buildroot}%{_libdir}/systemd/system/bluetooth-pbap-agent.service
149
150 %post
151 %if 0%{?sec_product_feature_bt_map_server_enable}
152 ln -sf %{_libdir}/systemd/user/bluetooth-map-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
153 %endif
154 ln -sf %{_libdir}/systemd/system/bluetooth-pbap-agent.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
155
156 %files
157 %manifest %{name}.manifest
158 %license LICENSE
159 %defattr(-, root, root)
160
161 %files hfp_ag
162 %manifest %{name}.manifest
163 %license LICENSE
164 %{_bindir}/bluetooth-ag-agent
165 %attr(0666,-,-) /var/lib/bluetooth/voice-recognition-blacklist
166 %{_datadir}/dbus-1/system-services/org.bluez.ag_agent.service
167 %{_sysconfdir}/dbus-1/system.d/bluetooth-ag-agent.conf
168 #%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
169 #%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
170
171 %files hfp_hf
172 %manifest %{name}.manifest
173 %license LICENSE
174 %{_bindir}/bluetooth-hf-agent
175 %{_datadir}/dbus-1/system-services/org.bluez.hf_agent.service
176 %{_sysconfdir}/dbus-1/system.d/bluetooth-hf-agent.conf
177 #%exclude %{_libdir}/systemd/system/bluetooth-map-agent.service
178 #%exclude %{_libdir}/systemd/system/bluetooth-pbap-agent.service
179
180 %files map
181 %manifest %{name}.manifest
182 %license LICENSE
183 %{_bindir}/bluetooth-map-agent
184 %{_datadir}/dbus-1/system-services/org.bluez.map_agent.service
185 %{_libdir}/systemd/system/bluetooth-map-agent.service
186
187 %files pbap
188 %manifest %{name}.manifest
189 %license LICENSE
190 %{_bindir}/bluetooth-pb-agent
191 %{_datadir}/dbus-1/system-services/org.bluez.pb_agent.service
192 %{_libdir}/systemd/system/bluetooth-pbap-agent.service
193
194 %files hid
195 %manifest %{name}.manifest
196 %license LICENSE
197 %{_bindir}/bluetooth-hid-agent
198 %{_datadir}/dbus-1/system-services/org.bluez.hid_agent.service
199
200 %files ipsp
201 %manifest %{name}.manifest
202 %license LICENSE
203 %{_bindir}/bluetooth-ipsp-agent
204 %{_datadir}/dbus-1/system-services/org.bluez.ipsp_agent.service
205 %{_sysconfdir}/dbus-1/system.d/bluetooth-ipsp-agent.conf
206