Name:           deepin-draw
Version:        5.10.6
Release:        3
Summary:        A lightweight drawing tool for Linux Deepin
License:        GPLv3+
URL:            https://github.com/linuxdeepin/%{name}
Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch1:         0001-fix-coredump-in-clearChildLayout-function.patch
Patch2:         fix-not-open-ddf-file.patch

BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  freeimage-devel
BuildRequires:  dtkcore-devel
BuildRequires:  dtkwidget-devel
BuildRequires:  pkgconfig(libexif)
BuildRequires:  pkgconfig(xcb-aux)
BuildRequires:  pkgconfig(Qt5)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Multimedia)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  qt5-linguist
BuildRequires:  desktop-file-utils

Requires:       dde-qt5integration
Recommends:     deepin-manual

%description
%{summary}.

%prep
%autosetup -p1

%build
# help find (and prefer) qt5 utilities, e.g. qmake, lrelease
export PATH=%{_qt5_bindir}:$PATH
mkdir build && pushd build
%cmake -DCMAKE_BUILD_TYPE=Release -DAPP_VERSION=%{version} -DVERSION=%{version}  ../
%make_build
popd

%install
%make_install -C build INSTALL_ROOT="%buildroot"

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

%files
%doc README.md
%license LICENSE
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/deepin-manual/manual-assets/application/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/dbus-1/services/com.deepin.Draw.service
%{_datadir}/icons/deepin/apps/scalable/%{name}.svg
%{_datadir}/icons/hicolor/scalable/apps/%{name}.svg
%{_datadir}/%{name}/translations/*.qm
%{_datadir}/application/x-ddf.xml
%{_datadir}/mime/packages/deepin-draw.xml

%changelog
* Fri Dec 20 2024 liweigang <liweiganga@uniontech.com> - 5.10.6-3
- fix: fix quitapp

* Wed Dec 11 2024 lvgenggeng <lvgenggeng@uniontech.com> - 5.10.6-2
- fix: fix coredump in clearChildLayout function

* Wed May 17 2023 leeffo <liweiganga@uniontech.com> - 5.10.6-1
- update to 5.10.6

* Tue Jul 19 2022 loong_C <loong_c@yeah.net> - 5.9.9-1
- update to 5.9.9

* Sat May 08 2021 weidong <weidong@uniontech.com> - 5.8.0.58-1
- Initial package.
