deepin-dock/0002-feat-Initial-packit-setup.patch
Robin Lee 85aee2bd33 [packit] 5.11.0.13 upstream release
Upstream tag: 5.11.0.13
Upstream commit: 5d834e99

Signed-off-by: Robin Lee <cheeselee@fedoraproject.org>
2020-11-10 17:12:14 +08:00

154 lines
4.7 KiB
Diff

From 5d834e9942827696ee240db14128bd8da567d8eb Mon Sep 17 00:00:00 2001
From: Robin Lee <cheeselee@fedoraproject.org>
Date: Thu, 22 Oct 2020 14:56:42 +0800
Subject: [PATCH 2/2] feat: Initial packit setup
This commit contains the specfile for building the official package for Fedora
with a Packit setup.
Ultimately, a unified specfile is targeted for Fedora and any other rpm-based
distributions, e.g. openEuler.
And Packit(https://packit.dev/) is a tool for maintaining specfile within
upstream source. It requires a simple config file(.packit.yaml).
Log: Initial packit setup
Signed-off-by: Robin Lee <cheeselee@fedoraproject.org>
---
rpm/dde-dock.spec | 66 +++++++++++++++++++++++++++++++++++------------
1 file changed, 49 insertions(+), 17 deletions(-)
diff --git a/rpm/dde-dock.spec b/rpm/dde-dock.spec
index ef295e29..3d5cb940 100644
--- a/rpm/dde-dock.spec
+++ b/rpm/dde-dock.spec
@@ -1,18 +1,31 @@
%global sname deepin-dock
-
-Name: dde-dock
-Version: 5.1.0.13
-Release: 1
+%global repo dde-dock
+%global __provides_exclude_from ^%{_libdir}/%{repo}/.*\\.so$
+
+%if 0%{?fedora}
+%global start_logo start-here
+Name: %{sname}
+%else
+Name: %{repo}
+%endif
+Version: 5.3.0.13
+Release: 1%{?fedora:%dist}
Summary: Deepin desktop-environment - Dock module
License: GPLv3
+%if 0%{?fedora}
+URL: https://github.com/linuxdeepin/dde-dock
+Source0: %{url}/archive/%{version}/%{repo}-%{version}.tar.gz
+%else
URL: http://shuttle.corp.deepin.com/cache/repos/eagle/release-candidate/RERFNS4wLjAuNjU3NQ/pool/main/d/dde-dock/
Source0: %{name}_%{version}.orig.tar.xz
+%endif
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: pkgconfig(dbusmenu-qt5)
BuildRequires: pkgconfig(dde-network-utils)
BuildRequires: dtkwidget-devel >= 5.1
+BuildRequires: dtkgui-devel >= 5.2.2.16
BuildRequires: dtkcore-devel >= 5.1
BuildRequires: pkgconfig(dframeworkdbus) >= 2.0
BuildRequires: pkgconfig(gsettings-qt)
@@ -31,11 +44,16 @@ BuildRequires: pkgconfig(xcb-icccm)
BuildRequires: pkgconfig(xcb-image)
BuildRequires: qt5-linguist
Requires: dbusmenu-qt5
+%if 0%{?fedora}
+BuildRequires: qt5-qtbase-private-devel
+Requires: deepin-network-utils
+Requires: deepin-qt-dbus-factory
+%else
Requires: dde-network-utils
Requires: dde-qt-dbus-factory
+%endif
Requires: xcb-util-wm
Requires: xcb-util-image
-Requires: libxcb
%description
Deepin desktop-environment - Dock module.
@@ -55,45 +73,59 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
deepin desktop-environment - dock plugin.
%prep
-%setup -q -n %{name}-%{version}
+%autosetup -p1 -n %{repo}-%{version}
sed -i '/TARGETS/s|lib|%{_lib}|' plugins/*/CMakeLists.txt \
plugins/plugin-guide/plugins-developer-guide.md
-sed -i -E '30,39d' CMakeLists.txt
-
sed -i 's|/lib|/%{_lib}|' frame/controller/dockpluginscontroller.cpp \
frame/panel/mainpanelcontrol.cpp \
plugins/tray/system-trays/systemtrayscontroller.cpp
-sed -i 's|/lib|/libexec|g' plugins/show-desktop/showdesktopplugin.cpp
+sed -i 's|/lib|/libexec|g' plugins/show-desktop/showdesktopplugin.cpp \
+ frame/panel/mainpanelcontrol.cpp
+
+sed -i 's:libdir.*:libdir=%{_libdir}:' dde-dock.pc
sed -i 's|/usr/lib/dde-dock/plugins|%{_libdir}/dde-dock/plugins|' plugins/plugin-guide/plugins-developer-guide.md
sed -i 's|local/lib/dde-dock/plugins|local/%{_lib}/dde-dock/plugins|' plugins/plugin-guide/plugins-developer-guide.md
+%if 0%{?fedora}
+# set icon to Fedora logo
+sed -i 's|deepin-launcher|%{start_logo}|' frame/item/launcheritem.cpp
+%endif
+
%build
export PATH=%{_qt5_bindir}:$PATH
+%if 0%{?fedora}
+%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=%{_arch}
+%cmake_build
+%else
%cmake -DCMAKE_INSTALL_PREFIX=%{_prefix} -DARCHITECTURE=%{_arch} .
%make_build
+%endif
%install
+%if 0%{?fedora}
+%cmake_install
+%else
%make_install INSTALL_ROOT=%{buildroot}
-
-%ldconfig_scriptlets
+%endif
%files
%license LICENSE
-%{_sysconfdir}/%{name}/indicator/keybord_layout.json
-%{_bindir}/%{name}
-%{_libdir}/%{name}/
-%{_datadir}/%{name}/
+%{_sysconfdir}/%{repo}/
+%{_bindir}/%{repo}
+%{_libdir}/%{repo}/
+%{_datadir}/%{repo}/
%{_datadir}/dbus-1/services/*.service
%{_datarootdir}/glib-2.0/schemas/com.deepin.dde.dock.module.gschema.xml
%{_datarootdir}/polkit-1/actions/com.deepin.dde.dock.overlay.policy
%files devel
-%{_includedir}/%{name}/
-%{_libdir}/pkgconfig/%{name}.pc
+%doc plugins/plugin-guide
+%{_includedir}/%{repo}/
+%{_libdir}/pkgconfig/%{repo}.pc
%{_libdir}/cmake/DdeDock/DdeDockConfig.cmake
%files onboard-plugin
--
2.26.2