# NOTE: Source name does not match package name. This should be
# resolved in the future, by I don't have that power. - Ryan Ware
Source0: %{name}-%{version}.tar.gz
-Source1: bluetooth-hciattach@.service
-Source2: bluetooth-hci-device.service
Provides: bluetooth-scripts
BuildRequires: pkgconfig(vconf)
%setup -q
%build
-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
%make_install
-install -D -m 0644 %SOURCE1 %{buildroot}%{_unitdir}/bluetooth-hciattach@.service
-install -D -m 0644 %SOURCE2 %{buildroot}%{_unitdir}/bluetooth-hci-device.service
-
%files
%manifest %{name}.manifest
-%license LICENSE.APLv2 LICENSE.Broadcom
-%defattr(-,root,root,-)
-#%{_bindir}/bcmtool_4330b1
-%exclude %{_bindir}/bcmtool_4343w
-%{_bindir}/bcmtool_4358a1
-%{_bindir}/setbd
-#%{_prefix}/etc/bluetooth/BT_FW_BCM4330B1_002.001.003.0221.0265.hcd
-%{_prefix}/etc/bluetooth/BT_FW_BCM4358A1_001.002.005.0032.0066.hcd
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
-%exclude %{_unitdir}/bluetooth-hciattach@.service
-%exclude %{_unitdir}/bluetooth-hci-device.service
-%manifest %{name}.manifest
+%{_hal_licensedir}/%{name}/LICENSE.APLv2
+%{_hal_licensedir}/%{name}/LICENSE.Broadcom
+#%{_hal_sysconfdir}/bluetooth/bcmtool_4330b1
+%exclude %{_hal_sysconfdir}/bluetooth/bcmtool_4343w
+%{_hal_sysconfdir}/bluetooth/bcmtool_4358a1
+%{_hal_sysconfdir}/bluetooth/setbd
+#%{_hal_sysconfdir}/bluetooth/BT_FW_BCM4330B1_002.001.003.0221.0265.hcd
+%{_hal_sysconfdir}/bluetooth/BT_FW_BCM4358A1_001.002.005.0032.0066.hcd
+%{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
+%{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
+%{_hal_sysconfdir}/bluetooth/bt-set-addr.sh
%post exynos3250
-rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
-ln -s %{_prefix}/etc/bluetooth/bt-dev-start-exynos3250.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-exynos3250.sh %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
%files exynos3250
%manifest %{name}.manifest
-%license LICENSE.APLv2 LICENSE.Broadcom
-%defattr(-,root,root,-)
-%{_bindir}/bcmtool_4343w
-%{_bindir}/setbd
-%{_prefix}/etc/bluetooth/BCM4343A1_001.002.009.0035.0096_ORC_Orbis_WC1-S.hcd
-%{_prefix}/etc/bluetooth/BCM4343A1_001.002.009.0022.0050_Murata_Type-1FR.hcd
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-exynos3250.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
-%{_unitdir}/bluetooth-hciattach@.service
-%{_unitdir}/bluetooth-hci-device.service
-%manifest %{name}.manifest
+%{_hal_licensedir}/%{name}/LICENSE.APLv2
+%{_hal_licensedir}/%{name}/LICENSE.Broadcom
+%{_hal_sysconfdir}/bluetooth/bcmtool_4343w
+%{_hal_sysconfdir}/bluetooth/setbd
+%{_hal_sysconfdir}/bluetooth/BCM4343A1_001.002.009.0035.0096_ORC_Orbis_WC1-S.hcd
+%{_hal_sysconfdir}/bluetooth/BCM4343A1_001.002.009.0022.0050_Murata_Type-1FR.hcd
+%{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
+%{_hal_sysconfdir}/bluetooth/bt-dev-start-exynos3250.sh
+%{_hal_sysconfdir}/bluetooth/bt-set-addr.sh
%post artik
-rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
-ln -s %{_prefix}/etc/bluetooth/bt-dev-start-artik.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-artik.sh %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
%files artik
%manifest %{name}.manifest
-%license LICENSE.APLv2 LICENSE.Broadcom
-%defattr(644,root,root,-)
-%{_bindir}/brcm_patchram_plus
-%{_bindir}/setbd
-%{_prefix}/etc/bluetooth/BCM4354_003.001.012.0353.0745_Samsung_Artik_ORC.hcd
-%{_prefix}/etc/bluetooth/BCM4345C0_003.001.025.0111.0205.hcd
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-artik.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
-%{_unitdir}/bluetooth-hciattach@.service
-%{_unitdir}/bluetooth-hci-device.service
-%manifest %{name}.manifest
+%{_hal_licensedir}/%{name}/LICENSE.APLv2
+%{_hal_licensedir}/%{name}/LICENSE.Broadcom
+%{_hal_sysconfdir}/bluetooth/brcm_patchram_plus
+%{_hal_sysconfdir}/bluetooth/setbd
+%{_hal_sysconfdir}/bluetooth/BCM4354_003.001.012.0353.0745_Samsung_Artik_ORC.hcd
+%{_hal_sysconfdir}/bluetooth/BCM4345C0_003.001.025.0111.0205.hcd
+%{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
+%{_hal_sysconfdir}/bluetooth/bt-dev-start-artik.sh
+%{_hal_sysconfdir}/bluetooth/bt-set-addr.sh
%post exynos7270
-rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
-ln -s %{_prefix}/etc/bluetooth/bt-dev-start-exynos7270.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh
-rm -rf /lib/firmware/43012B0.hex
-ln -s /lib/firmware/bcm43012/BCM43012B0_002.001.021.0081.0087.hex /lib/firmware/43012B0.hex
+rm -rf %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
+ln -s %{_hal_sysconfdir}/bluetooth/bt-dev-start-exynos7270.sh %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
+rm -rf %{_hal_libdir}/firmware/43012B0.hex
+ln -s %{_hal_libdir}/firmware/bcm43012/BCM43012B0_002.001.021.0081.0087.hex %{_hal_libdir}/firmware/43012B0.hex
%files exynos7270
%manifest %{name}.manifest
-%license LICENSE.APLv2 LICENSE.Broadcom
-%defattr(-,root,root,-)
-%{_bindir}/setbd
-/lib/firmware/bcm43012/BCM43012B0_002.001.021.0081.0087.hex
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-exynos7270.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
-%{_unitdir}/bluetooth-hciattach@.service
-%{_unitdir}/bluetooth-hci-device.service
-%manifest %{name}.manifest
+%{_hal_licensedir}/%{name}/LICENSE.APLv2
+%{_hal_licensedir}/%{name}/LICENSE.Broadcom
+%{_hal_sysconfdir}/bluetooth/setbd
+%{_hal_libdir}/firmware/bcm43012/BCM43012B0_002.001.021.0081.0087.hex
+%{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
+%{_hal_sysconfdir}/bluetooth/bt-dev-start-exynos7270.sh
+%{_hal_sysconfdir}/bluetooth/bt-set-addr.sh
%post rpi3
-rm -rf %{_prefix}/etc/bluetooth/bt-dev-start.sh
-rm -rf %{_prefix}/etc/bluetooth/bt-dev-end.sh
-ln -s %{_prefix}/etc/bluetooth/bt-dev-start-rpi3.sh %{_prefix}/etc/bluetooth/bt-dev-start.sh
-ln -s %{_prefix}/etc/bluetooth/bt-dev-end-rpi3.sh %{_prefix}/etc/bluetooth/bt-dev-end.sh
-mkdir -p /lib/firmware/brcm
-ln -s %{_prefix}/etc/bluetooth/BCM43430A1.hcd /lib/firmware/brcm/
-ln -s %{_prefix}/etc/bluetooth/BCM4345C0.hcd /lib/firmware/brcm/
+rm -rf %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
+rm -rf %{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
+ln -s %{_hal_sysconfdir}/bluetooth/bt-dev-start-rpi3.sh %{_hal_sysconfdir}/bluetooth/bt-dev-start.sh
+ln -s %{_hal_sysconfdir}/bluetooth/bt-dev-end-rpi3.sh %{_hal_sysconfdir}/bluetooth/bt-dev-end.sh
+mkdir -p {_hal_libdir}/firmware/brcm
+ln -s %{_hal_sysconfdir}/bluetooth/BCM43430A1.hcd %{_hal_libdir}/firmware/brcm/
+ln -s %{_hal_sysconfdir}/bluetooth/BCM4345C0.hcd %{_hal_libdir}/firmware/brcm/
%files rpi3
%manifest %{name}.manifest
-%license LICENSE.APLv2 LICENSE.Broadcom
-%defattr(-,root,root,-)
-%{_prefix}/etc/bluetooth/BCM43430A1.hcd
-%{_prefix}/etc/bluetooth/BCM4345C0.hcd
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end-rpi3.sh
-%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-rpi3.sh
-%manifest %{name}.manifest
-/hal/lib/*.so*
+%{_hal_licensedir}/%{name}/LICENSE.APLv2
+%{_hal_licensedir}/%{name}/LICENSE.Broadcom
+%{_hal_sysconfdir}/bluetooth/BCM43430A1.hcd
+%{_hal_sysconfdir}/bluetooth/BCM4345C0.hcd
+%{_hal_sysconfdir}/bluetooth/bt-dev-end-rpi3.sh
+%{_hal_sysconfdir}/bluetooth/bt-dev-start-rpi3.sh
+%{_hal_libdir}/*.so*