Apply hal macro and modify script
[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.6.0
4 Release:    1
5 Group:      TO_BE_FILLED
6 License:    Apache-2.0
7 Source0:    bluetooth-firmware-sprd-%{version}.tar.gz
8
9 BuildRequires:  cmake
10 BuildRequires:  pkgconfig(dlog)
11 BuildRequires:  pkgconfig(hal-api-common)
12 BuildRequires:  pkgconfig(hal-api-bluetooth)
13
14 %description
15 firmware and tools for bluetooth
16
17 %package TM1
18 Summary:    TM1 firmware and tools for bluetooth
19 Group:      TO_BE/FILLED
20 Provides:   bluetooth-scripts
21
22 %description TM1
23 firmware and tools for bluetooth for TM1
24
25 %prep
26 %setup -q -n bluetooth-firmware-sprd-%{version}
27
28 %build
29 export CFLAGS+=" -fpie -fvisibility=hidden"
30 export CXXFLAGS+=" -fpie -fvisibility=hidden"
31 export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
32
33 cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
34         -DPLUGIN_INSTALL_PREFIX=%{_prefix} \
35         -DHAL_LIB_DIR=%{_hal_libdir} \
36         -DHAL_LICENSE_DIR=%{_hal_licensedir} \
37         -DHAL_SYSCONF_DIR=%{_hal_sysconfdir}
38 make %{?jobs:-j%jobs}
39
40 %install
41 rm -rf %{buildroot}
42 %make_install
43
44 %post TM1
45 rm -rf %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
46 ln -s %{_hal_sysconfdir}/bluetooth/bt-dev-start-TM1.sh %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
47
48 %files TM1
49 %manifest %{name}.manifest
50 %{_hal_licensedir}/%{name}/LICENSE
51 %{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
52 %{_hal_sysconfdir}/bluetooth/bt-dev-start-TM1.sh
53 %{_hal_libdir}/*.so*