Initial Release
[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
28 %description TM1
29 firmware and tools for bluetooth for TM1
30
31 %prep
32 %setup -q -n bluetooth-firmware-sprd-%{version}
33
34 %build
35 export CFLAGS+=" -fpie -fvisibility=hidden"
36 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
37
38 cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPLUGIN_INSTALL_PREFIX=%{_prefix}
39 make %{?jobs:-j%jobs}
40
41 %install
42 rm -rf %{buildroot}
43 %make_install
44
45 install -D -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/bluetooth-hciattach@.service
46 install -D -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-device.service
47 install -D -m 0644 LICENSE %{buildroot}%{_datadir}/license/bluetooth-firmware-sprd-TM1
48
49 %post TM1
50 rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
51 ln -s %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh
52
53 %files TM1
54 %defattr(-,root,root,-)
55 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
56 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh
57 %{_datadir}/license/bluetooth-firmware-sprd-TM1
58 %{_libdir}/systemd/system/bluetooth-hciattach@.service
59 %{_libdir}/systemd/system/bluetooth-hci-device.service