File kim5.spec of Package kim5

#
# spec file for package kim
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2015 Walter Fey, DL8FCL
# Copyright (c) 2011-2013 LISA GmbH, Bingen, Germany.
# Copyright (c) 2005-2010 oc2pus
#
# 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/
#


%define _menus  /kio/servicemenus
Name:           kim5
Version:        0.9.6
Release:        lp156.3.1
Summary:        A very useful images Kde servicemenu
License:        GPL-2.0-or-later
Group:          Productivity/Graphics/Convertors
URL:            https://github.com/caco3/kim5
Source:         kim5-0.9.6.tar.gz
# New sources as like store.kde.org have https://github.com/caco3/kim5
# PATCH-MISSING-TAG -- See http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch0:         kim5-de-translation.patch
Patch1:         kim5-plasma6.patch
BuildRequires:  dos2unix
BuildRequires:  kdelibs4support-devel
BuildRequires:  libKF5KDELibs4Support5
Requires:       ImageMagick
Requires:       kdialog
# for video recompression/resizing
Suggests:       ffmpeg
BuildArch:      noarch
Obsoletes:      kim <= 0.9.5
Conflicts:      kim <= 0.9.5
Provides:       kim = 0.9.6

%description
Kim is a kde service menu which allows to resize, convert, rotate, ( ...) your
images without to use a graphical application like Gimp! This service menu can
be considered as a frontend of ImageMagick.

Main features of Kim:
Compress and resize
    * Compress to 70%, 80%, 90% or other,
    * Resize to 300x225, 600x450, 800x600, 1024x768, 1200x900 px or other,
    * Resize and compress for the web.

Convert and rotate
    * Convert in JPG, PNG, GIF, TIFF or other,
    * Rotate images.

Treatment and publication
    * Rename images,
    * Convert in grayscale,
    * Add a whith or black border,
    * Watermarck images,
    * Send by mail resized images.

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

cd kim/

dos2unix     manual/work.css
chmod 644 AUTHORS ChangeLog README manual/*

%build

%install

cd kim/

install -dm 755 %{buildroot}%{_datadir}%{_menus}
install -m 644 src/kim_*.desktop %{buildroot}%{_datadir}%{_menus}

install -dm 755 %{buildroot}%{_bindir}
install -m 755 src/bin/kim_* %{buildroot}%{_bindir}

install -dm 755 %{buildroot}%{_datadir}/kim5/slideshow
install -m 644 src/slideshow/* %{buildroot}%{_datadir}/kim5/slideshow

install -dm 755 %{buildroot}%{_datadir}/kim5/gallery
install -m 644 src/gallery/* %{buildroot}%{_datadir}/kim5/gallery


%post
for i in imageconverter jpegorient; do
	if [ -e %{_datadir}%{_menus}/$i.desktop ]; then
		mv %{_datadir}%{_menus}/$i.desktop \
			%{_datadir}%{_menus}/$i.desktop~ 2> /dev/null
	fi
done

%postun
for i in imageconverter jpegorient; do
	if [ -e %{_datadir}%{_menus}/$i.desktop~ ]; then
		mv %{_datadir}%{_menus}/$i.desktop~ \
			%{_datadir}%{_menus}/$i.desktop 2> /dev/null
	fi
done

%files
%defattr(-,root,root)
%license LICENSE
%doc kim/AUTHORS kim/ChangeLog kim/README
%doc KIM5.png README.md 
%doc kim/manual/*
%{_bindir}/kim*
%dir %{_datadir}/kio
%dir %{_datadir}%{_menus}
%{_datadir}%{_menus}/kim_compressandresize.desktop
%{_datadir}%{_menus}/kim_convertandrotate.desktop
%{_datadir}%{_menus}/kim_publication.desktop
%{_datadir}%{_menus}/kim_compressandresizevideo.desktop
%{_datadir}/kim5/

%changelog
* Wed Oct 13 2021 Edgar Aichinger <edogawa@aon.at>
- small fix in german translation
* Sat Sep 11 2021 Edgar Aichinger <edogawa@aon.at>
- update to github commit d023d22
* Sun Apr 11 2021 Edgar Aichinger <edogawa@aon.at>
- initial package, github commit de8937f, based on home:bruno_friedmann/kim
openSUSE Build Service is sponsored by