Fix bluez-start.path file missing issue
[platform/core/connectivity/bluetooth-tools.git] / packaging / bluetooth-tools.spec
index 069e354..8953f8e 100644 (file)
@@ -5,7 +5,7 @@ Release:    0
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
-Source1001: bluetooth-address.service
+#Source1001: bluetooth-address.service
 BuildRequires:  cmake
 Suggests:       bluetooth-share
 Requires:       tizen-platform-config-tools
@@ -86,26 +86,45 @@ export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
-mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d
-ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
-ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
-
-mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
-install -m 0644 %{SOURCE1001} %{buildroot}%{_unitdir}
-ln -s ../bluetooth-address.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-address.service
-
 mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
+mkdir -p %{buildroot}/run/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 packaging/bluetooth-hci-logger.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger.service
+install -D -m 0644 packaging/bluetooth-hci-logger.path %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger.path
+
+install -D -m 0644 packaging/bluetooth-hci-logger-stop.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger-stop.service
+install -D -m 0644 packaging/bluetooth-hci-logger-stop.path %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-logger-stop.path
+
+install -D -m 0644 packaging/bluez-start.service %{buildroot}%{_libdir}/systemd/system/bluez-start.service
+install -D -m 0644 packaging/bluez-start.path %{buildroot}%{_libdir}/systemd/system/bluez-start.path
+
+install -D -m 0644 packaging/bluetooth-share-start.service %{buildroot}%{_libdir}/systemd/system/bluetooth-share-start.service
+install -D -m 0644 packaging/bluetooth-share-start.path %{buildroot}%{_libdir}/systemd/system/bluetooth-share-start.path
+
 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/
+mkdir -p %{_libdir}/systemd/system/multi-user.target.wants/
 ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hci-logger.path
+ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger-stop.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger-stop.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hci-logger-stop.path
+ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger-stop.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+ln -sf %{_libdir}/systemd/system/bluez-start.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluez-start.path %{_libdir}/systemd/system/multi-user.target.wants/bluez-start.path
+ln -sf %{_libdir}/systemd/system/bluez-start.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+ln -sf %{_libdir}/systemd/system/bluetooth-share-start.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+ln -sf %{_libdir}/systemd/system/bluetooth-share-start.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-share-start.path
+ln -sf %{_libdir}/systemd/system/bluetooth-share-start.path %{_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/
 
 
@@ -113,18 +132,25 @@ ln -sf %{_libdir}/systemd/system/bluetooth-force-hci-logger.service %{_sysconfdi
 %manifest %{name}.manifest
 %license LICENSE.APLv2
 %defattr(-,root,root,-)
-%exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
-%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
-%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
+#%exclude %{_sysconfdir}/rc.d/init.d/bluetooth-address
+#%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
+#%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-on.sh
 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
 %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-hci-logger.sh
-%{_unitdir}/multi-user.target.wants/bluetooth-address.service
-%{_unitdir}/bluetooth-address.service
+#%{_unitdir}/multi-user.target.wants/bluetooth-address.service
+#%{_unitdir}/bluetooth-address.service
 %{_libdir}/systemd/system/bluetooth-hci-logger.service
+%{_libdir}/systemd/system/bluetooth-hci-logger.path
+%{_libdir}/systemd/system/bluetooth-hci-logger-stop.service
+%{_libdir}/systemd/system/bluetooth-hci-logger-stop.path
+%{_libdir}/systemd/system/bluez-start.service
+%{_libdir}/systemd/system/bluez-start.path
+%{_libdir}/systemd/system/bluetooth-share-start.service
+%{_libdir}/systemd/system/bluetooth-share-start.path
 %{_libdir}/systemd/system/bluetooth-force-hci-logger.service
 %{_libdir}/systemd/system/bluetooth-hci-dump@.service
 
@@ -142,7 +168,7 @@ rm bt-reset-env.sh
 popd
 %files profile_common
 %license LICENSE.APLv2
-%{_sysconfdir}/rc.d/init.d/bluetooth-address
+#%{_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
 %attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-reset-env.sh