Modify the package version
[platform/core/connectivity/bluetooth-tools.git] / packaging / bluetooth-tools.spec
1 Name:       bluetooth-tools
2 Summary:    Bluetooth-tools
3 Version:    0.6.0
4 Release:    1
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 Provides:   bluetooth-scripts
61 Conflicts:  bluetooth-firmware-bcm
62
63 %description no-firmware
64 On/Off bluetooth device
65
66 %prep
67 %setup -q
68
69 %build
70 export CFLAGS+=" -fpie -fvisibility=hidden"
71 export CXXFLAGS+=" -fpie -fvisibility=hidden"
72 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
73
74 %cmake
75 %cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
76 %if 0%{?tizen_build_binary_release_type_eng}
77         -DBT_HCI_LOG_SIZE=10
78 %else
79         -DBT_HCI_LOG_SIZE=5
80 %endif
81
82 %__make %{?_smp_mflags}
83
84 %install
85 rm -rf %{buildroot}
86 %make_install
87
88 mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
89 mkdir -p %{buildroot}/run/bluetooth
90 install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
91 install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
92
93 install -D -m 0644 packaging/bluez-start.service %{buildroot}%{_unitdir}/bluez-start.service
94
95 install -D -m 0644 packaging/bluetooth-stack-up.service %{buildroot}%{_unitdir}/bluetooth-stack-up.service
96
97 install -D -m 0644 packaging/bluetooth-stack-down.service %{buildroot}%{_unitdir}/bluetooth-stack-down.service
98
99 install -D -m 0644 packaging/bluetooth-stack-down-with-radio.service %{buildroot}%{_unitdir}/bluetooth-stack-down-with-radio.service
100
101 #install -D -m 0644 packaging/bluetooth-force-hci-logger.service %{buildroot}%{_unitdir}/bluetooth-force-hci-logger.service
102 #install -D -m 0644 packaging/bluetooth-hci-dump@.service %{buildroot}%{_unitdir}/bluetooth-hci-dump@.service
103
104 install -D -m 0644 packaging/bluetooth-hci-up.service %{buildroot}%{_unitdir}/bluetooth-hci-up.service
105 install -D -m 0644 packaging/bluetooth-hci-down.service %{buildroot}%{_unitdir}/bluetooth-hci-down.service
106
107 install -D -m 0644 packaging/bluetooth-stack-up-common.service %{buildroot}%{_unitdir}/bluetooth-stack-up-common.service
108 install -D -m 0644 packaging/bluetooth-stack-down-common.service %{buildroot}%{_unitdir}/bluetooth-stack-down-common.service
109
110 %post
111 mkdir -p %{_unitdir}/multi-user.target.wants/
112
113 %files
114 %manifest %{name}.manifest
115 %license LICENSE.APLv2
116 %defattr(-,root,root,-)
117 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
118 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
119 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
120 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
121
122 %post profile_common
123 pushd %{_prefix}/etc/bluetooth/
124 ln -sf common/bt-stack-up.sh bt-stack-up.sh
125 ln -sf common/bt-stack-down.sh bt-stack-down.sh
126 ln -sf common/bt-reset-env.sh bt-reset-env.sh
127 popd
128 pushd %{_unitdir}
129 mv bluetooth-stack-up-common.service bluetooth-stack-up.service
130 mv bluetooth-stack-down-common.service bluetooth-stack-down.service
131 popd
132 %preun profile_common
133 pushd %{_prefix}/etc/bluetooth/
134 rm bt-stack-up.sh
135 rm bt-stack-down.sh
136 rm bt-reset-env.sh
137 popd
138 pushd %{_unitdir}
139 rm bluetooth-stack-up.service
140 rm bluetooth-stack-down.service
141 popd
142 %files profile_common
143 %license LICENSE.APLv2
144 #%{_sysconfdir}/rc.d/init.d/bluetooth-address
145 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-up.sh
146 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-down.sh
147 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-reset-env.sh
148 %{_unitdir}/bluetooth-stack-up-common.service
149 %{_unitdir}/bluetooth-stack-down-common.service
150 %{_unitdir}/bluez-start.service
151 %{_unitdir}/bluetooth-hci-up.service
152 %{_unitdir}/bluetooth-hci-down.service
153
154 %post profile_mobile
155 pushd %{_prefix}/etc/bluetooth/
156 ln -sf mobile/bt-stack-up.sh bt-stack-up.sh
157 ln -sf mobile/bt-stack-down.sh bt-stack-down.sh
158 ln -sf mobile/bt-stack-down-with-radio.sh bt-stack-down-with-radio.sh
159 ln -sf mobile/bt-reset-env.sh bt-reset-env.sh
160 popd
161 %preun profile_mobile
162 pushd %{_prefix}/etc/bluetooth/
163 rm bt-stack-up.sh
164 rm bt-stack-down.sh
165 rm bt-stack-down-with-radio.sh
166 rm bt-reset-env.sh
167 popd
168 %files profile_mobile
169 %license LICENSE.APLv2
170 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-up.sh
171 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down.sh
172 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-reset-env.sh
173 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down-with-radio.sh
174 %{_unitdir}/bluetooth-stack-down-with-radio.service
175 %{_unitdir}/bluez-start.service
176 %{_unitdir}/bluetooth-stack-up.service
177 %{_unitdir}/bluetooth-stack-down.service
178 %{_unitdir}/bluetooth-hci-up.service
179 %{_unitdir}/bluetooth-hci-down.service
180
181 %post profile_ivi
182 pushd %{_prefix}/etc/bluetooth/
183 ln -sf ivi/bt-stack-up.sh bt-stack-up.sh
184 ln -sf ivi/bt-stack-down.sh bt-stack-down.sh
185 ln -sf ivi/bt-reset-env.sh bt-reset-env.sh
186 popd
187 %preun profile_ivi
188 pushd %{_prefix}/etc/bluetooth/
189 rm bt-stack-up.sh
190 rm bt-stack-down.sh
191 rm bt-reset-env.sh
192 popd
193 %files profile_ivi
194 %license LICENSE.APLv2
195 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-up.sh
196 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-down.sh
197 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-reset-env.sh
198 %{_unitdir}/bluez-start.service
199 %{_unitdir}/bluetooth-stack-up.service
200 %{_unitdir}/bluetooth-stack-down.service
201 %{_unitdir}/bluetooth-hci-up.service
202 %{_unitdir}/bluetooth-hci-down.service
203
204 %post profile_wearable
205 pushd %{_prefix}/etc/bluetooth/
206 ln -sf wearable/bt-stack-up.sh bt-stack-up.sh
207 ln -sf wearable/bt-stack-down.sh bt-stack-down.sh
208 ln -sf wearable/bt-reset-env.sh bt-reset-env.sh
209 popd
210 %preun profile_wearable
211 pushd %{_prefix}/etc/bluetooth/
212 rm bt-stack-up.sh
213 rm bt-stack-down.sh
214 rm bt-reset-env.sh
215 popd
216 %files profile_wearable
217 %license LICENSE.APLv2
218 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-up.sh
219 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-down.sh
220 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-reset-env.sh
221 %{_unitdir}/bluez-start.service
222 %{_unitdir}/bluetooth-stack-up.service
223 %{_unitdir}/bluetooth-stack-down.service
224 %{_unitdir}/bluetooth-hci-up.service
225 %{_unitdir}/bluetooth-hci-down.service
226
227 %files no-firmware
228 %manifest %{name}.manifest
229 %license LICENSE.APLv2
230 %defattr(-, root, root)
231 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
232 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh
233 %{_unitdir}/bluez-start.service
234 %{_unitdir}/bluetooth-stack-up.service
235 %{_unitdir}/bluetooth-stack-down.service
236 %{_unitdir}/bluetooth-hci-up.service
237 %{_unitdir}/bluetooth-hci-down.service
238