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