To build packages, rpm needs a special tree in your home directory. This tree can be created with the following command: mkdir -p ~/rpm/{BUILD,RPMS/$ARCH,RPMS/noarch,SOURCES,SRPMS,SPECS,tmp}. Replace $ARPH with the architecture(s) you plan to build packages for, basically this can be i586 but also sparc/alpha/ppc.
![]() | Building RPM's as root is dangerous, because the binary files are installed on the system before being packaged, thus you must always build as normal user so you won't accidentally pollute your system. |
Make sure that the tree is of the form :
The directory where the building of sources is done.
The binary packages after building, sorted by target architecture.
The directory where i586.rpm packages will be stored.
Idem for noarch packages.
The source files (mypackage.tar.bz2 for example).
The spec files we will have to construct.
The source rpm after building.
For temporary stuff that rpm will create when building your packages.
![]() | The architecture directories under /RPMS are necessary to rpm. If they are not present, you'll get an error message. |
In order to build packages for Mandrake Linux, you will need to add two configuration files in your home directory:
.rpmrc buildarchtranslate: i386: i586 buildarchtranslate: i486: i586 buildarchtranslate: i586: i586 buildarchtranslate: i686: i586 .rpmmacros %_topdir YOUR_HOME_DIR/rpm %_tmppath YOUR_HOME_DIR/rpm/tmp %_signature gpg %_gpg_name Mandrake Linux %_gpg_path ~/.gnupg %distribution Mandrake Linux %vendor MandrakeSoft |
which you will have to edit to fit your name and directory.
Warning, don't set %optflags, as one is already provided for you in the system-wide /usr/lib/rpm/rpmrc.
In the same way, don't set %packager, so that rebuilding other people's packages won't put yourself in the Packager: field of the RPM, possibly in a public release which would direct bug reports to you instead of maintainer.
Your rpm program is then setup to build packages.
Mandrake's lists (Consult Mailing list pages on Mandrake Linux pages):
changelog
security
cooker
doc
RedHat's rpm-list: send a mail to rpm-list-request@redhat.com with subscribe in the subject line.
Also there is a good rpm-help list you can subscribe to, rpmhelp@freezer-burn.org; consult the archive at http://www.freezer-burn.org/lists/rpmhelp.php3.