From Fedora Project Wiki

< SIGs‎ | KDE

(Initial page)
 
m (→‎Spec file: typo)
Line 18: Line 18:


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


%description
%description

Revision as of 02:38, 1 August 2009

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.gitorious.com/
Source0:        http://kfrob.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} VERBOSE=1


%install
rm -rf %{buildroot}
mkdir %{buildroot}
make install 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
* Thu Jul 30 2009 John Doe <johndoe@example.com> 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.

Macros

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