%define    _name    image-editor

Name:           deepin-image-editor
Version:        1.0.21
Release:        1
Summary:        Libraries of Deepin Image editor
License:        GPL-3.0-or-later
Group:          System/Libraries
URL:            https://github.com/linuxdeepin/image-editor
Source0:        https://github.com/linuxdeepin/%{_name}/archive/%{version}/%{_name}-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  glib2-devel
BuildRequires:  deepin-gettext-tools
BuildRequires:  dtkwidget-devel
BuildRequires:  fdupes
BuildRequires:  freeimage-devel
BuildRequires:  qt5-qttools
BuildRequires:  opencv
BuildRequires:  libmediainfo-devel
BuildRequires:  cmake(Qt5LinguistTools)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5PrintSupport)
BuildRequires:  ffmpegthumbnailer-devel
# libmediainfo
BuildRequires:  tinyxml2

%description
Libraries of Deepin Image editor

%package -n libimagevisualresult-data
Summary:        Data files for libimagevisualresult
Group:          System/Libraries

%description -n libimagevisualresult-data
The package provides date for Deepin Image editor.

%package -n libimageviewer
Summary:        The library of Deepin Image editor
Group:          System/Libraries
Recommends:     %{name}-lang

%description -n libimageviewer
This package contains the libraries for Deepin Image editor.

%package -n libimagevisualresult
Summary:        The library of Deepin Image editor
Group:          System/Libraries
Requires:       libimagevisualresult-data = %{version}

%description -n libimagevisualresult
This package contains the libraries for Deepin Image editor.

%package -n libimageviewer-devel
Summary:        The library of Deepin Image editor
Group:          Development/Libraries/X11
Requires:       libimageviewer
Provides:       pkgconfig(libimageviewer) = 0.1.0
AutoReqProv:    Off

%description -n libimageviewer-devel
The libimageviewer-devel package contains the header files and developer docs
for Deepin Image editor.

%package -n libimagevisualresult-devel
Summary:        The library of Deepin Image editor
Group:          Development/Libraries/X11
Requires:       libimagevisualresult

%description -n libimagevisualresult-devel
The libimagevisualresult-devel package contains the header files and developer
docs for Deepin Image editor.

%prep
%autosetup -p1 -n %{_name}-%{version}

%build
%cmake -DCMAKE_BUILD_TYPE=Release
mkdir Build && cd Build
%cmake ../

%install
%make_install

%find_lang libimageviewer --with-qt
%fdupes %{buildroot}

%post -n libimageviewer -p /sbin/ldconfig
%postun -n libimageviewer -p /sbin/ldconfig

%post -n libimagevisualresult -p /sbin/ldconfig
%postun -n libimagevisualresult -p /sbin/ldconfig

%files
%doc README.md
%license LICENSE.txt

%files -n libimagevisualresult-data
%doc README.md
%license LICENSE.txt
%dir %{_datadir}/libimagevisualresult
%dir %{_datadir}/libimagevisualresult/filter_cube
%{_datadir}/libimagevisualresult/filter_cube/*.CUBE
%{_datadir}/libimagevisualresult/filter_cube/*.dat

%files -n libimageviewer
%{_libdir}/libimageviewer.so.*

%files -n libimagevisualresult
%{_libdir}/libimagevisualresult.so.*

%files -n libimageviewer-devel
%doc README.md
%license LICENSE.txt
%{_includedir}/libimageviewer
%{_libdir}/libimageviewer.so
%{_libdir}/pkgconfig/libimageviewer.pc

%files -n libimagevisualresult-devel
%doc README.md
%license LICENSE.txt
%{_includedir}/libimagevisualresult
%{_libdir}/libimagevisualresult.so
%{_libdir}/pkgconfig/libimagevisualresult.pc

%files -f libimageviewer.lang
%dir %{_datadir}/libimageviewer
%dir %{_datadir}/libimageviewer/translations
%{_datadir}/libimageviewer/translations/libimageviewer.qm

%changelog
* Fri Nov 18 2022 liweiganga <liweiganga@uniontech.com> - 1.0.21-1
- init package
