Group: TO_BE_FILLED
License: Apache-2.0
Source0: bluetooth-firmware-sprd-%{version}.tar.gz
-Source1: bluetooth-hciattach@.service
-Source2: bluetooth-hci-device.service
BuildRequires: cmake
BuildRequires: pkgconfig(dlog)
export CXXFLAGS+=" -fpie -fvisibility=hidden"
export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
-cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix} -DPLUGIN_INSTALL_PREFIX=%{_prefix}
+cmake ./ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ -DPLUGIN_INSTALL_PREFIX=%{_prefix} \
+ -DHAL_LIB_DIR=%{_hal_libdir} \
+ -DHAL_LICENSE_DIR=%{_hal_licensedir} \
+ -DHAL_SYSCONF_DIR=%{_hal_sysconfdir}
make %{?jobs:-j%jobs}
%install
rm -rf %{buildroot}
%make_install
-install -D -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/bluetooth-hciattach@.service
-install -D -m 0644 %SOURCE2 %{buildroot}%{_unitdir}/bluetooth-hci-device.service
-
%post TM1
-rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
-ln -s %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh
+rm -rf %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
+ln -s %{_hal_sysconfdir}/bluetooth/bt-dev-start-TM1.sh %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
%files TM1
%manifest %{name}.manifest
-%license LICENSE
-%defattr(-,root,root,-)
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-TM1.sh
-%{_unitdir}/bluetooth-hciattach@.service
-%{_unitdir}/bluetooth-hci-device.service
-/hal/lib/*.so*
+%{_hal_licensedir}/%{name}/LICENSE
+%{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
+%{_hal_sysconfdir}/bluetooth/bt-dev-start-TM1.sh
+%{_hal_libdir}/*.so*