Please feel free to update/move/change/fix/... this page! This is just a start, far from finished.
Contents
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:
- only one spec file needed for all distributions
- quite straightforward.. it's always the same
- anyone can rebuild rpms if they're able to use --define 'dtag xxx'
Disadvantages:
- spec file can become a lot longer (possible solution: move some stuff to a macro file)
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:
- The header with the sbuversion ID, authority and upstream contact information.
- If needed: the dtag expansion macro.
- If needed: some macros for buildrequirements which depend an certain distributions
- A block with the following fields:
- Summary
- Name
- Version
- Release
- License
- Group
- URL
- A block with one or more Source fields, zero or more Patch fields and the following buildroot:
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
- A block with buildrequirements and normal requirements.
- The %description
- The %prep section
- The %build section
- The %install section
- The %clean section
- The %files section
- The %changelog section
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.
