Name: kiran-session-guard
Version: 2.5.1
Release: 4
Summary: Kiran desktop environment login and lock screen dialog
Summary(zh_CN): Kiran桌面环境登录和解锁框

License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz

Patch0001: 0001-fix-kiran-auth-unset-screensaver-dialog-no-fail-dela.patch
Patch0002: 0002-fix-polkit-agent-Remove-the-restriction-on-polkit-ag.patch
Patch0003: 0003-feat-jump-login-open-greeter-jump-login.patch
Patch0004: 0004-fix-crash-block-Fixed-the-crash-caused-by-the-exit-s.patch


%define SHOW_VIRTUAL_KEYBOARD 0

BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libXtst-devel
BuildRequires: libX11-devel
BuildRequires: libXrandr-devel
BuildRequires: libXcursor-devel
BuildRequires: libXfixes-devel
BuildRequires: glib2-devel
BuildRequires: lightdm-qt5-devel
BuildRequires: pam-devel
BuildRequires: libxkbcommon-devel

BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-linguist
BuildRequires: qt5-qtx11extras-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: gsettings-qt-devel

BuildRequires: kiran-widgets-qt5-devel >= 2.4
BuildRequires: kiran-log-qt5-devel
BuildRequires: kiran-authentication-service-devel
BuildRequires: kiran-cc-daemon-devel
BuildRequires: kiran-control-panel-devel >= 2.5
BuildRequires: kiran-qt5-integration-devel >= 2.4
BuildRequires: kiran-qdbusxml2cpp

Requires: qt5-qtbase
Requires: qt5-qtsvg
Requires: qt5-qtx11extras
Requires: gsettings-qt

Requires: kiran-widgets-qt5 >= 2.4
Requires: kiran-log-qt5
Requires: kiran-authentication-service
Requires: kiran-system-daemon
Requires: kiran-session-daemon
Requires: kiran-cpanel-launcher
Requires: kiran-qt5-integration >= 2.4

Requires: lightdm-qt5
Requires: libX11
Requires: libXfixes
Requires: libXtst
Requires: libXrandr
Requires: libXcursor
Requires: glib2
Requires: pam
%if %{SHOW_VIRTUAL_KEYBOARD} == 1
Requires: onboard
%endif

%package -n lightdm-kiran-greeter
Requires:  gtk-update-icon-cache
Provides:  lightdm-greeter
Obsoletes: lightdm-settings
Summary: Kiran desktop environment login greeter
Summary(zh_CN): Kiran桌面环境登录界面

%package -n kiran-screensaver-dialog
Summary: Kiran desktop environment lock dialog
Summary(zh_CN): Kiran桌面环境解锁框
BuildRequires: kiran-screensaver-devel
Requires: kiran-screensaver

%package -n kiran-polkit-agent
Summary: Kiran desktop environment polkit agent
Summary(zh_CN): Kiran桌面环境授权框
BuildRequires: polkit-qt5-1-devel
Requires: polkit-qt5-1

%description
%{summary}.

%description -n lightdm-kiran-greeter
lightdm login greeter

%description -n kiran-screensaver-dialog
kiran-screensaver lock dialog

%description -n kiran-polkit-agent
Kiran desktop environment polkit agent

%prep
%autosetup -p1

%build
%{__mkdir} -p %{buildroot}
%cmake -DBUILD_SHARED_LIBS:BOOL=OFF \
%if %{SHOW_VIRTUAL_KEYBOARD} == 1
-DSHOW_VIRTUAL_KEYBOARD=on \
%endif

make %{?_smp_mflags}

%install
%make_install

%post -n lightdm-kiran-greeter
gtk-update-icon-cache -f /usr/share/icons/hicolor/

%files -n kiran-screensaver-dialog
%doc
%{_libdir}/kiran-screensaver/libkiran-screensaver-dialog.so
%{_datadir}/kiran-screensaver-dialog/translations/*
%{_datadir}/kiran-screensaver-dialog//screensaver-dialog.ini
%{_libexecdir}/kiran-session-guard-checkpass

%files -n lightdm-kiran-greeter
%doc
%{_datadir}/kiran-control-panel/plugins/libs/libkiran-cpanel-greeter.so*
%{_datadir}/kiran-control-panel/plugins/desktop/*

%{_sbindir}/lightdm-kiran-greeter
%{_datadir}/lightdm-kiran-greeter/translations/*
%{_datadir}/lightdm-kiran-greeter/greeter.ini
%{_datadir}/lightdm-kiran-greeter/zlog.conf
%{_datadir}/xgreeters/lightdm-kiran-greeter.desktop
%{_datadir}/lightdm/lightdm.conf.d/*-lightdm-kiran-greeter.conf

%files -n kiran-polkit-agent
%doc
%{_libexecdir}/kiran-polkit-agent
%{_sysconfdir}/xdg/autostart/kiran-polkit-agent.desktop
%{_datadir}/kiran-polkit-agent/translations/kiran-polkit-agent.zh_CN.qm
%{_datadir}/kiran-polkit-agent/translations/kiran-polkit-agent.bo_CN.qm
%{_datadir}/kiran-polkit-agent/translations/kiran-polkit-agent.kk_KG.qm
%{_datadir}/kiran-polkit-agent/translations/kiran-polkit-agent.kk_KZ.qm
%{_datadir}/kiran-polkit-agent/translations/kiran-polkit-agent.mn_MN.qm
%{_datadir}/kiran-polkit-agent/translations/kiran-polkit-agent.ug_CN.qm

%clean
rm -rf %{buildroot}

%changelog
* Tue Jun 13 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-4
- KYOS-B: fix the crash caused by the exit slot not being disconnected in time
- KYOS-B  fix SIGTERM processing where there may be blocking in the X event(#I79MO4)

* Fri Jun 02 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-3
- KYOS-F: open greeter jump login

* Wed May 31 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-2
- KYOS-B: unset screensaver-dialog no fail delay(#I7937W)
- KYOS-B: Remove the restriction on polkit-agent authentication errors(#I7961L)

* Wed May 24 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.1-1
- KYOS-F: If the authentication fails, the re-authentication button is displayed.(#69229) 
- KYOS-B: Fixed an issue caused by selecting default desktop session(#69204,#69220)
- KYOS-F: Supports UKey, Iris, and face authentication

* Tue Apr 25 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.0-6
- KYOS-F: Greeter background anti-aliasing
- KYOS-F: user has not logged in to a desktop environment,  selects a desktop environment by default

* Mon Apr 24 2023 kpkg <kpkg.kylinsec.com.cn> - 2.5.0-5
- rebuild for KY3.4-5-GC-KiranUI-2.5

* Sun Apr 23 2023 wangyucheng <wangyucheng@kylinsec.om.cn> - 2.5.0-4
- KYOS-F: Compatible for versions below 5.14

* Sun Apr 23 2023 wangyucheng <wangyucheng@kylinsec.om.cn> - 2.5.0-3
- KYOS-F: add required package

* Mon Apr 10 2023 wangyucheng <wangyucheng@kylinsec.om.cn> - 2.5.0-2
- KYOS-T: add some translation

* Tue Apr 04 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.0-1
- KYOS-F: Supports the new biometric authentication framework and adds the authorization prompt box 

* Fri Dec 09 2022 liuxinhao <liuixnhao@kylinsec.com.cn> - 2.4.0-4
- KYOS-F: Fix the zombie process caused by waitpid reclaiming that the authentication process is not blocked after the command is invoked in the unlock box
- KYOS-F: unlock interface calls onboard, and the onboard process cycle is consistent with the unlock interface 
- KYOS-F: Use socket to notify SIGTERM signal, and process SIGTERM signal in the main thread to avoid abnormal exit
- KYOS-F: Invoke virtual keyboard initialization during plug-in initialization

* Fri Nov 18 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.4.0-3
- KYOS-F: fix the failure to update the drawing in time when setting the default avatar(#I61QHP) 

* Mon Nov 14 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.4.0-2
- KYOS-F: fix PAM authorization bypass due to incorrect usage

* Fri Nov 04 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.4.0-1
- KYOS-F: release 2.4, kiran-control-panel greeter plugin support color block

* Tue Aug 30 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.0-2
- KYOS-F: apply the last submitted patch:Fix invalid reset of automatic login option,update License,update yaml

* Thu Jul 07 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.0-1
- KYOS-F: update login settings interface style, support dark and light color theme

* Wed Mar 02 2022 longcheng <longcheng@kylinos.com.cn> - 2.2.3-1
- KYOS-B: fix compilation errors on OpenEuler

* Tue Mar 01 2022 longcheng <longcheng@kylinos.com.cn> - 2.2.2-3
- KYOS-B: Add Requires gtk-update-icon-cache

* Sat Feb 26 2022 longcheng <longcheng@kylinos.com.cn> - 2.2.2-2
- KYOS-R: rebuild for KY3.4-3-LS-dev

* Sat Feb 26 2022 longcheng <longcheng@kylinos.com.cn> - 2.2.2-1
- KYOS-B: fix build error in KY3.4-3-LS

* Thu Feb 24 2022 chendingjian <chendingjian@kylinos.com.cn> - 2.2.1-2
- rebuild for KY3.4-MATE-modules-dev

* Fri Feb 11 2022 liuxinhao <liuxinhao@kylinos.com.cn> - 2.2.1-1.kb3
- KYOS-B: fix translation problems

* Thu Jan 20 2022 liuxinhao <liuxinhao@kylinos.com.cn> - 2.2.1-1.kb2
- KYOS-B: fix kiran-screensaver-dialog type eq vanished translator

* Thu Dec 30 2021 kpkg <kpkg@kylinos.com.cn> - 2.2.1-1.kb1
- rebuild for KY3.4-MATE-modules-dev

* Wed Dec 29 2021 caoyuanji<caoyuanji@kylinos.com.cn> - 2.2.1-1
- Upgrade version number for easy upgrade

* Sat Dec 25 2021 caoyuanji <caoyuanji@kylinos.com.cn> - 2.2.1-.kb2
- rebuild for KY3.4-4-KiranUI-2.2

* Mon Nov 08 2021 liuxinhao <liuxinhao@kylinos.com.cn> - 2.2.1.kb1
- KYOS-B: add the display user list and allow manual login switch judgment(#45711)
- KYOS-B: set locale,pam message translate
- KYOS-B: fix that the user did not load through the filter module(#41716)
- KYOS-B: fix that scaling mode was not disabled when the configuration item was first loaded
- KYOS-F: kiran-screensaver-dialog build for kiran-screensaver plugin

* Mon Oct 25 2021 liuxinhao <liuxinhao@kylinos.com.cn> - 2.2.0-2.kb1
- KYOS-B: fix implicit convert problem

* Thu Oct 21 2021 liuxinhao <liuxinhao@kylinos.com.cn> - 2.2.0-1.kb2
- KYBD: rebuild for static library

* Wed Aug 25 2021 liuxinhao <liuxinhao@kylinos.com.cn> - 2.2.0-1.kb1
- Initial build

