%bcond_with wayland
+%define __libdir /usr/lib
Name: starter
Summary: starter
License: Apache-2.0
Source0: starter-%{version}.tar.gz
Source1: starter.service
-Source2: wait-lock.service
+Source2: starter.path
Source3: starter-pre.service
+Source4: starter-pre.path
%if "%{?tizen_profile_name}"=="tv"
ExcludeArch: %{arm} %ix86 x86_64
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
-install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/starter.service
-install -m 0644 %SOURCE3 %{buildroot}%{_libdir}/systemd/system/starter-pre.service
-ln -s ../starter.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/starter.service
-mkdir -p %{buildroot}%{_libdir}/systemd/system/tizen-system.target.wants
-install -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/wait-lock.service
-ln -s ../wait-lock.service %{buildroot}%{_libdir}/systemd/system/tizen-system.target.wants/
+mkdir -p %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants
+mkdir -p %{buildroot}%{__libdir}/systemd/system/tizen-system.target.wants
+mkdir -p %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+install -m 0644 %SOURCE1 %{buildroot}%{__libdir}/systemd/system/starter.service
+ln -s ../starter.service %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter.service
+ln -s %{__libdir}/systemd/system/starter.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+install -m 0644 %SOURCE2 %{buildroot}%{__libdir}/systemd/system/starter.path
+ln -s ../starter.path %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter.path
+
+install -m 0644 %SOURCE3 %{buildroot}%{__libdir}/systemd/system/starter-pre.service
+ln -s ../starter-pre.service %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.service
+ln -s %{__libdir}/systemd/system/starter-pre.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
+
+install -m 0644 %SOURCE4 %{buildroot}%{__libdir}/systemd/system/starter-pre.path
+ln -s ../starter-pre.path %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.path
+
mkdir -p %{buildroot}/usr/share/license
cp -f LICENSE %{buildroot}/usr/share/license/%{name}
mkdir -p %{buildroot}/opt/data/home-daemon
-mkdir -p %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-ln -s %{_libdir}/systemd/system/starter.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-ln -s %{_libdir}/systemd/system/starter-pre.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-
%post
change_file_executable()
{
mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
-ln -s %{_libdir}/systemd/system/wait-lock.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/
#ln -sf /etc/init.d/rd4starter /etc/rc.d/rc4.d/S81starter
#ln -sf /etc/init.d/rd4starter /etc/rc.d/rc3.d/S81starter
%{_sysconfdir}/init.d/rd4starter
%{_sysconfdir}/init.d/rd3starter
%{_bindir}/starter
-%{_libdir}/systemd/system/starter.service
-%{_libdir}/systemd/system/multi-user.target.wants/starter.service
+%{__libdir}/systemd/system/starter.service
+%{__libdir}/systemd/system/starter.path
+%{__libdir}/systemd/system/starter-pre.service
+%{__libdir}/systemd/system/starter-pre.path
+%{__libdir}/systemd/system/multi-user.target.wants/starter.service
+%{__libdir}/systemd/system/multi-user.target.wants/starter.path
+%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.service
+%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.path
%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/starter.service
-%{_libdir}/systemd/system/starter-pre.service
%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/starter-pre.service
-%{_libdir}/systemd/system/wait-lock.service
-%{_libdir}/systemd/system/tizen-system.target.wants/wait-lock.service
/usr/share/license/%{name}
/opt/data/home-daemon
/usr/share/locale/*/LC_MESSAGES/*
-static void _check_ongoing(bool ongoing)
-{
- if (ongoing) {
- /* check previous process */
- if (s_lock_mgr.checkfd) {
- _E("checkfd fail");
- return;
- }
-
- if (access(PASSWORD_LOCK_PROGRESS, F_OK) == 0) {
- _E("file(%s) is exist", PASSWORD_LOCK_PROGRESS);
- return;
- }
-
- /* make tmp file */
- s_lock_mgr.checkfd = creat(PASSWORD_LOCK_PROGRESS, 0640);
-
- if (s_lock_mgr.checkfd < 0) {
- _E("Failed to make %s file", PASSWORD_LOCK_PROGRESS);
- s_lock_mgr.checkfd = 0;
- }
-
- _W("make %s file", PASSWORD_LOCK_PROGRESS);
- s_lock_mgr.checkfd = 1;
- } else {
- if (!s_lock_mgr.checkfd) {
- _E("checkfd is NULL");
- return;
- }
-
- if (unlink(PASSWORD_LOCK_PROGRESS) < 0) {
- _E("Failed to remove %s file", PASSWORD_LOCK_PROGRESS);
- }
-
- close(s_lock_mgr.checkfd);
- s_lock_mgr.checkfd = 0;
- _W("delete %s file", PASSWORD_LOCK_PROGRESS);
- }
-}
-
-
-
static void _lock_daemon_init(void)
{
_SECURE_D("default lock screen pkg name is %s", status_passive_get()->setappl_3rd_lock_pkg_name_str);
lock_type = status_active_get()->setappl_screen_lock_type_int;
_D("lock type : %d", lock_type);
- if (lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD ||
- lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD) {
- if (s_lock_mgr.checkfd) {
- _check_ongoing(EINA_FALSE);
- } else {
- _check_ongoing(EINA_TRUE);
- }
- }
-
ret = lock_mgr_lockscreen_launch();
_D("ret : %d", ret);