%global debug_package %{nil}
%debug_package %{nil}


Name:           dde-session-shell
Version:        5.6.21
Release:        2%{?dist}.01
Summary:        deepin-session-shell - Deepin desktop-environment - session-shell module
License:        GPLv3+
URL:            https://github.com/linuxdeepin/dde-session-shell/
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
#Patch0:  9000-fix-lastLogoutUser-root-bug.patch
Patch0:         0001-feat-add-QpainterPath-include.patch
Patch1:	   0001-Solve-the-user-switching-login-problem.patch
Patch2:	   0002-fix-dde-lock-prompt-message.patch

BuildRequires:  cmake
BuildRequires:  glib2-devel
BuildRequires:  libarchive
BuildRequires:  dtkcore-devel >= 5.5
BuildRequires:  dtkcommon-devel
BuildRequires:  gsettings-qt
BuildRequires:  qt5-qttools-devel
BuildRequires:  qt5-qtdeclarative-devel
BuildRequires:  qt5-linguist
BuildRequires:  dtkwidget-devel >= 5.5
BuildRequires:  qt5-qtx11extras-devel
BuildRequires:  qt5-qtmultimedia-devel
BuildRequires:  qt5-qtsvg-devel
BuildRequires:  libXcursor-devel
BuildRequires:  libXrandr-devel
BuildRequires:  libXtst-devel
BuildRequires:  libXi-devel
BuildRequires:  deepin-gettext-tools
BuildRequires:  xcb-util-wm xcb-util-wm-devel
BuildRequires:  dde-qt-dbus-factory-devel
BuildRequires:  gsettings-qt-devel
BuildRequires:  lightdm-qt5-devel
BuildRequires:  pam-devel
BuildRequires:  openssl-devel
BuildRequires:  gtest-devel
BuildRequires:  dtkgui-devel
BuildRequires:  gcc-c++
BuildRequires:  kf5-kwayland-devel
BuildRequires:  gmock

Requires:       lightdm
Requires:       google-noto-cjk-fonts
Requires:       libqtxdg-devel
Requires:       deepin-desktop-schemas
Requires:       dde-daemon
Requires:       startdde
Requires(post): sed
Provides:       lightdm-deepin-greeter = %{version}-%{release}
Provides:       lightdm-greeter = 1.2

%description
deepin-session-shell - Deepin desktop-environment - session-shell module.

%package devel
Summary:        Development package for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
Header files for %{name}.

%prep
%autosetup -p1

%build
export PATH=$PATH:%{_qt5_bindir}
cmake_version=$(cmake --version | head -1 | awk '{print $3}')
sed -i "s|VERSION 3.13.4|VERSION $cmake_version|g" CMakeLists.txt
%cmake -DCMAKE_INSTALL_SYSCONFDIR=/etc
%make_build

%install
%make_install

%files
%{_bindir}/dde-lock
%{_bindir}/greeter-display-setting
%{_bindir}/lightdm-deepin-greeter
%{_bindir}/lightdm-deepin-greeter-lighter
%attr(755,root,root) %{_bindir}/deepin-greeter
%{_sysconfdir}/pam.d/dde-lock
%{_sysconfdir}/lightdm/deepin/
%{_sysconfdir}/xdg/autostart/dde-lock.desktop
%{_datadir}/dde-session-shell/
%{_datadir}/deepin-authentication/
%{_datadir}/applications/dde-lock.desktop
%{_datadir}/xgreeters/lightdm-deepin-greeter.desktop
%{_datadir}/xgreeters/lightdm-deepin-greeter-wayland.desktop
%{_datadir}/dbus-1/services/com.deepin.dde.lockFront.service
%{_datadir}/dbus-1/services/com.deepin.dde.shutdownFront.service
%{_datadir}/glib-2.0/schemas/com.deepin.dde.session-shell.gschema.xml
%{_datadir}/dsg/
%{_datadir}/lightdm/lightdm.conf.d/50-deepin.conf
%{_libdir}/security/pam_inhibit_autologin.so

%files devel
%{_includedir}/%{name}
%{_prefix}/lib/%{name}/modules/
%{_libdir}/cmake/DdeSessionShell/DdeSessionShellConfig.cmake

%changelog
* Mon Mar 04 2024 yangfei <yangfei@uniontech.com> - 5.6.21-2.01
- fix: fix dde-lock prompt message(bugid:241641)

* Tue Dec 12 2023 mahailiang <mahailiang@uniontech.com> - 5.6.21-2
- fix: Solve the user switching login problem(bugid:194591)

* Mon Oct 09 2023 liweigang <liweiganga@uniontech.com> - 5.6.21-1
- update: update to version 5.6.21

* Fri Sep 08 2023 liuzhilin <liuzhilin@uniontech.com> - 5.6.12.5-1.01
- spec: add buildrequires gmock to sw_64

* Thu Aug 17 2023 liuzhilin <liuzhilin@uniontech.com> - 5.6.12.5-1
- update: update to 5.6.12.5

* Wed Jul 05 2023 yuxiaojun <yuxiaojun@uniontech.com> - 5.5.90-1.03
- fix: When root is disabled after creating an administrator account, the problem of being unable to enter the system through the graphical interface(bugid:203337)

* Tue Jan 17 2023 liweiganga <liweiganga@uniontech.com> - 5.5.90-1.01
- spec: fix greeters path

* Thu Dec 29 2022 liweiganga <liweiganga@uniontech.com> - 5.5.90-1
- update: update to 5.5.90

* Fri Jun 10 2022 uoser <uoser@uniontech.com> - 5.4.92-1.01
- package init
