37deca81c6ec4b6f75db178d9d20da779e7c2a5f
[platform/core/connectivity/bluetooth-tools.git] / packaging / bluetooth-tools.spec
1 Name:       bluetooth-tools
2 Summary:    Bluetooth-tools
3 Version:    0.2.37
4 Release:    0
5 Group:      Network & Connectivity/Bluetooth
6 License:    Apache-2.0
7 Source0:    %{name}-%{version}.tar.gz
8 #Source1001: bluetooth-address.service
9 BuildRequires:  cmake
10 Suggests:       bluetooth-share
11 Requires:       tizen-platform-config-tools
12 Requires:      bluetooth-scripts
13 Requires:   %{name}-compat = %{version}-%{release}
14 Recommends:   %{name}-profile_common = %{version}-%{release}
15
16 %description
17 Tools fo bluetooth run/stop and set address
18
19 %package profile_common
20 Summary:    Bluetooth-tools extension for common/tv
21 Provides:   %{name}-compat = %{version}-%{release}
22 Provides:   %{name}-profile_tv = %{version}-%{release}
23 Conflicts:  %{name}-profile_mobile = %{version}-%{release}
24 Conflicts:  %{name}-profile_wearable = %{version}-%{release}
25 Conflicts:  %{name}-profile_ivi = %{version}-%{release}
26 %description profile_common
27 Bluetooth-tools extension for Tizen common / tv profile.
28
29 %package profile_mobile
30 Summary:    Bluetooth-tools extension for mobile/tv
31 Provides:   %{name}-compat = %{version}-%{release}
32 Conflicts:  %{name}-profile_common = %{version}-%{release}
33 Conflicts:  %{name}-profile_wearable = %{version}-%{release}
34 Conflicts:  %{name}-profile_ivi = %{version}-%{release}
35 %description profile_mobile
36 Bluetooth-tools extension for Tizen mobile profile.
37
38 %package profile_wearable
39 Summary:    Bluetooth-tools extension for wearable/tv
40 Provides:   %{name}-compat = %{version}-%{release}
41 Conflicts:  %{name}-profile_common = %{version}-%{release}
42 Conflicts:  %{name}-profile_mobile = %{version}-%{release}
43 Conflicts:  %{name}-profile_ivi = %{version}-%{release}
44 %description profile_wearable
45 Bluetooth-tools extension for Tizen wearable profile.
46
47 %package profile_ivi
48 Summary:    Bluetooth-tools extension for ivi/tv
49 Provides:   %{name}-compat = %{version}-%{release}
50 Conflicts:  %{name}-profile_common = %{version}-%{release}
51 Conflicts:  %{name}-profile_mobile = %{version}-%{release}
52 Conflicts:  %{name}-profile_wearable = %{version}-%{release}
53 %description profile_ivi
54 Bluetooth-tools extension for Tizen ivi profile.
55
56 %package no-firmware
57 Summary:    On/Off Bluetooth adapter
58 Group:      Network & Connectivity/Bluetooth
59 Requires:   %{name} = %{version}-%{release}
60 Requires:   rfkill
61 Provides:   bluetooth-scripts
62 Conflicts:  bluetooth-firmware-bcm
63
64 %description no-firmware
65 On/Off bluetooth device
66
67 %prep
68 %setup -q
69
70 %build
71 export CFLAGS+=" -fpie -fvisibility=hidden"
72 export CXXFLAGS+=" -fpie -fvisibility=hidden"
73 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
74
75 %cmake
76 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
77 %if 0%{?tizen_build_binary_release_type_eng}
78         -DBT_HCI_LOG_SIZE=10
79 %else
80         -DBT_HCI_LOG_SIZE=5
81 %endif
82
83 %__make %{?_smp_mflags}
84
85 %install
86 rm -rf %{buildroot}
87 %make_install
88
89 mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
90 mkdir -p %{buildroot}/run/bluetooth
91 install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
92 install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
93
94 install -D -m 0644 packaging/bluetooth-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger.service
95 install -D -m 0644 packaging/bluetooth-hci-logger.path %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger.path
96
97 install -D -m 0644 packaging/bluetooth-hci-logger-stop.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger-stop.service
98 install -D -m 0644 packaging/bluetooth-hci-logger-stop.path %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger-stop.path
99
100 install -D -m 0644 packaging/bluez-start.service %{buildroot}%{_libdir}/systemd/system/bluez-start.service
101 install -D -m 0644 packaging/bluez-start.path %{buildroot}%{_libdir}/systemd/system/bluez-start.path
102
103 install -D -m 0644 packaging/bluetooth-stack-up.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-up.service
104 install -D -m 0644 packaging/bluetooth-stack-up.path %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-up.path
105
106 install -D -m 0644 packaging/bluetooth-stack-down.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down.service
107 install -D -m 0644 packaging/bluetooth-stack-down.path %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down.path
108
109 install -D -m 0644 packaging/bluetooth-stack-down-with-radio.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down-with-radio.service
110 install -D -m 0644 packaging/bluetooth-stack-down-with-radio.path %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down-with-radio.path
111
112 install -D -m 0644 packaging/bluetooth-force-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-force-hci-logger.service
113 install -D -m 0644 packaging/bluetooth-hci-dump@.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-dump@.service
114
115 install -D -m 0644 packaging/bluetooth-hci-up.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-up.service
116 install -D -m 0644 packaging/bluetooth-hci-up.path %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-up.path
117 install -D -m 0644 packaging/bluetooth-hci-down.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-down.service
118 install -D -m 0644 packaging/bluetooth-hci-down.path %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-down.path
119
120 %post
121 mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
122 mkdir -p %{_libdir}/systemd/system/multi-user.target.wants/
123 ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
124 ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hci-logger.path
125 ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
126
127 ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger-stop.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
128 ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger-stop.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hci-logger-stop.path
129 ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger-stop.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
130
131 ln -sf %{_libdir}/systemd/system/bluez-start.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
132 ln -sf %{_libdir}/systemd/system/bluez-start.path %{_libdir}/systemd/system/multi-user.target.wants/bluez-start.path
133 ln -sf %{_libdir}/systemd/system/bluez-start.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
134
135 ln -sf %{_libdir}/systemd/system/bluetooth-stack-up.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
136 ln -sf %{_libdir}/systemd/system/bluetooth-stack-up.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-stack-up.path
137 ln -sf %{_libdir}/systemd/system/bluetooth-stack-up.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
138
139 ln -sf %{_libdir}/systemd/system/bluetooth-stack-down.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
140 ln -sf %{_libdir}/systemd/system/bluetooth-stack-down.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-stack-down.path
141 ln -sf %{_libdir}/systemd/system/bluetooth-stack-down.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
142
143 ln -sf %{_libdir}/systemd/system/bluetooth-force-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
144 ln -sf %{_libdir}/systemd/system/bluetooth-hci-up.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
145 ln -sf %{_libdir}/systemd/system/bluetooth-hci-up.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hci-up.path
146 ln -sf %{_libdir}/systemd/system/bluetooth-hci-up.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
147 ln -sf %{_libdir}/systemd/system/bluetooth-hci-down.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
148 ln -sf %{_libdir}/systemd/system/bluetooth-hci-down.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hci-down.path
149 ln -sf %{_libdir}/systemd/system/bluetooth-hci-down.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
150
151
152 %files
153 %manifest %{name}.manifest
154 %license LICENSE.APLv2
155 %defattr(-,root,root,-)
156 #%exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
157 #%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
158 #%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
159 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
160 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
161 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
162 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
163 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh
164 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hci-logger.sh
165 #%{_unitdir}/multi-user.target.wants/bluetooth-address.service
166 #%{_unitdir}/bluetooth-address.service
167 %{_libdir}/systemd/system/bluetooth-hci-logger.service
168 %{_libdir}/systemd/system/bluetooth-hci-logger.path
169 %{_libdir}/systemd/system/bluetooth-hci-logger-stop.service
170 %{_libdir}/systemd/system/bluetooth-hci-logger-stop.path
171 %{_libdir}/systemd/system/bluez-start.service
172 %{_libdir}/systemd/system/bluez-start.path
173 %{_libdir}/systemd/system/bluetooth-force-hci-logger.service
174 %{_libdir}/systemd/system/bluetooth-hci-dump@.service
175 %{_libdir}/systemd/system/bluetooth-stack-up.service
176 %{_libdir}/systemd/system/bluetooth-stack-up.path
177 %{_libdir}/systemd/system/bluetooth-stack-down.service
178 %{_libdir}/systemd/system/bluetooth-stack-down.path
179 %{_libdir}/systemd/system/bluetooth-hci-up.service
180 %{_libdir}/systemd/system/bluetooth-hci-up.path
181 %{_libdir}/systemd/system/bluetooth-hci-down.service
182 %{_libdir}/systemd/system/bluetooth-hci-down.path
183
184 %post profile_common
185 pushd %{_prefix}/etc/bluetooth/
186 ln -sf common/bt-stack-up.sh bt-stack-up.sh
187 ln -sf common/bt-stack-down.sh bt-stack-down.sh
188 ln -sf common/bt-reset-env.sh bt-reset-env.sh
189 popd
190 %preun profile_common
191 pushd %{_prefix}/etc/bluetooth/
192 rm bt-stack-up.sh
193 rm bt-stack-down.sh
194 rm bt-reset-env.sh
195 popd
196 %files profile_common
197 %license LICENSE.APLv2
198 #%{_sysconfdir}/rc.d/init.d/bluetooth-address
199 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-up.sh
200 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-down.sh
201 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-reset-env.sh
202
203 %post profile_mobile
204 pushd %{_prefix}/etc/bluetooth/
205 ln -sf mobile/bt-stack-up.sh bt-stack-up.sh
206 ln -sf mobile/bt-stack-down.sh bt-stack-down.sh
207 ln -sf mobile/bt-stack-down-with-radio.sh bt-stack-down-with-radio.sh
208 ln -sf mobile/bt-reset-env.sh bt-reset-env.sh
209 ln -sf %{_libdir}/systemd/system/bluetooth-stack-down-with-radio.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
210 ln -sf %{_libdir}/systemd/system/bluetooth-stack-down-with-radio.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-stack-down-with-radio.path
211 ln -sf %{_libdir}/systemd/system/bluetooth-stack-down-with-radio.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
212 popd
213 %preun profile_mobile
214 pushd %{_prefix}/etc/bluetooth/
215 rm bt-stack-up.sh
216 rm bt-stack-down.sh
217 rm bt-stack-down-with-radio.sh
218 rm bt-reset-env.sh
219 popd
220 %files profile_mobile
221 %license LICENSE.APLv2
222 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-up.sh
223 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down.sh
224 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-reset-env.sh
225 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down-with-radio.sh
226 %{_libdir}/systemd/system/bluetooth-stack-down-with-radio.service
227 %{_libdir}/systemd/system/bluetooth-stack-down-with-radio.path
228
229 %post profile_ivi
230 pushd %{_prefix}/etc/bluetooth/
231 ln -sf ivi/bt-stack-up.sh bt-stack-up.sh
232 ln -sf ivi/bt-stack-down.sh bt-stack-down.sh
233 ln -sf ivi/bt-reset-env.sh bt-reset-env.sh
234 popd
235 %preun profile_ivi
236 pushd %{_prefix}/etc/bluetooth/
237 rm bt-stack-up.sh
238 rm bt-stack-down.sh
239 rm bt-reset-env.sh
240 popd
241 %files profile_ivi
242 %license LICENSE.APLv2
243 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-up.sh
244 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-down.sh
245 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-reset-env.sh
246
247 %post profile_wearable
248 pushd %{_prefix}/etc/bluetooth/
249 ln -sf wearable/bt-stack-up.sh bt-stack-up.sh
250 ln -sf wearable/bt-stack-down.sh bt-stack-down.sh
251 ln -sf wearable/bt-reset-env.sh bt-reset-env.sh
252 popd
253 %preun profile_wearable
254 pushd %{_prefix}/etc/bluetooth/
255 rm bt-stack-up.sh
256 rm bt-stack-down.sh
257 rm bt-reset-env.sh
258 popd
259 %files profile_wearable
260 %license LICENSE.APLv2
261 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-up.sh
262 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-down.sh
263 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-reset-env.sh
264
265 %files no-firmware
266 %manifest %{name}.manifest
267 %license LICENSE.APLv2
268 %defattr(-, root, root)
269 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
270 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh