Mandrake RPM HOWTO v1.1


Table of Contents
1. Foreword
2. Install the software
2.1. The basics
2.2. Building for Mandrake Linux
3. Preliminary tasks
3.1. Create required folders
3.2. Add configuration files
3.3. Subscribe to mailing lists
4. Building a RPM
4.1. From an existing source RPM
4.2. From raw sources
4.3. Preliminary checks
4.4. Inside the spec file
4.5. The build
5. Testing a RPM
5.1. Basic tests
5.2. Linting the package
5.3. Install test
6. Send your work
7. Something's going wrong?
7.1. For general RPM matters:
7.2. For specific Mandrake RPM matters:
8. Advanced
8.1. Menu system
8.2. Library policy
8.3. Deeper inside the specfiles...
8.4. Releasing pre-versions
8.5. update-alternatives
8.6. Signing your packages
8.7. More on the files section
8.8. Subpackages
8.9. What to avoid
8.10. Locale specific packages
8.11. Easy handling of differences between two RPM's
8.12. To become a Jedi, use Emacs you have to
A. Of Pre- and Post-installation scripts
A.1. Basics
A.2. Dealing with upgrades
B. More macros
C. Mandrake Linux Groups
D. Mandrake Linux Menu Structure
E. Mandrake Linux Valid Licenses
F. Cool programs to check out

This HOWTO is aimed at helping people who want to produce software packages which should integrate well in the Mandrake Linux distribution of GNU/Linux. In particular, it will stress in what way the packages are slightly different from the packages anyone would write for other rpm-based distributions. This document should be useful to MandrakeSoft developers, but also to external people.

The Mandrake Linux distribution of GNU/Linux is produced and published by MandrakeSoft, Inc.

1. Foreword

It is assumed in this document that the reader is "linux-ready". He already knows the basic commands, directory structure, and has already used rpm at least for installing packages.

This document is constructed as a step by step recipe to obtain a rpm package that can integrate well in the Mandrake Linux distribution of GNU/Linux, from either a previous source rpm or a tar source.

If you haven't done it yet, you should read the cooker web page, which explains the development process of Mandrake Linux.

RPM roughly means three things:

The program rpm is, from the user's point of view, a powerful package manager. It acts as a "conductor" for any action on rpm packages. Among other things, it can:

From the programmer's point of view, the program rpm is a packager which encapsulates in a single rpm file all the information needed to install a program on a given platform.

It is important to distinguish from the beginning the difference between source (.src.rpm) and binary (.<archtype>.rpm) packages.

The first one contains (yes you guessed) the complete source tree from the original programmer, plus all the stuff the packager added in order to configure, compile and install the program. It generally consists of a spec file (the file used to tell rpm which operations perform in order to create the package) along with patches, if needed.

The second one contains the compiled binary, and all the files (documentation, config files, icons,...) that will be installed on the target system. It also contains the procedure used to put the files at their correct location, and the actions to perform in order to have the program operational.