KDE Packaging
This document outlines the best practices for packaging software using the KDE frameworks, for use in Fedora.
Bauabhängigkeiten
If using cmake, the following BuildRequires are a MUST:
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: kf6-rpm-macros
kf6-rpm-macros needs to be changed to kf5-rpm-macros if building for Plasma 5 instead of Plasma 6.
Verfügbare Makros
The following macros are used in the building of KDE packages. Note that the version of macros (i.e. %cmake_kf5 and %cmake_kf6) can be changed depending on which version of Plasma you are building for.
%cmake_kf6-
Not unlike
%cmake, this macro defines CFLAGS, LDFLAGS, etc. and calls%__cmakewith appropriate parameters (-DCMAKE_INSTALL_PREFIX:PATH=/usrand such), but with additional KDE-specific flags and parameters. You can pass-Doption=valueto this macro in order to set options for the buildsystem. %stable_kf6-
Used in the package’s source links, if the package is released on the official KDE download server. Outputs either
stableorunstabledepending on the version of the package.
Here’s an example of how it would look like:
Source0: http://download.kde.org/%{stable_kf6}/release-service/%{version}/src/%{name}-%{version}.tar.xz
%find_lang_kf6-
This macro is sometimes used instead of
%find_langin packages using language files ending in_qt.qm.
Macros for paths set and used by build systems
The following table lists macros which are widely used in fedora .spec files. Those macros are provided by the kf5-rpm-macros (For Plasma 5) and kf6-rpm-macros (For Plasma 6) packages.
For Plasma 5, the following macros can simply have their version number changed to reflect the Plasma 5 version (For example, %{_kf6_datadir} would become %{_kf5_datadir}).
| macro | definition | comment |
|---|---|---|
|
|
|
|
|
default: |
|
|
|
|
|
default: |
|
|
default: |
|
|
default: |
|
|
default: |
|
|
default: |
|
|
default: |
|
|
default: |
|
|
default: |
|
|
default: |
|
|
default: |
Want to help? Learn how to contribute to Fedora Docs ›