1e3846d81ced0ea41151b19827a28fc797c52243
[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 %__make %{?_smp_mflags}
78
79 %install
80 rm -rf %{buildroot}
81 %make_install
82
83 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
84 mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d
85 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
86 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
87
88 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
89 install -m 0644 %{SOURCE1001} %{buildroot}%{_unitdir}
90 ln -s ../bluetooth-address.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-address.service
91
92 mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
93 install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
94 install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
95 install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools
96
97 %files
98 %manifest %{name}.manifest
99 %defattr(-,root,root,-)
100 %exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
101 %{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
102 %{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
103 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
104 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
105 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
106 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
107 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh
108 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh
109 %{_datadir}/license/bluetooth-tools
110 %{_unitdir}/multi-user.target.wants/bluetooth-address.service
111 %{_unitdir}/bluetooth-address.service
112
113 %post profile_common
114 pushd %{_prefix}/etc/bluetooth/
115 ln -sf common/bt-stack-up.sh bt-stack-up.sh
116 ln -sf common/bt-stack-down.sh bt-stack-down.sh
117 ln -sf common/bt-reset-env.sh bt-reset-env.sh
118 popd
119 %preun profile_common
120 pushd %{_prefix}/etc/bluetooth/
121 rm bt-stack-up.sh
122 rm bt-stack-down.sh
123 rm bt-reset-env.sh
124 popd
125 %files profile_common
126 %{_sysconfdir}/rc.d/init.d/bluetooth-address
127 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-up.sh
128 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-down.sh
129 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-reset-env.sh
130
131 %post profile_mobile
132 pushd %{_prefix}/etc/bluetooth/
133 ln -sf mobile/bt-stack-up.sh bt-stack-up.sh
134 ln -sf mobile/bt-stack-down.sh bt-stack-down.sh
135 ln -sf mobile/bt-stack-down-with-radio.sh bt-stack-down-with-radio.sh
136 ln -sf mobile/bt-reset-env.sh bt-reset-env.sh
137 popd
138 %preun profile_mobile
139 pushd %{_prefix}/etc/bluetooth/
140 rm bt-stack-up.sh
141 rm bt-stack-down.sh
142 rm bt-stack-down-with-radio.sh
143 rm bt-reset-env.sh
144 popd
145 %files profile_mobile
146 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-up.sh
147 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down.sh
148 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-reset-env.sh
149 %attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down-with-radio.sh
150
151 %post profile_ivi
152 pushd %{_prefix}/etc/bluetooth/
153 ln -sf ivi/bt-stack-up.sh bt-stack-up.sh
154 ln -sf ivi/bt-stack-down.sh bt-stack-down.sh
155 ln -sf ivi/bt-reset-env.sh bt-reset-env.sh
156 popd
157 %preun profile_ivi
158 pushd %{_prefix}/etc/bluetooth/
159 rm bt-stack-up.sh
160 rm bt-stack-down.sh
161 rm bt-reset-env.sh
162 popd
163 %files profile_ivi
164 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-up.sh
165 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-down.sh
166 %attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-reset-env.sh
167
168 %post profile_wearable
169 pushd %{_prefix}/etc/bluetooth/
170 ln -sf wearable/bt-stack-up.sh bt-stack-up.sh
171 ln -sf wearable/bt-stack-down.sh bt-stack-down.sh
172 ln -sf wearable/bt-reset-env.sh bt-reset-env.sh
173 popd
174 %preun profile_wearable
175 pushd %{_prefix}/etc/bluetooth/
176 rm bt-stack-up.sh
177 rm bt-stack-down.sh
178 rm bt-reset-env.sh
179 popd
180 %files profile_wearable
181 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-up.sh
182 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-down.sh
183 %attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-reset-env.sh
184
185 %files no-firmware
186 %manifest %{name}.manifest
187 %defattr(-, root, root)
188 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
189 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh