File discover.spec of Package discover

# spec file for package discover
# 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

%bcond_without lang
# Version in Leap 15.2 is too old
%global have_fwupd (0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300)

Name:           discover
Version:        5.22.5
Release:        0
Summary:        Software store for the KDE Plasma desktop
License:        GPL-2.0-only AND GPL-3.0-only AND GPL-3.0-or-later
Group:          System/GUI/KDE
%if %{with lang}
Source2:        plasma.keyring
Patch1:         0001-Warning-for-FlatHub.patch
BuildRequires:  cmake >= 3.16
BuildRequires:  extra-cmake-modules
BuildRequires:  flatpak-devel
BuildRequires:  kf5-filesystem
BuildRequires:  update-desktop-files
BuildRequires:  cmake(AppStreamQt) >= 0.11.1
BuildRequires:  cmake(KF5Archive)
BuildRequires:  cmake(KF5Attica)
BuildRequires:  cmake(KF5Config)
BuildRequires:  cmake(KF5CoreAddons)
BuildRequires:  cmake(KF5Crash)
BuildRequires:  cmake(KF5DBusAddons)
BuildRequires:  cmake(KF5Declarative)
BuildRequires:  cmake(KF5I18n)
BuildRequires:  cmake(KF5IdleTime)
BuildRequires:  cmake(KF5ItemModels)
BuildRequires:  cmake(KF5KCMUtils)
BuildRequires:  cmake(KF5KIO)
BuildRequires:  cmake(KF5Kirigami2)
BuildRequires:  cmake(KF5NewStuff)
BuildRequires:  cmake(KF5Notifications)
BuildRequires:  cmake(KF5Plasma)
BuildRequires:  cmake(KF5TextWidgets)
BuildRequires:  cmake(KF5WindowSystem)
# Disabled until upstream complies with the KDE policies
#BuildRequires:  cmake(KUserFeedback)
BuildRequires:  cmake(Qca-qt5)
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5DBus)
BuildRequires:  cmake(Qt5Network)
BuildRequires:  cmake(Qt5Qml)
BuildRequires:  cmake(Qt5Quick)
BuildRequires:  cmake(Qt5Test)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  cmake(Qt5X11Extras)
BuildRequires:  cmake(Qt5Xml)
BuildRequires:  cmake(packagekitqt5) >= 1.0.1
%if %{have_fwupd}
BuildRequires:  pkgconfig(fwupd) >= 1.0.6
Requires:       kdeclarative-components
Requires:       kirigami2
Requires:       kuserfeedback-imports
Requires:       libqt5-qtquickcontrols2
Recommends:     %{name}-backend-packagekit
Recommends:     %{name}-lang
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150100
Recommends:     %{name}-backend-flatpak
# Conflicts with plasma5-pk-updates
# Recommends:     %%{name}-notifier
Recommends:     %{name}-backend-fwupd

Discover is a graphical software manager for the KDE Plasma desktop. It helps users to find software they might want easily and quickly.

By allowing to navigate a software library by search, categories, top lists along with detailed application information including screenshots and reviews, users can more quickly find applications that suit their needs.

%package backend-packagekit
Summary:        PackageKit Backend for Discover
Group:          System/GUI/KDE
Requires:       %{name} = %{version}
# Technically libdiscover and not the backend implements AppStream support, but
# it's useless without system package management
Requires:       AppStream
Requires:       PackageKit
Requires:       appstream-provider

%description backend-packagekit
A plugin for Discover to support management of system packages and repositories
using PackageKit.

%package backend-flatpak
Summary:        Flatpak Backend for Discover
Group:          System/GUI/KDE
Requires:       %{name} = %{version}
Requires:       flatpak

%description backend-flatpak
A plugin for Discover to support installation and management of Flatpak
applications and repositories.

%package backend-fwupd
Summary:        fwupd Backend for Discover
Group:          System/GUI/KDE
Requires:       %{name} = %{version}

%description backend-fwupd
A plugin for Discover to support updates of system firmware using fwupd.

%package notifier
Summary:        Update notifier for KDE Software Manager
Group:          System/GUI/KDE
Conflicts:      plasma5-pk-updates
Obsoletes:      %{name}-plasmoid < %{version}
Requires:       %{name} = %{version}

%description notifier
This is a notifier for Discover to inform the user that updates are available and allows the
user to install them using Discover.


%autosetup -p1

  %cmake_kf5 -d build

  %kf5_makeinstall -C build
  %suse_update_desktop_file -r Qt KDE System PackageManager

  # Even without the snap backend, this is installed...
  rm %{buildroot}%{_kf5_applicationsdir}/

%if %{with lang}
  %find_lang libdiscover %{name}.lang
  %find_lang plasma-discover %{name}.lang

  %find_lang plasma-discover-notifier notifier.lang
  %find_lang kcm_updates notifier.lang
  touch notifier.lang

%license LICENSES/*
%dir %{_kf5_plugindir}/discover/
%dir %{_kf5_sharedir}/libdiscover/
%dir %{_kf5_sharedir}/libdiscover/categories/

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

%files backend-packagekit
%license LICENSES/*

%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150100
%files backend-flatpak
%license LICENSES/*

%if %{have_fwupd}
%files backend-fwupd
%license LICENSES/*

%files notifier -f notifier.lang
%license LICENSES/*
%dir %{_kf5_plugindir}/discover-notifier
%dir %{_kf5_plugindir}/kcms/
%dir %{_kf5_sharedir}/kpackage/
%dir %{_kf5_sharedir}/kpackage/kcms/

openSUSE Build Service is sponsored by