Fix HCI logger service's option to launch btmon
[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/bluez-start.service %{buildroot}%{_libdir}/systemd/system/bluez-start.service
95
96 install -D -m 0644 packaging/bluetooth-stack-up.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-up.service
97
98 install -D -m 0644 packaging/bluetooth-stack-down.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down.service
99
100 install -D -m 0644 packaging/bluetooth-stack-down-with-radio.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down-with-radio.service
101
102 #install -D -m 0644 packaging/bluetooth-force-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-force-hci-logger.service
103 #install -D -m 0644 packaging/bluetooth-hci-dump@.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-dump@.service
104
105 install -D -m 0644 packaging/bluetooth-hci-up.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-up.service
106 install -D -m 0644 packaging/bluetooth-hci-down.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-down.service
107
108 install -D -m 0644 packaging/bluetooth-stack-up-common.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-up-common.service
109 install -D -m 0644 packaging/bluetooth-stack-down-common.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down-common.service
110
111 %post
112 mkdir -p %{_libdir}/systemd/system/multi-user.target.wants/
113
114 %files
115 %manifest %{name}.manifest
116 %license LICENSE.APLv2
117 %defattr(-,root,root,-)
118 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
119 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
120 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
121 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
122
123 %post profile_common
124 pushd %{_prefix}/etc/bluetooth/
125 ln -sf common/bt-stack-up.sh bt-stack-up.sh
126 ln -sf common/bt-stack-down.sh bt-stack-down.sh
127 ln -sf common/bt-reset-env.sh bt-reset-env.sh
128 popd
129 pushd %{_unitdir}
130 mv bluetooth-stack-up-common.service bluetooth-stack-up.service
131 mv bluetooth-stack-down-common.service bluetooth-stack-down.service
132 popd
133 %preun profile_common
134 pushd %{_prefix}/etc/bluetooth/
135 rm bt-stack-up.sh
136 rm bt-stack-down.sh
137 rm bt-reset-env.sh
138 popd
139 pushd %{_unitdir}
140 rm bluetooth-stack-up.service
141 rm bluetooth-stack-down.service
142 popd
143 %files profile_common
144 %license LICENSE.APLv2
145 #%{_sysconfdir}/rc.d/init.d/bluetooth-address
146 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-up.sh
147 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-down.sh
148 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-reset-env.sh
149 %{_libdir}/systemd/system/bluetooth-stack-up-common.service
150 %{_libdir}/systemd/system/bluetooth-stack-down-common.service
151 %{_libdir}/systemd/system/bluez-start.service
152 %{_libdir}/systemd/system/bluetooth-hci-up.service
153 %{_libdir}/systemd/system/bluetooth-hci-down.service
154
155 %post profile_mobile
156 pushd %{_prefix}/etc/bluetooth/
157 ln -sf mobile/bt-stack-up.sh bt-stack-up.sh
158 ln -sf mobile/bt-stack-down.sh bt-stack-down.sh
159 ln -sf mobile/bt-stack-down-with-radio.sh bt-stack-down-with-radio.sh
160 ln -sf mobile/bt-reset-env.sh bt-reset-env.sh
161 popd
162 %preun profile_mobile
163 pushd %{_prefix}/etc/bluetooth/
164 rm bt-stack-up.sh
165 rm bt-stack-down.sh
166 rm bt-stack-down-with-radio.sh
167 rm bt-reset-env.sh
168 popd
169 %files profile_mobile
170 %license LICENSE.APLv2
171 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-up.sh
172 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down.sh
173 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-reset-env.sh
174 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down-with-radio.sh
175 %{_libdir}/systemd/system/bluetooth-stack-down-with-radio.service
176 %{_libdir}/systemd/system/bluez-start.service
177 %{_libdir}/systemd/system/bluetooth-stack-up.service
178 %{_libdir}/systemd/system/bluetooth-stack-down.service
179 %{_libdir}/systemd/system/bluetooth-hci-up.service
180 %{_libdir}/systemd/system/bluetooth-hci-down.service
181
182 %post profile_ivi
183 pushd %{_prefix}/etc/bluetooth/
184 ln -sf ivi/bt-stack-up.sh bt-stack-up.sh
185 ln -sf ivi/bt-stack-down.sh bt-stack-down.sh
186 ln -sf ivi/bt-reset-env.sh bt-reset-env.sh
187 popd
188 %preun profile_ivi
189 pushd %{_prefix}/etc/bluetooth/
190 rm bt-stack-up.sh
191 rm bt-stack-down.sh
192 rm bt-reset-env.sh
193 popd
194 %files profile_ivi
195 %license LICENSE.APLv2
196 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-up.sh
197 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-down.sh
198 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-reset-env.sh
199 %{_libdir}/systemd/system/bluez-start.service
200 %{_libdir}/systemd/system/bluetooth-stack-up.service
201 %{_libdir}/systemd/system/bluetooth-stack-down.service
202 %{_libdir}/systemd/system/bluetooth-hci-up.service
203 %{_libdir}/systemd/system/bluetooth-hci-down.service
204
205 %post profile_wearable
206 pushd %{_prefix}/etc/bluetooth/
207 ln -sf wearable/bt-stack-up.sh bt-stack-up.sh
208 ln -sf wearable/bt-stack-down.sh bt-stack-down.sh
209 ln -sf wearable/bt-reset-env.sh bt-reset-env.sh
210 popd
211 %preun profile_wearable
212 pushd %{_prefix}/etc/bluetooth/
213 rm bt-stack-up.sh
214 rm bt-stack-down.sh
215 rm bt-reset-env.sh
216 popd
217 %files profile_wearable
218 %license LICENSE.APLv2
219 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-up.sh
220 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-down.sh
221 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-reset-env.sh
222 %{_libdir}/systemd/system/bluez-start.service
223 %{_libdir}/systemd/system/bluetooth-stack-up.service
224 %{_libdir}/systemd/system/bluetooth-stack-down.service
225 %{_libdir}/systemd/system/bluetooth-hci-up.service
226 %{_libdir}/systemd/system/bluetooth-hci-down.service
227
228 %files no-firmware
229 %manifest %{name}.manifest
230 %license LICENSE.APLv2
231 %defattr(-, root, root)
232 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
233 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh
234 %{_libdir}/systemd/system/bluez-start.service
235 %{_libdir}/systemd/system/bluetooth-stack-up.service
236 %{_libdir}/systemd/system/bluetooth-stack-down.service
237 %{_libdir}/systemd/system/bluetooth-hci-up.service
238 %{_libdir}/systemd/system/bluetooth-hci-down.service
239