File scantailor.spec of Package scantailor

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


Name:           scantailor
Version:        0.9.11.1
Release:        0
Summary:        Interactive post-processing tool for scanned pages
License:        GPL-3.0+
Group:          Productivity/Graphics/Other
Url:            http://scantailor.sourceforge.net/
Source0:        http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Source1:        %{name}-icons.tar.bz2
BuildRequires:  boost-devel >= 1.42
BuildRequires:  cmake
BuildRequires:  hicolor-icon-theme
BuildRequires:  libqt4-devel >= 4.5
BuildRequires:  update-desktop-files
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Scan Tailor is an interactive post-processing tool for scanned pages.
It performs operations such as page splitting, deskewing,
adding/removing borders and others. You give it raw scans, and you get
pages ready to be printed or assembled into a PDF or DJVU file.

%package        cli
Summary:        Command line post-processing tool for scanned pages
Group:          Productivity/Graphics/Other

%description    cli
Scan Tailor is an interactive post-processing tool for scanned pages.
It performs operations such as page splitting, deskewing,
adding/removing borders and others. You give it raw scans, and you get
pages ready to be printed or assembled into a PDF or DJVU file.

This package provides command line version of scantailor.

%prep
%setup -q -a 1
cp -p resources/icons/{COPYING,COPYING.icons}

%build
%cmake ..
make %{?_smp_mflags} VERBOSE=1

%install
%cmake_install

for s in 256 128 96 72 64 48 32 16 ; do
install -Dm 0644 scantailor-icons/scantailor-${s}.png \
    %{buildroot}%{_datadir}/icons/hicolor/${s}x${s}/apps/scantailor.png
done
install -Dm 0644 resources/appicon.svg \
    %{buildroot}%{_datadir}/icons/hicolor/scalable/apps/scantailor.svg
# Create desktop-file
cat > %{name}.desktop << EOF
[Desktop Entry]
Name=Scan Tailor
GenericName=Post-Processing Tool for Scanned Pages
GenericName[ru]=Обработка отсканированных страниц
Type=Application
Exec=scantailor
Icon=scantailor
Categories=Graphics;Scanning;Qt;
Comment=Interactive Post-Processing Tool for Scanned Pages
Comment[ru]=Интерактивная обработка отсканированных страниц
StartupNotify=true
Terminal=false
EOF
%suse_update_desktop_file -i %{name}

%post
%icon_theme_cache_post

%postun
%icon_theme_cache_postun

%files
%defattr(-,root,root,-)
%doc COPYING GPL3.txt resources/icons/COPYING.icons
%{_datadir}/%{name}
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/%{name}.*

%files cli
%defattr(-,root,root,-)
%{_bindir}/%{name}-cli

%changelog