Name:           dde-control-center
Version:        5.5.182
Release:        5
Summary:        New control center for Linux Deepin
License:        GPLv3
URL:            https://github.com/linuxdeepin/dde-control-center
Source0:        %{name}-%{version}.tar.gz

#add by uos
Patch0001:      0001-dde-control-center-uos-fix-modify-eulerServerEnduserAgreement_new-path.patch
# activate butten
Patch0003:      0003-dde-control-center-uos-open-activate-button-for-1050.patch
# disable windowmoveswitch
Patch0004:      0004-dde-control-center-disable-windowmoveswitch.patch
# add setVersion
Patch0005:      0005-dde-control-center-feat-add-setVersion.patch
# uelc hide commoninfo
Patch0006:      0006-hide-commonifo-and-end-user-license-agreement.patch
# add Free-license
Patch0007:      0007-dde-control-center-uos-add-Free-license.patch
# hidden power-press-powerbtn
Patch0008:      0008-dde-control-center-feat-hidden-power-press-powerbtn.patch
# modify copyright read current year
Patch0009:      0009-dde-control-center-feat-modify-copyright-read-current-year.patch
Patch0010:      0001-feat-root.patch
# pms 204145
Patch0011:      0010-fix-Array-out-of-bounds-causes-crash-handling.patch
#end

#Patch0:         0002-hide-authorized.patch
#Patch1:         0001-dde-control-center-uos-fix-modify-eulerServerEnduserAgreement_new-path.patch
#Patch2:         0003-bugfix-for-no-check-newpassword-at-modifypwd.patch
#Patch3:         0004-fix.patch
#Patch4:         0005-fix-hide-commoninfo-and-end-user-license-agreement.patch

BuildRequires:  gcc-c++
BuildRequires:  desktop-file-utils
BuildRequires:  dde-dock-devel
BuildRequires:  dde-network-core-devel
#BuildRequires:  dde-network-utils-devel
BuildRequires:  dtkwidget-devel
BuildRequires:  dtkgui-devel
BuildRequires:  dtkcore-devel
BuildRequires:  dde-qt-dbus-factory-devel
BuildRequires:  pkgconfig(gsettings-qt)
BuildRequires:  pkgconfig(geoip)
BuildRequires:  pkgconfig(libnm)
BuildRequires:  libpwquality-devel
BuildRequires:  qt5-devel
BuildRequires:  pkgconfig(xcb-ewmh)
BuildRequires:  kf5-networkmanager-qt-devel
BuildRequires:  udisks2-qt5-devel
BuildRequires:  qt5-linguist
BuildRequires:  cmake
BuildRequires:  libXext-devel
BuildRequires:  qt5-qtbase-private-devel
BuildRequires:  gtest-devel
BuildRequires:  gmock-devel
BuildRequires:  polkit-qt5-1-devel
BuildRequires:  deepin-pw-check
BuildRequires:  deepin-pw-check-devel
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  kf5-kwayland-devel
BuildRequires:  qt5-qtbase-static
BuildRequires:  libxkbcommon-devel
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  kf5-kwayland-devel
BuildRequires:  qt5-qtbase-static
BuildRequires:  libxkbcommon-devel
BuildRequires:  dareader-devel
BuildRequires:  qt5-qtbase-private-devel

Requires:       dde-account-faces
Requires:       dde-api
Requires:       dde-daemon
Requires:       dde-qt5integration
Requires:       dde-network-core
Requires:       startdde
Requires:       dde-server-industry-config
Requires:       deepin-pw-check
Requires:       cracklib
Recommends:     NetworkManager-l2tp

%description
New control center for Linux Deepin.

%package devel
Summary:        %{summary}

%description devel
%{summary}.

%prep
%setup -q -n %{name}-%{version}
%patch0001 -p1
%patch0003 -p1
%patch0004 -p1
%patch0005 -p1
%patch0006 -p1
%patch0007 -p1
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1

sed -i 's|lrelease|lrelease-qt5|' translate_generation.sh
sed -i -E '/add_compile_definitions/d' CMakeLists.txt

%build
%cmake . -DDCC_DISABLE_GRUB=YES \
         -DDISABLE_AUTHENTICATION=YES \
         -DDISABLE_ACCOUNT=YES \
         -DDISABLE_SYS_UPDATE=YES \
         -DDISABLE_SYS_UPDATE_SOURCE_CHECK=YES \
         -DDISABLE_SYS_UPDATE_MIRRORS=YES \
         -DDISABLE_ACTIVATOR=YES \
         -DCMAKE_INSTALL_SYSCONFDIR=%{_sysconfdir}
%make_build

%post
#create-cracklib-dict /usr/share/dict/MainEnglishDictionary_ProbWL.txt

%postun
#if [ "$1" = "0" ] ; then
#	create-cracklib-dict /usr/share/dict/MainEnglishDictionary_ProbWL.txt
#fi

%install
%make_install INSTALL_ROOT=%{buildroot}
# place holder plugins dir
mkdir -p %{buildroot}%{_libdir}/%{name}/plugins
# https://github.com/linuxdeepin/dde-control-center/issues/115
# And we disabled SYS_UPDATE, so reboot-reminder-dialog is useless.
#rm %{buildroot}%{_bindir}/reboot-reminder-dialog
#mkdir -p %{buildroot}/usr/lib64/cmake/DdeControlCenter
#mv %{buildroot}/cmake/DdeControlCenter/DdeControlCenterConfig.cmake %{buildroot}/usr/lib64/cmake/DdeControlCenter
mv %{buildroot}/usr/lib/libdccwidgets.so %{buildroot}%{_libdir}/
install -Dm644 com.deepin.controlcenter.addomain.policy %{buildroot}%{_datadir}/polkit-1/actions/

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop ||:

%ldconfig_scriptlets

%files
%doc README.md
%license LICENSE
%{_bindir}/abrecovery
%{_bindir}/dde-control-center
%{_bindir}/dde-control-center-wapper
%{_datadir}/
%{_libdir}/libdccwidgets.so
%{_sysconfdir}/xdg/autostart/deepin-ab-recovery.desktop
%{_prefix}/lib/dde-grand-search-daemon/

%files devel
%{_includedir}/dde-control-center
%{_libdir}/cmake/DdeControlCenter/

%changelog
* Fri Apr 12 2024 liuzhilin <liuzhilin@uniontech.com> - 5.5.182-5
- backport del buildrequires

* Wed Apr 10 2024 liuzhilin <liuzhilin@uniontech.com> - 5.5.182-4
- fix dde-network-core build error

* Thu Jan 25 2024 lvgenggeng <lvgenggeng@uniontech.com> - 5.5.182-3
- fix URL error

* Fri Aug 18 2023 leeffo <liweiganga@uniontech.com> - 5.5.182-2
- update BR

* Wed Aug 02 2023 leeffo <liweiganga@uniontech.com> - 5.5.182-1
- upgrade to version 5.5.182

* Thu Jun 08 2023 lee <liweiganga@uniontech.com> - 5.4.85.4-3
- fix: control-center core and hide commoninfo

* Tue Apr 11 2023 Dongxing Wang <dxwangk@isoftstone.com> - 5.4.85.4-2
- fix: issue#I6QIOR bugfix-for-no-check-newpassword-at-modifypwd

* Mon Apr 10 2023 liweiganga <liweiganga@uniontech.com> - 5.4.85.4-1
- update: update to 5.4.85.4

* Thu Apr 06 2023 yangxianzhao <yangxianzhao@uniontech.com> - 5.4.43.27-5
- Repair user name related prompt information

* Wed Aug 10 2022 liweiganga <liweiganga@uniontech.com> - 5.4.43.27-4
- fix: issue#I5LI5A

* Fri Aug 05 2022 liweiganga <liweiganga@uniontech.com> - 5.4.43.27-3
- hide authorized

* Tue Aug 02 2022 liweiganga <liweiganga@unionttech.com> - 5.4.43.27-2
- Remove installation dependencies

* Mon Jul 18 2022 konglidong <konglidong@uniontech.com> - 5.4.43.27-1
- Update to 5.4.43.27

* Sun Jan 30 2022 liweigang <liweiganga@uniontech.com> - 5.3.0.54.4-2
- fix build error

* Wed Jul 07 2021 weidong <weidong@uniontech.com> - 5.3.0.54.4-1
- Update 5.3.0.54.4

* Fri Sep 4 2020 chenbo pan <panchenbo@uniontech.com> 5.1.0.19-3
- fix compile fail

* Fri Jul 03 2020 uniontech <uoser@uniontech.com> - 5.1.0.19-2
- Add dde.sh to profile.d

* Mon Jun 15 2020 uniontech <uoser@uniontech.com> - 5.1.0.19
- Remove the universal menu.

* Fri May 29 2020 uniontech <uoser@uniontech.com> - 5.0.30
- Project init.

