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

#
# spec file for package deepin-control-center
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#

%define _name dde-control-center
%define deepin_version %(rpm -q --queryformat '%%{VERSION}' deepin-desktop-base)

Name:           deepin-control-center
Version:        4.4.0
Release:        0
Summary:        New control center for Linux Deepin
License:        GPL-3.0
URL:            https://github.com/linuxdeepin/dde-control-center
Source0:        https://github.com/linuxdeepin/dde-control-center/archive/%{version}/%{_name}-%{version}.tar.gz
Source1:        distributor.png
Source2:        distributor-big.png
Source99:       %{name}-rpmlintrc
Group:          System/GUI/Other
BuildRequires:  update-desktop-files
BuildRequires:  desktop-file-utils
BuildRequires:  deepin-dock-devel
BuildRequires:  deepin-desktop-base
BuildRequires:  pkgconfig(dtkwidget)
BuildRequires:  pkgconfig(dtkcore)
BuildRequires:  pkgconfig(dframeworkdbus)
BuildRequires:  pkgconfig(gsettings-qt)
BuildRequires:  pkgconfig(geoip)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Sql)
BuildRequires:  pkgconfig(Qt5Xml)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  libqt5-linguist
Requires:       deepin-account-faces
Requires:       deepin-api
Requires:       deepin-daemon
Requires:       qt5integration
Requires:       deepin-start
Requires:       polkit
Recommends:     %{name}-plugins
Recommends:     %{name}-data
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

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

%package plugins
Summary:        Plugins of deepin-control-center
Requires:       %{name} = %{version}

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

deepin-control-center-plugins is the plugins of deepin-control-center.

%package data
Summary:        Data of deepin-control-center
Requires:       %{name} = %{version}

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

deepin-control-center-data is the data of deepin-control-center.

%lang_package

%prep
%setup -q -n %{_name}-%{version}
sed -i 's|lrelease|lrelease-qt5|g' translate_generation.sh

sed -i 's|com_deepin_wm_switcher.h|com_deepin_wmswitcher.h|g' modules/personalization/personalizationwork.h
sed -i -E '/target.path|utils.path/s|lib|%{_lib}|' plugins/*/*.pro
sed -i 's|lib|%{_lib}|' frame/pluginscontroller.cpp
    
# sed -i 's|Copyright © 2011-2017 Wuhan Deepin Technology Co., Ltd.|Deepin Desktop %{deepin_version} Copyright © \\n 2011-2017 Wuhan Deepin Technology Co., Ltd.|g' \
# modules/systeminfo/systeminfowidget.cpp
# sed -i 's|Copyright © 2011-2017 Wuhan Deepin Technology Co., Ltd.|Deepin Desktop %{deepin_version} Copyright © \n 2011-2017 Wuhan Deepin Technology Co., Ltd.|g' \translations/dde-control-center_*.ts 
# sed -i 's|Edition License|Deepin Desktop Edition License|g' translations/dde-control-center_*.ts modules/systeminfo/systeminfowidget.cpp
# sed -i 's|Copyright © 2011-2017 武汉深之度科技有限公司|深度桌面 %{deepin_version} Copyright © \n 2011-2017 武汉深之度科技有限公司|g' \
# translations/dde-control-center_zh_CN.ts
# sed -i 's|版本协议|深度桌面版本协议|g' translations/dde-control-center_zh_CN.ts
# sed -i 's|版本許可證|深度桌面版本許可證|g' translations/dde-control-center_zh_TW.ts

# cp %{SOURCE1} modules/systeminfo/themes/dark/icons/logo.png
# cp %{SOURCE2} modules/systeminfo/themes/dark/icons/logo@2x.png
# cp %{SOURCE1} modules/systeminfo/themes/light/icons/logo.png

%build
%qmake5 PREFIX=%{_prefix} \
    QMAKE_CFLAGS_ISYSTEM= \
    WITH_MODULE_GRUB=NO \
    WITH_MODULE_REMOTE_ASSIST=NO \
    WITH_MODULE_SYSINFO_UPDATE=NO \
    DISABLE_SYS_UPDATE=YES
make %{?_smp_mflags}

%install
%qmake5_install

sed -i 's/OnlyShowIn=/X-DEEPIN-OnlyShowIn/g' \
%{buildroot}%{_datadir}/applications/%{_name}.desktop
chmod 0644 %{buildroot}%{_datadir}/applications/%{_name}.desktop
%suse_update_desktop_file -r %{_name} Settings DesktopSettings X-SuSE-Core-System

%post plugins -p /sbin/ldconfig
%postun plugins -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc README.md LICENSE CHANGELOG.md
%{_bindir}/%{_name}
%dir %{_libexecdir}/%{_name}
%{_libexecdir}/%{_name}/reboot-reminder-dialog
%{_datadir}/applications/%{_name}.desktop
%{_datadir}/dbus-1/services/*.service
%dir %{_datadir}/polkit-1
%dir %{_datadir}/polkit-1/actions
%{_datadir}/polkit-1/actions/com.deepin.controlcenter.addomain.policy
%dir %{_datadir}/%{_name}/

%files plugins
%defattr(-,root,root,-)
%dir %{_libdir}/%{_name}
%{_libdir}/%{_name}/plugins

%files data
%defattr(-,root,root,-)
%{_datadir}/%{_name}/*db

%files lang
%defattr(-,root,root,-)
%{_datadir}/%{_name}/translations/

%changelog
openSUSE Build Service is sponsored by