File diffpdf.spec of Package diffpdf

#
# spec file for package diffpdf
#
# Copyright (c) 2020 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/
#


Name:           diffpdf
Version:        2.1.3.1
Release:        0
Summary:        PDF Files Comparator
License:        GPL-2.0-or-later
Group:          Productivity/Publishing/PDF
URL:            https://gitlab.com/eang/diffpdf/
Source0:        https://gitlab.com/eang/diffpdf/-/archive/v%{version}/%{name}-v%{version}.tar.gz
BuildRequires:  ImageMagick
BuildRequires:  cmake
BuildRequires:  extra-cmake-modules
BuildRequires:  hicolor-icon-theme
BuildRequires:  libQt5PrintSupport-devel
BuildRequires:  libqt5-linguist-devel
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(poppler-qt5)

%description
DiffPDF is used to compare two PDF files, textually or visually.

%prep
%setup -q -n %{name}-v%{version}

%build
%cmake
%cmake_build

%install
install -Dm 0755 build/%{name} \
    %{buildroot}%{_bindir}/%{name}
install -Dm 0644 build/%{name}.1 \
    %{buildroot}%{_mandir}/man1/%{name}.1
install -Dm 0644 images/icon.png \
    %{buildroot}%{_datadir}/icons/hicolor/64x64/apps/%{name}.png
for size in 48x48 32x32 22x22 16x16 ; do
install -dm 0755 \
    %{buildroot}%{_datadir}/icons/hicolor/${size}/apps
convert -resize ${size} images/icon.png \
    %{buildroot}%{_datadir}/icons/hicolor/${size}/apps/%{name}.png
done
%suse_update_desktop_file -c %{name} DiffPDF "PDF Files Comparator" %{name} %{name} Development Documentation Office Viewer

%post
%icon_theme_cache_post

%postun
%icon_theme_cache_postun

%files
%doc CHANGES gpl-2.0.txt README
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.*
%{_mandir}/man?/*

%changelog
openSUSE Build Service is sponsored by