File kde-cli-tools5.spec of Package kde-cli-tools5

# spec file for package kde-cli-tools5
# Copyright (c) 2021 SUSE LLC
# 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

%define kf5_version 5.54.0
%bcond_without lang
Name:           kde-cli-tools5
Version:        5.21.1
Release:        0
Summary:        Additional CLI tools for KDE applications
License:        GPL-2.0-or-later
Group:          System/GUI/KDE
Source:         kde-cli-tools-%{version}.tar.xz
%if %{with lang}
Source1:        kde-cli-tools-%{version}.tar.xz.sig
Source2:        plasma.keyring
# PATCH-FIX-OPENSUSE kdesu-add-some-i18n-love.patch -- boo#852256
Patch0:         kdesu-add-some-i18n-love.patch
BuildRequires:  extra-cmake-modules >= 1.3.0
BuildRequires:  kf5-filesystem
BuildRequires:  xz
BuildRequires:  cmake(KF5Activities) >= %{kf5_version}
BuildRequires:  cmake(KF5Config) >= %{kf5_version}
BuildRequires:  cmake(KF5Declarative) >= %{kf5_version}
BuildRequires:  cmake(KF5DocTools) >= %{kf5_version}
BuildRequires:  cmake(KF5I18n) >= %{kf5_version}
BuildRequires:  cmake(KF5IconThemes) >= %{kf5_version}
BuildRequires:  cmake(KF5Init) >= %{kf5_version}
BuildRequires:  cmake(KF5KCMUtils) >= %{kf5_version}
BuildRequires:  cmake(KF5KDELibs4Support) >= %{kf5_version}
BuildRequires:  cmake(KF5KIO) >= %{kf5_version}
BuildRequires:  cmake(KF5Su) >= %{kf5_version}
BuildRequires:  cmake(KF5WindowSystem) >= %{kf5_version}
# Needs KWorkSpace::detectPlatform
BuildRequires:  cmake(LibKWorkspace) >= 5.12.4
BuildRequires:  cmake(Qt5DBus) >= 5.4.0
BuildRequires:  cmake(Qt5Svg) >= 5.4.0
BuildRequires:  cmake(Qt5Test) >= 5.4.0
BuildRequires:  cmake(Qt5Widgets) >= 5.4.0
BuildRequires:  cmake(Qt5X11Extras) >= 5.4.0
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcb)
# for kquitapp5
Requires:       kdbusaddons-tools
%if %{with lang}
Recommends:     %{name}-lang
Requires(post):     update-alternatives
Requires(postun):   update-alternatives

Additional CLI tools for KDE applications and workspaces.

%setup -q -n kde-cli-tools-%{version}
%autopatch -p1

  %cmake_kf5 -d build

  %kf5_makeinstall -C build
%if %{with lang}
  %find_lang %{name} --with-man --all-name

  # create a dummy target for /etc/alternatives/kdesu
  install -d -m 755 %{buildroot}%{_sysconfdir}/alternatives/
  touch %{buildroot}%{_sysconfdir}/alternatives/kdesu
  chmod +x %{buildroot}%{_sysconfdir}/alternatives/kdesu
  ln -s -f %{_sysconfdir}/alternatives/kdesu %{buildroot}%{_kf5_bindir}/kdesu
  touch %{buildroot}%{_sysconfdir}/alternatives/kdesu.1%{?ext_man}
  mv %{buildroot}%{_kf5_mandir}/man1/kdesu.1 %{buildroot}%{_kf5_mandir}/man1/kdesu-5.1
  ln -s -f %{_sysconfdir}/alternatives/kdesu.1%{?ext_man} %{buildroot}%{_kf5_mandir}/man1/kdesu.1%{?ext_man}

%if 0%{?suse_version} > 1320 || 0%{?is_opensuse}
%{_sbindir}/update-alternatives \
    --install %{_kf5_bindir}/kdesu kdesu %{_kf5_libexecdir}/kdesu 25 \
    --slave %{_kf5_mandir}/man1/kdesu.1.gz kdesu.1%{?ext_man} %{_kf5_mandir}/man1/kdesu-5.1%{?ext_man}
%{_sbindir}/update-alternatives \
    --install %{_kf5_bindir}/kdesu kdesu %{_kf5_libexecdir}/kdesu 15 \
    --slave %{_kf5_mandir}/man1/kdesu.1.gz kdesu.1%{?ext_man} %{_kf5_mandir}/man1/kdesu-5.1%{?ext_man}

if [ $1 -eq 0 ]; then
    %{_sbindir}/update-alternatives --remove kdesu \

%license COPYING*
%ghost %{_sysconfdir}/alternatives/kdesu
%ghost %{_sysconfdir}/alternatives/kdesu.1%{?ext_man}
%doc %{_kf5_htmldir}/en

%if %{with lang}
%files lang -f %{name}.lang

openSUSE Build Service is sponsored by