SIGs/KDE/Packaging/BestPractices

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+ URL:           http://kfrob.example.com/ Source0:       http://kfrob.example.com/downloads/kfrob-1.0.tar.gz BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

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

%description If a file is frobnable, kfrob will frobnicate it.

%prep %setup -q

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

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

%clean rm -rf %{buildroot}

%files %defattr(-,root,root,-) %doc AUTHORS COPYING %{_kde4_bindir}/kfrob %{_kde4_datadir}/applications/kde4/kfrob.desktop %{_kde4_configdir}.kcfg/kfrob.kcfg %{_kde4_appsdir}/kfrob/kfrobui.rc

%changelog - Initial package
 * Thu Jul 30 2009 John Doe  1.0-1

The  and   sections should use the   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,  , 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.

= Macros =

Currently the following macros are available for use.

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  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 (irc.freenode.net).