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.0.44
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
Group:          System/GUI/Other
BuildRequires:  cmake
BuildRequires:  deepin-desktop-base
BuildRequires:  deepin-gettext-tools
BuildRequires:  deepin-pw-check-devel
BuildRequires:  desktop-file-utils
BuildRequires:  doxygen
BuildRequires:  dtkcommon >= 5.5.20
BuildRequires:  dtkcore >= 5.6.20
BuildRequires:  fdupes
BuildRequires:  gtest
BuildRequires:  libQt5Gui-private-headers-devel
BuildRequires:  libQt5Widgets-private-headers-devel
BuildRequires:  libqt5-linguist
BuildRequires:  libqt5-qttools-qhelpgenerator
BuildRequires:  libqt5-qtwayland-private-headers-devel
BuildRequires:  update-desktop-files
BuildRequires:  cmake(KF5NetworkManagerQt)
BuildRequires:  cmake(KF5Wayland)
BuildRequires:  cmake(PolkitQt5-1)
BuildRequires:  cmake(Qt5XkbCommonSupport)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5WaylandClient)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(dareader)
BuildRequires:  pkgconfig(dde-network-utils)
BuildRequires:  pkgconfig(dframeworkdbus) >= 2.0
BuildRequires:  pkgconfig(dtkcore) >= 5.0.0
BuildRequires:  pkgconfig(dtkwidget) >= 5.0.0
BuildRequires:  pkgconfig(icu-i18n)
BuildRequires:  pkgconfig(gsettings-qt)
BuildRequires:  pkgconfig(udisks2-qt5)
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:       libqt5-qdbus
Requires:       qt5integration
Requires:       redshift
Recommends:     %{name}-data
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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

%package -n libdcc-interface%{sover}
Summary:        Library for deepin-control-center interface
Group:          System/Libraries
Requires:       %{name} = %{version}

%description -n libdcc-interface%{sover}
Deepin Control Center interface library

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

%description -n libdcc-widgets%{sover}
Deepin Control Center widgets library

%package devel
Summary:        Development tools for deepin-control-center
Group:          Development/Languages/C and C++
Requires:       libdcc-interface%{sover} = %{version}
Requires:       libdcc-widgets%{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 's|lrelease|lrelease-qt5|g' misc/translate_generation.sh
sed -i 's|lupdate|lupdate-qt5|g' misc/lupdate.sh
# sed -i 's/DESTINATION lib/DESTINATION ${CMAKE_INSTALL_LIBDIR}/g' src/frame/CMakeLists.txt
# sed -i 's|qdbus|qdbus-qt5|g' com.deepin.dde.ControlCenter.service dde-control-center-wapper

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

%install
%cmake_install

sed -i 's/OnlyShowIn=/X-DEEPIN-OnlyShowIn/g' \
%{buildroot}%{_datadir}/applications/%{_name}.desktop
chmod -x %{buildroot}%{_datadir}/applications/%{_name}.desktop
%suse_update_desktop_file -r %{_name} 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 libdcc-interface%{sover} -p /sbin/ldconfig
%postun -n libdcc-interface%{sover} -p /sbin/ldconfig

%post -n libdcc-widgets%{sover} -p /sbin/ldconfig
%postun -n libdcc-widgets%{sover} -p /sbin/ldconfig

%files
%doc README.md README.zh_CN.md
%license LICENSE
%{_bindir}/%{_name}
%{_libdir}/%{_name}
%{_datadir}/applications/%{_name}.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

%files -n libdcc-interface%{sover}
%{_libdir}/libdcc-interface.so.*

%files -n libdcc-widgets%{sover}
%{_libdir}/libdcc-widgets.so.*

%files devel
%{_libdir}/libdcc-interface.so
%{_libdir}/libdcc-widgets.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

%changelog
openSUSE Build Service is sponsored by