Please feel free to update/move/change/fix/... this page! This is just a start, far from finished.

Rpmforge spec file snippets

Quite some people might not know how multiple distributions are handled in the rpmforge spec files, so that's why some common snippets are shown here as an example. This might be useful when we have to decide how we're going to handle multiple distributions in rpmrepo. There are other solutions and they all have their advantages and disadvantages.

Advantages:

Disadvantages:

Possible macro file

Claire explained on the list how the rpm macros are currently used on rpmforge.The following is a list of the most used rpm macro's in rpmforge as a macro file. The list is not complete and i'm quite sure it contains some errors. It's meant as an example of what could be included in a macro file for rpmrepo. The rpm only places the macros file to /etc/rpm/macros.rpmrepo.

Overview

The spec files should look like the following:

See also: http://svn.rpmforge.net/svn/trunk/rpms/_template.spec

Header

Almost every spec file starts with:

# $Id$
# Authority: dries
# Upstream: Shawn <sabetts$users,sourceforge,net>

Everyone has access to every spec file but there's almost always one person authorative for each spec file. The most common authority tags are 'dag', 'thias' and 'dries'. The '$Id$' should be expanded by subversion.

dtag expansion

If macros are used which depend on the distribution, then the following is added:

%{?dtag: %{expand: %%define %dtag 1}}

Please note: since 11/2007 this macro variable is renamed from dist to dtag. Rpmforge has been using 'dist' for years but at a certain moment fedora extras decided to introduce a macrovariable with the same name but a different meaning.

Buildrequires for XFree86/xorg-x11/modular xorg

Below the dtag expansion, the following is added:

%{?el4:%define _without_modxorg 1}
%{?fc4:%define _without_modxorg 1}
%{?fc3:%define _without_modxorg 1}
%{?fc2:%define _without_modxorg 1}
%{?fc1:%define _without_modxorg 1}
%{?el3:%define _without_modxorg 1}
%{?rh9:%define _without_modxorg 1}
%{?rh7:%define _without_modxorg 1}
%{?el2:%define _without_modxorg 1}

The following is used as buildrequirements (below BuildRoot):

%{!?_without_modxorg:BuildRequires: libXtst-devel}
%{?_without_modxorg:BuildRequires: XFree86-devel}

Common buildrequirements for modxorg are libXtst-devel, libXt-devel, libXext-devel and so on.

driesverachtert/RpmforgeSpecfileSnippets (last edited 2008-04-01 21:35:04 by dverachtert)