Modify the install path for license file
[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 %description
14 firmware and tools for bluetooth
15
16 %package TM1
17 Summary:    TM1 firmware and tools for bluetooth
18 Group:      TO_BE/FILLED
19 Provides:   bluetooth-scripts
20
21 %description TM1
22 firmware and tools for bluetooth for TM1
23
24 %prep
25 %setup -q -n bluetooth-firmware-sprd-%{version}
26
27 %build
28 export CFLAGS+=" -fpie -fvisibility=hidden"
29 export CXXFLAGS+=" -fpie -fvisibility=hidden"
30 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
31
32 cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPLUGIN_INSTALL_PREFIX=%{_prefix}
33 make %{?jobs:-j%jobs}
34
35 %install
36 rm -rf %{buildroot}
37 %make_install
38
39 install -D -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/bluetooth-hciattach@.service
40 install -D -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-device.service
41
42 %post TM1
43 rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
44 ln -s %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh
45
46 %files TM1
47 %manifest %{name}.manifest
48 %license LICENSE
49 %defattr(-,root,root,-)
50 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
51 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh
52 %{_libdir}/systemd/system/bluetooth-hciattach@.service
53 %{_libdir}/systemd/system/bluetooth-hci-device.service