Provide virtual package bluetooth-scripts
[platform/adaptation/bluetooth-firmware-sprd.git] / packaging / bluetooth-firmware-sprd.spec
1 Name:       bluetooth-firmware-sprd
2 Summary:    firmware and tools for bluetooth
3 Version:    0.1.1
4 Release:    0
5 Group:      TO_BE_FILLED
6 License:    Apache-2.0
7 Source0:    bluetooth-firmware-sprd-%{version}.tar.gz
8 Source1:    bluetooth-hciattach@.service
9 Source2:    bluetooth-hci-device.service
10
11 BuildRequires:  cmake
12
13 %if "%{?tizen_profile_name}" == "wearable"
14 ExcludeArch: %{arm} %ix86 x86_64
15 %endif
16
17 %if "%{?tizen_profile_name}"=="tv"
18 ExcludeArch: %{arm} %ix86 x86_64
19 %endif
20
21 %description
22 firmware and tools for bluetooth
23
24 %package TM1
25 Summary:    TM1 firmware and tools for bluetooth
26 Group:      TO_BE/FILLED
27 Provides:   bluetooth-scripts
28
29 %description TM1
30 firmware and tools for bluetooth for TM1
31
32 %prep
33 %setup -q -n bluetooth-firmware-sprd-%{version}
34
35 %build
36 export CFLAGS+=" -fpie -fvisibility=hidden"
37 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
38
39 cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPLUGIN_INSTALL_PREFIX=%{_prefix}
40 make %{?jobs:-j%jobs}
41
42 %install
43 rm -rf %{buildroot}
44 %make_install
45
46 install -D -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/bluetooth-hciattach@.service
47 install -D -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-device.service
48 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-firmware-sprd-TM1
49
50 %post TM1
51 rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
52 ln -s %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh
53
54 %files TM1
55 %defattr(-,root,root,-)
56 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
57 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh
58 %{_datadir}/license/bluetooth-firmware-sprd-TM1
59 %{_libdir}/systemd/system/bluetooth-hciattach@.service
60 %{_libdir}/systemd/system/bluetooth-hci-device.service