File deepin-control-center.spec of Package deepin-control-center

#
# spec file for package deepin-control-center
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define _name dde-control-center
%define sover 6

Name:           deepin-control-center
Version:        6.1.24
Release:        0
Summary:        New control center for Linux Deepin
License:        LGPL-3.0-or-later
URL:            https://github.com/linuxdeepin/dde-control-center
Source0:        https://github.com/linuxdeepin/dde-control-center/archive/%{version}/%{_name}-%{version}.tar.gz
Patch0:         fix-qt6-tools-linguist.patch
Patch1:         fix-plugins-path.patch
Group:          System/GUI/Other
BuildRequires:  cmake
BuildRequires:  chrpath
BuildRequires:  deepin-desktop-base
BuildRequires:  deepin-gettext-tools
BuildRequires:  deepin-pw-check-devel
BuildRequires:  desktop-file-utils
BuildRequires:  dtk6core
BuildRequires:  doxygen
BuildRequires:  fdupes
BuildRequires:  gtest
BuildRequires:  qt6-tools-linguist 
BuildRequires:  qt6-wayland-private-devel
BuildRequires:  update-desktop-files
BuildRequires:  cmake(DDEShell)
BuildRequires:  cmake(KF6NetworkManagerQt)
BuildRequires:  cmake(Qt6WaylandClient)
BuildRequires:  cmake(PolkitQt6-1)
BuildRequires:  pkgconfig(Qt6Concurrent)
BuildRequires:  pkgconfig(Qt6Core)
BuildRequires:  pkgconfig(Qt6DBus)
BuildRequires:  pkgconfig(Qt6Multimedia)
BuildRequires:  pkgconfig(Qt6Linguist)
BuildRequires:  pkgconfig(Qt6Sql)
BuildRequires:  pkgconfig(Qt6Svg)
BuildRequires:  pkgconfig(Qt6WaylandClient)
BuildRequires:  pkgconfig(Qt6Xml)
BuildRequires:  pkgconfig(Qt6Test)
BuildRequires:  pkgconfig(dareader)
BuildRequires:  pkgconfig(dtk6core)
BuildRequires:  pkgconfig(dtk6widget)
BuildRequires:  pkgconfig(icu-i18n)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(systemd)
BuildRequires:  pkgconfig(treeland-protocols)
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(xcb-ewmh)
BuildRequires:  pkgconfig(xext)
BuildRequires:  pkgconfig(xkbcommon)
Requires:       deepin-account-faces
Requires:       deepin-application-manager >= 1.1.0
Requires:       deepin-api
Requires:       deepin-daemon
Requires:       deepin-start
Requires:       libdeepin_pw_check1
Requires:       qt6-tools-qdbus
Requires:       deepin-integration-qt6
Requires:       redshift
Recommends:     %{name}-lang
Recommends:     %{name}-plugin-network
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The deepin-control-center is the control panel of Deepin Desktop.

%package -n lib%{_name}%{sover}
Summary:        Library for deepin-control-center
Group:          System/Libraries

%description -n lib%{_name}%{sover}
Deepin Control Center library

%package devel
Summary:        Development tools for deepin-control-center
Group:          Development/Languages/C and C++
Requires:       lib%{_name}%{sover} = %{version}

%description devel
The deepin-control-center-devel package contains the header files and developer
docs for deepin control center.

%lang_package

%prep
%autosetup -p1 -n %{_name}-%{version}
sed -i '/plugin-privacy/s/^/#/' CMakeLists.txt

%build
%cmake -DDISABLE_UPDATE=ON \
       -DDISABLE_AUTHENTICATION=ON \
       -DDISABLE_LANGUAGE=ON \
       -DCMAKE_INSTALL_LIBDIR=%{_libdir} \
       -DCVERSION=%{version}
%cmake_build

%install
%cmake_install

chrpath --delete %{buildroot}%{_libdir}/%{_name}/plugins_v1.0/*/*.so
chrpath --delete  %{buildroot}%{_libdir}/%{_name}/org/deepin/dcc/libdde-control-center-plugin.so

sed -i 's/OnlyShowIn=/X-DEEPIN-OnlyShowIn/g' \
%{buildroot}%{_datadir}/applications/org.deepin.dde.control-center.desktop
chmod -x %{buildroot}%{_datadir}/applications/org.deepin.dde.control-center.desktop
%suse_update_desktop_file -r org.deepin.dde.control-center Settings DesktopSettings X-SuSE-Core-System
rm -rf %{buildroot}%{_datadir}/polkit-1/actions/com.deepin.controlcenter.develop.policy
rm -rf %{buildroot}%{_datadir}/dman

%find_lang %{_name} --with-qt
%find_lang keyboard_language --with-qt
%find_lang datetime_language --with-qt
%find_lang datetime_country --with-qt
%fdupes %{buildroot}

%post -n lib%{_name}%{sover} -p /sbin/ldconfig
%postun -n lib%{_name}%{sover} -p /sbin/ldconfig

%files
%doc README.md README.zh_CN.md
%license LICENSE
%{_bindir}/%{_name}
%{_libdir}/%{_name}
%{_datadir}/applications/org.deepin.dde.control-center.desktop
%{_datadir}/dbus-1/services/*.service
%{_datadir}/metainfo/org.deepin.dde.controlcenter.metainfo.xml
%{_datadir}/dsg/configs/org.deepin.region-format.json
%dir %{_datadir}/%{_name}/
#%{_datadir}/%{_name}/developdocument.html
%dir %{_datadir}/dsg
%dir %{_datadir}/dsg/configs
%dir %{_datadir}/dsg/configs/org.deepin.dde.control-center
%{_datadir}/dsg/configs/org.deepin.dde.control-center/*.json
#%{_datadir}/qt5/doc/dde-control-center.qch
%{_userunitdir}/org.deepin.dde.control-center.service
%dir %{_libdir}/dde-grand-search-daemon
%dir %{_libdir}/dde-grand-search-daemon/plugins
%dir %{_libdir}/dde-grand-search-daemon/plugins/searcher
%{_libdir}/dde-grand-search-daemon/plugins/searcher/org.deepin.dde-grand-search.dde-control-center-setting.conf

%files -n lib%{_name}%{sover}
%{_libdir}/lib%{_name}.so.*

%files devel
%{_libdir}/lib%{_name}.so
%{_includedir}/%{_name}
%{_libdir}/cmake/DdeControlCenter

%files lang -f %{_name}.lang -f keyboard_language.lang -f datetime_language.lang -f datetime_country.lang
%dir %{_datadir}/dde-control-center/translations
%dir %{_datadir}/dde-control-center/translations/v1.0
%if 0%{?suse_version} < 1600
%lang(ady) %{_datadir}/dde-control-center/translations/v1.0/*_ady.qm
%lang(ast) %{_datadir}/dde-control-center/translations/v1.0/*_ast.qm
%lang(bqi) %{_datadir}/dde-control-center/translations/v1.0/*_bqi.qm
%lang(cgg) %{_datadir}/dde-control-center/translations/v1.0/*_cgg.qm
%lang(fil) %{_datadir}/dde-control-center/translations/v1.0/*_fil.qm
%lang(kab) %{_datadir}/dde-control-center/translations/v1.0/*_kab.qm
%lang(pam) %{_datadir}/dde-control-center/translations/v1.0/*_pam.qm
%lang(tzm) %{_datadir}/dde-control-center/translations/v1.0/*_tzm.qm
%endif

%changelog
openSUSE Build Service is sponsored by