export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
%cmake
-%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+%if 0%{?tizen_build_binary_release_type_eng}
+ -DBT_HCI_LOG_SIZE=10
+%else
+ -DBT_HCI_LOG_SIZE=5
+%endif
+
%__make %{?_smp_mflags}
%install
mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
-install -D -m 0644 LICENSE.APLv2 %{buildroot}%{_datadir}/license/bluetooth-tools
+
+install -D -m 0644 packaging/bluetooth-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger.service
+install -D -m 0644 packaging/bluetooth-force-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-force-hci-logger.service
+install -D -m 0644 packaging/bluetooth-hci-dump@.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-dump@.service
+
+%post
+mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-force-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
%files
%manifest %{name}.manifest
+%license LICENSE.APLv2
%defattr(-,root,root,-)
%exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-hci-logdump.sh
-%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hcidump.sh
-%{_datadir}/license/bluetooth-tools
+%attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-run-hci-logger.sh
%{_unitdir}/multi-user.target.wants/bluetooth-address.service
%{_unitdir}/bluetooth-address.service
+%{_libdir}/systemd/system/bluetooth-hci-logger.service
+%{_libdir}/systemd/system/bluetooth-force-hci-logger.service
+%{_libdir}/systemd/system/bluetooth-hci-dump@.service
%post profile_common
pushd %{_prefix}/etc/bluetooth/
rm bt-reset-env.sh
popd
%files profile_common
+%license LICENSE.APLv2
%{_sysconfdir}/rc.d/init.d/bluetooth-address
%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-up.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-down.sh
rm bt-reset-env.sh
popd
%files profile_mobile
+%license LICENSE.APLv2
%attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-up.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-stack-down.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/mobile/bt-reset-env.sh
rm bt-reset-env.sh
popd
%files profile_ivi
+%license LICENSE.APLv2
%attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-up.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-stack-down.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/ivi/bt-reset-env.sh
rm bt-reset-env.sh
popd
%files profile_wearable
+%license LICENSE.APLv2
%attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-up.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-stack-down.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/wearable/bt-reset-env.sh
%files no-firmware
%manifest %{name}.manifest
+%license LICENSE.APLv2
%defattr(-, root, root)
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh