File trimage.spec of Package trimage

#
# spec file for package trimage
#
# Copyright (c) 2019 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 https://bugs.opensuse.org/
#


Name:           trimage
Version:        1.0.6
Release:        0
Summary:        Tool for Losslessly Optimizing PNG and JPEG Files
License:        MIT
Group:          Productivity/Graphics/Other
URL:            http://trimage.org/
Source0:        https://github.com/Kilian/Trimage/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  hicolor-icon-theme
BuildRequires:  python3-setuptools
BuildRequires:  update-desktop-files
Requires:       advancecomp
Requires:       jpegoptim
Requires:       optipng
Requires:       pngcrush
Requires:       python3-qt5
BuildArch:      noarch

%description
Trimage is a cross-platform GUI and command-line interface to optimize
image files via optipng, pngcrush, advpng and jpegoptim, depending on
the filetype (currently, PNG and JPEG files are supported). It was
inspired by imageoptim. All image files are losslessy compressed on
the highest available compression levels. Trimage gives you various
input functions to fit your own workflow: a regular file dialog,
dragging and dropping and various command line options.

%prep
%setup -q -n Trimage-%{version}
# Fix wrong end-of-line encoding.
sed -i 's/.$//' \
    trimage/ThreadPool/ThreadPool.py

# Remove shebang.
sed -i '1,2d' \
    trimage/*.py \
    trimage/ThreadPool/ThreadPool.py

%build

%install
python3 setup.py install \
    --root=%{buildroot} \
    --prefix=%{_prefix}
%suse_update_desktop_file -N Trimage -G "Image Compressor" %{name} Graphics RasterGraphics

%files
%license COPYING
%doc README.md TODO.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.*
%{python3_sitelib}/*
%{_mandir}/man?/*

%changelog