Home | Content | Search | Navigation | Toolbox | Actions | In other languages
openSUSE
  • Get Software
  • Wiki
  • Build Software
  • User Directory
  • Features
  • News
  • Forums
  • Shop

Discover it
  • Project Overview
  • How to Participate
  • Documentation
  • Support
  • Support Database
  • Contact
  • Sitemap

Toolbox
  • What links here
  • Related changes
  • Special pages


  • Page
  • Discussion
  • View source
  • History

Packaging/SUSE Macros/KDE4 Macros

From openSUSE

< Packaging | SUSE Macros

Contents

  • 1 KDE4 packaging
    • 1.1 %cmake_kde4
    • 1.2 %make_jobs
    • 1.3 %kde_post_install
    • 1.4 %create_exclude_filelist
    • 1.5 %create_subdir_filelist
    • 1.6 %kde4_pimlibs_requires
    • 1.7 %kde4_runtime_requires
    • 1.8 Example for %create_subdir_filelist and %create_exclude_filelist

KDE4 packaging

We've added some RPM macros to make packaging of KDE4 and KDE4 applications easier. Unless otherwise noted, these macros come from macros.kde4 which is installed by kde4-filesystem and therefore usually available in the build environment of KDE4. They're described below:

 %cmake_kde4

This macro calls cmake with the right parameters to build openSUSE KDE4 compatible packages. If you pass a "-d <directory>" option also inititate an out of tree build. Compiling outside of the source tree is strongly recommended. Ex: "%cmake_kde4 -d builddir" will create builddir which is where the cmake configure and make files will go along with the actual compilation.

For passing arbitrary arguments, this syntax is needed:

%cmake_kde4 -- -DENABLE_SOMETHING=YES

 %make_jobs

This is just a macro that calls %make with the right jobs parameter, if icecream is in use. This is for local test builds on a multiprocessor machine and/or the Factory builds, which use distributed buildpower to speed up compilation.

 %kde_post_install

It's a generic macro that should be called as the last non-trivial step in the %install section of the spec file in order to be able to hook in generic clean up and fix functionality that might be needed for a wide range of packages.

 %create_exclude_filelist

%create_exclude_filelist creates an exclude file list from all file lists that were created by %create_subdir_filelist. It is intended to be used for the main package, to ensure that files that were moved into a subpackage are not packaged twice.

 %create_subdir_filelist

This macro helps to create sub-packages by looking at what's installed from a specified sub-directory (and a matching doc/ directory) of the source.

%create_subdir_filelist requires a parameter "-d <directory>" and creates a file list called filelists/<directory> unless a parameter "-f <filelistname>" is given which then let it appends to filelists/<filelistname>. If a "-v <develfilelistname>" parameter is given, development files like headers, cmake definitions and .so symlinks will be written to filelists/<develfilelistname> instead.


 %kde4_pimlibs_requires

Adds a "Requires: kdepimlibs4 >= %_kde_pimlibs_version" dependency to the package.

 %kde4_runtime_requires

Adds a "Requires: kdebase4-runtime >= %_kde_platform_version" dependency to the package.

Example for %create_subdir_filelist and %create_exclude_filelist

Example usage in koffice2.spec (shortened):

 ..
 %install
 cd build
 %makeinstall
 %create_subdir_filelist -d kplato -v devel
 %create_subdir_filelist -d kword -v devel
 %create_subdir_filelist -d filters/kword -f kword -v devel
 ..
 cd ..
 sed -ri s,.*/usr/share/doc/kde/HTML/en/.*,, filelists/*
 %create_exclude_filelist
 rm -rf $RPM_BUILD_ROOT/usr/share/doc/kde/HTML/en
 ..
 %clean
 rm -rf $RPM_BUILD_ROOT
 rm -rf filelists
 ..
 %files devel -f filelists/devel
 ..
 %files kplato -f filelists/kplato
 ..
 %files kword -f filelists/kword
 ..
 %files -f filelists/exclude

This example also shows how it's optionally possible to merge/change the automatically created file lists.


KDE
Participating Developing
  • KDE4 packages
  • Upgrading to KDE4
  • Package repositories
  • Configuration
  • Package wishlist
  • Projects
  • Applications
  • Bug screening
  • KDE Team Cheat Sheet
  • Packaging cookbook
  • Development guide
Communicating Planning
  • KDE Team
  • opensuse-kde@opensuse.org - openSUSE KDE Mailing List
Subscribe | Unsubscribe | Help | Archives
  • #openSUSE-kde on irc.kde.org/irc.opensuse.org
  • Web forum
  • Meetings


Retrieved from "old-en.opensuse.org/Packaging/SUSE_Macros/KDE4_Macros"
 
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.