File kde-servicemenu-kim.spec of Package kde-servicemenu-kim

#
# spec file for package kde-servicemenu-kim
#
# Copyright (c) 2024 Asterios Dramis <asterios.dramis@gmail.com>
#
# 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.


%define git_version d023d227445b6b6ae400ebf0908d88af228f6eee
Name:           kde-servicemenu-kim
Version:        0.9.5+git.%{git_version}
Release:        0
Summary:        KDE Service Menu for Images
License:        GPL-2.0-or-later
Group:          System/GUI/KDE
URL:            https://github.com/caco3/kim5/
Source0:        https://github.com/caco3/kim5/archive/%{git_version}.zip#/kim5-%{version}.zip
BuildRequires:  gettext-runtime
BuildRequires:  kf6-filesystem
BuildRequires:  unzip
Requires:       ImageMagick
Requires:       dolphin
Requires:       ffmpeg
Requires:       kdelibs4support
Requires:       kdialog
Requires:       xwd
Recommends:     %{name}-lang = %{version}
BuildArch:      noarch

%description
A service menu for KDE that allows you to compress, resize, convert, rotate,
rename, etc. images.

#%%lang_package

%prep
%setup -q -n kim5-%{git_version}

# Fix rpmlint error "spurious-executable-perm" and "executable-docs"
chmod 644 kim/{ABOUT,AUTHORS,ChangeLog,README}

# Fix rpmlint error "script-without-shebang"
chmod 644 kim/COPYING

%build

%install
pushd kim

install -dm 0755 %{buildroot}%{_kf6_sharedir}/kio/servicemenus
install -dm 0755 %{buildroot}%{_kf6_bindir}
install -pm 0644 src/kim_*.desktop %{buildroot}%{_kf6_sharedir}/kio/servicemenus
install -pm 0755 src/bin/kim_* %{buildroot}%{_kf6_bindir}/

install -dm 0755 %{buildroot}%{_kf6_sharedir}/kim
install -pm 0644 COPYING %{buildroot}%{_kf6_sharedir}/kim/kim_license.txt
install -pm 0644 ABOUT %{buildroot}%{_kf6_sharedir}/kim/kim_about.txt
#install -pm 0644 src/kim_translation %{buildroot}%{_kf6_sharedir}/kim/
#sed -i "s/\/usr\/share\/locale/\/usr\/share\/locale\/kf6/" %{buildroot}%{_kf6_sharedir}/kim/kim_translation

install -dm 0755 %{buildroot}%{_kf6_sharedir}/kim/slideshow
install -pm 0644 src/slideshow/* %{buildroot}%{_kf6_sharedir}/kim/slideshow/

install -dm 0755 %{buildroot}%{_kf6_sharedir}/kim/gallery
install -pm 0644 src/gallery/* %{buildroot}%{_kf6_sharedir}/kim/gallery/

#for i in src/po/*.po; do
#        MOFILE=%{_kf6_localedir}/`basename -s .po $i`/LC_MESSAGES/kim5.mo
#        install -dm 0755 %{buildroot}%{_kf6_localedir}/`basename -s .po $i`/LC_MESSAGES
#        msgfmt -o %{buildroot}/${MOFILE} $i
#done

popd

#%%find_lang kim5

%files
%license LICENSE kim/COPYING
%doc README.md kim/{ABOUT,AUTHORS,ChangeLog,README}
%{_kf6_bindir}/kim_*
%dir %{_kf6_sharedir}/kio
%dir %{_kf6_sharedir}/kio/servicemenus
%{_kf6_sharedir}/kio/servicemenus/kim_*.desktop
%{_kf6_sharedir}/kim/

#%%files lang -f kim5.lang

%changelog
openSUSE Build Service is sponsored by