File kpmcore.spec of Package kpmcore
#
# spec file for package kpmcore
#
# Copyright (c) 2022 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 https://bugs.opensuse.org/
#
# Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA)
%{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
%bcond_without released
%global sover 12
Name: kpmcore
Version: 21.12.2
Release: 0
Summary: KDE Partition Manager core library
License: GPL-3.0-only
Group: Productivity/Office/Other
URL: https://www.kde.org
Source: https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz
%if %{with released}
Source1: https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz.sig
Source2: applications.keyring
%endif
# https://bugzilla.suse.com/show_bug.cgi?id=1178848 is still pending
Source3: kpmcore-rpmlintrc
Patch0: 0001-Add-method-to-query-if-polkit-is-installed-correctly.patch
Patch1: 0002-Switch-to-ntfsinfo-to-read-NTFS-usage.patch
Patch2: 0003-Simplify-code-using-K_PLUGIN_CLASS_WITH_JSON-macro.patch
Patch3: 0004-Add-new-job-to-change-permission-of-the-newly-created.patch
Patch4: 0005-Move-the-changePosixPermission-to-the-Filesystem.patch
Patch5: 0006-Add-posix-permissions-on-filesystems-used-in-posix-systems.patch
Patch6: 0007-Use---recursive-instead-of--r.patch
Patch7: 0008-Allow-running-chmod-in-externalcommand-helper.patch
Patch8: 0009-Add-support-for-copying-unknown-partitions.patch
Patch9: 0010-Changing-swap-labels-while-swap-is-active-does-not-seem-to.patch
Patch10: 0011-Be-a-bit-more-strict-in-root-helper-when-checking-path-to.patch
Patch11: 0012-Restrict-QProcess--ProcessChannelMode-to-two-used-values.patch
Patch12: 0013-Check-for-relative-paths-in-ExternalCommandHelper__CopyBlocks.patch
Patch13: 0014-Rename-CopyBlocks-to-CopyFileData.patch
Patch14: 0015-Restrict-CopyFileData-to-writing-to-already-existing-files.patch
Patch15: 0016-Make-sure-that-path-passed-to-WriteData-is-block-device.patch
Patch16: 0017-It-is-no-longer-necessary-to-namespace-exit-function.patch
Patch17: 0018-Do-not-repeatedly-open-and-close-file-when-writing-to-it.patch
Patch18: 0019-Do-not-repeatedly-open-and-close-file-when-reading-from-it.patch
BuildRequires: extra-cmake-modules
%if 0%{?suse_version} <= 1500
BuildRequires: gcc10-c++
%endif
BuildRequires: pkgconfig
BuildRequires: update-desktop-files
BuildRequires: cmake(KF5Auth)
BuildRequires: cmake(KF5CoreAddons) >= 5.88
BuildRequires: cmake(KF5I18n)
BuildRequires: cmake(KF5WidgetsAddons)
BuildRequires: cmake(PolkitQt5-1)
BuildRequires: cmake(Qt5Core) >= 5.14.0
BuildRequires: cmake(Qt5DBus)
BuildRequires: cmake(Qt5Gui)
BuildRequires: cmake(Qt5Widgets)
BuildRequires: pkgconfig(blkid) >= 2.33.2
%description
Library for managing partitions. Common code for KDE Partition Manager and
other projects.
%package devel
Summary: Development package for KDE Partition Manager core library
Group: Development/Languages/C and C++
Requires: libkpmcore%{sover} = %{version}
%description devel
Library for managing partitions. Common code for KDE Partition Manager and
other projects.
Development package for kpmcore.
%package -n libkpmcore%{sover}
Summary: KDE Partition Manager core library
Group: System/Libraries
Requires: %{name} >= %{version}
%description -n libkpmcore%{sover}
Library for managing partitions. Common code for KDE Partition Manager and
other projects.
Main kpmcore library.
%lang_package
%prep
%autosetup -p1
%build
%if 0%{?suse_version} <= 1500
export CXX=g++-10
%endif
%cmake_kf5 -d build
%cmake_build
%install
%kf5_makeinstall -C build
%if %{with released}
%find_lang kpmcore --all-name
%endif
%post -n libkpmcore%{sover} -p /sbin/ldconfig
%postun -n libkpmcore%{sover} -p /sbin/ldconfig
%files
%{_kf5_dbuspolicydir}/org.kde.kpmcore.*.conf
%{_kf5_libdir}/libexec/kpmcore_externalcommand
%dir %{_kf5_plugindir}/kpmcore
%{_kf5_plugindir}/kpmcore/pmdummybackendplugin.so
%{_kf5_plugindir}/kpmcore/pmsfdiskbackendplugin.so
%{_kf5_sharedir}/dbus-1/system-services/org.kde.kpmcore.helperinterface.service
%{_kf5_sharedir}/polkit-1/actions/org.kde.kpmcore.externalcommand.policy
%files -n libkpmcore%{sover}
%license LICENSES/*
%{_kf5_libdir}/libkpmcore.so.%{sover}
%{_kf5_libdir}/libkpmcore.so.%{version}
%files devel
%{_includedir}/kpmcore/
%{_kf5_cmakedir}/KPMcore/
%{_kf5_libdir}/libkpmcore.so
%if %{with released}
%files lang -f %{name}.lang
%endif
%changelog