File kim.spec of Package kim

#
# spec file for package 
#
# Copyright (c) 2019-2024 Walter Fey, DL8FCL
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# 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 http://bugs.opensuse.org/
#

%define _menus5 /kservices5/ServiceMenus
Name:           kim
Version:        0.9.5
Release:        0
Summary:        A very useful images Kde servicemenu
License:        GPL-2.0-or-later
Group:          Productivity/Graphics/Convertors
URL:            http://bouveyron.free.fr/kim/
Source:         kim4-%{version}.tar.gz
Patch0:         kim-icons-fix-and-de-translation.diff
Patch1:         kim-add-Rsize4096.diff
BuildRequires:  dos2unix
Requires:       ImageMagick
BuildArch:      noarch

%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
%setup -q -n kim4
%patch -P 0 -p1
%patch -P 1 -p1

dos2unix     manual/work.css
chmod 644 manual/work.css

rm src/bin/*~

%build

%install

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


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

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

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


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

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

%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog README
%doc manual/*
%{_bindir}/kim*
%{_datadir}/%{_menus5}/kim_compressandresize.desktop
%{_datadir}/%{_menus5}/kim_convertandrotate.desktop
%{_datadir}/%{_menus5}/kim_publication.desktop
%{_datadir}/kim/
%dir %{_datadir}/kservices5
%{_datadir}/%{_menus5}/

%changelog
openSUSE Build Service is sponsored by