# 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)
cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
cat %{_builddir}/%{name}-%{version}/LICENSE.Broadcom >> %{buildroot}/usr/share/license/%{name}
+install -D -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/bluetooth-hciattach@.service
+install -D -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-device.service
+
%files
%defattr(-,root,root,-)
#%{_bindir}/bcmtool_4330b1
%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 %{_libdir}/systemd/system/bluetooth-hciattach@.service
+%exclude %{_libdir}/systemd/system/bluetooth-hci-device.service
%manifest %{name}.manifest
%post exynos3250
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-exynos3250.sh
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
/usr/share/license/%{name}
+%{_libdir}/systemd/system/bluetooth-hciattach@.service
+%{_libdir}/systemd/system/bluetooth-hci-device.service
%manifest %{name}.manifest
%post artik
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-artik.sh
%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
/usr/share/license/%{name}
+%{_libdir}/systemd/system/bluetooth-hciattach@.service
+%{_libdir}/systemd/system/bluetooth-hci-device.service
%manifest %{name}.manifest
--- /dev/null
+[Unit]
+Description=hciattach service requested by %I
+Requires=bluetooth-hci-device.service
+After=bluetooth-hci-device.service
+
+[Service]
+Type=oneshot
+ExecStartPre=-/bin/mkdir -p /run/bluetooth/
+ExecStart=/bin/touch /run/bluetooth/%I
+ExecStop=/bin/rm /run/bluetooth/%I
+RemainAfterExit=yes
+StandardOutput=journal+console
+StandardError=inherit