From Fedora Project Wiki

< SIGs‎ | KDE

(→‎Spec file: Obviously fake URLs (incase kfrob ever does exist))
(model .spec file: Remove legacy constructs which are not needed anymore with current versions of RPM.)
 
(2 intermediate revisions by 2 users not shown)
Line 11: Line 11:
Summary:        Application for frobnicating frobnable files
Summary:        Application for frobnicating frobnable files


Group:          Applications/System
License:        GPLv2+
License:        GPLv2+
URL:            http://kfrob.example.com/
URL:            http://kfrob.example.com/
Source0:        http://kfrob.example.com/downloads/kfrob-1.0.tar.gz
Source0:        http://kfrob.example.com/downloads/kfrob-1.0.tar.gz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


BuildRequires:  kdelibs4-devel
BuildRequires:  kdelibs4-devel
Line 33: Line 31:
%{cmake_kde4} ..
%{cmake_kde4} ..
popd
popd
make %{?_smp_mflags} -C %{_target_platform} VERBOSE=1
make %{?_smp_mflags} -C %{_target_platform}




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




%files
%files
%defattr(-,root,root,-)
%doc AUTHORS COPYING
%doc AUTHORS COPYING
%{_kde4_bindir}/kfrob
%{_kde4_bindir}/kfrob

Latest revision as of 16:36, 1 November 2012

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

License:        GPLv2+
URL:            http://kfrob.example.com/
Source0:        http://kfrob.example.com/downloads/kfrob-1.0.tar.gz

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
make install/fast DESTDIR=%{buildroot} -C %{_target_platform}


%files
%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).