From Fedora Project Wiki

< SIGs‎ | KDE

Revision as of 19:56, 6 March 2010 by Kalev (talk | contribs) (→‎Spec file: Synced example spec %build and %install sections with the ones in SIGs/KDE page)

This page is dedicated to best practices for applications using KDE4 in Fedora. The guidelines presented here should enable reviews to go smoother and spec file creation easier. It may be updated from time to time, so if you are packaging applications that use KDE4, watching this page may be helpful.

Spec file

A model .spec file can be found below:

Name:           kfrob
Version:        1.0
Release:        1%{?dist}
Summary:        Application for frobnicating frobnable files

Group:          Applications/System
License:        GPLv2+
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  kdelibs4-devel
BuildRequires:  kdebase-workspace-devel

If a file is frobnable, kfrob will frobnicate it.

%setup -q

mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake_kde4} ..
make %{?_smp_mflags} -C %{_target_platform}

rm -rf %{buildroot}
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}

rm -rf %{buildroot}


* Thu Jul 30 2009 John Doe <> 1.0-1
- Initial package

The %build and %install sections should use the mkdir %{_target_platform} directory so that generated files are kept inside of a specific directory instead of being strewn about the exploded tarball. These are files generated by moc, uic, and other tools.

Summary and Description

Please avoid wording such as "for KDE4" or "KDE4 application for..." in the summary and descriptions. KDE4 applications can also run in other desktop environments and such wording may mislead users.


Currently the following macros are available for use.

Macro Path
%{_kde4_prefix} /usr
%{_kde4_sysconfdir} /etc
%{_kde4_libdir} /usr/lib[64]
%{_kde4_libexecdir} /usr/libexec/kde4
%{_kde4_datadir} /usr/share
%{_kde4_iconsdir} /usr/share/icons
%{_kde4_configdir} /usr/share/config
%{_kde4_appsdir} /usr/share/kde4/apps
%{_kde4_docdir} /usr/share/doc
%{_kde4_bindir} /usr/bin
%{_kde4_sbindir} /usr/sbin
%{_kde4_includedir} /usr/include/kde4

Please use these instead of the standard macros. Since many KDE4 applications install many files to standard directories, the macros help to clean up the %files list and describe what the directory is for.

Review Requests and Sponsoring

If you need a reviewer or a sponsor, don't hesitate to ask on the IRC channel, #fedora-kde on Freenode (