2009-10-11

RPM build environment on Moblin

I once set up an RPM build environment on my netbook to build missing packages, often small tools. There are many docs to do that, for myself I browsed the Fedora project wiki. If you are looking for RPMish stuff you are in the right place there.

Preparation

The package rpmdevtools provides scripts for the packager, one of them is rpmdev-setuptree. This tool will set up automatically the build directory for keeping source packages, spec files, etc. You can run this command now. Within your home, it will create an rpmbuild directory and a hidden .rpmmacros file. You can move the rpmbuild directory where ever you want but you will have to fix the variable %_topdir in the hidden rpmmacros file.

That's already about it.

Build example

Lets take a small example to show the use of the RPM build environment. Download the source package libmad from RPM Fusion. Copy it to the subdirectory SRPMS and then unarchive it with the command rpm -i SRPMS/libmad-[version].src.rpm. And finally you can build the binary packages with the command rpmbuild -bb SPECS/libmad.spec. The rpmbuild command is provided by the rpm-build package.

By now you can install the packages within the subdirectory RPMS, libmad-[version].rpm and the -devel package, if you wish to build the source package madplay to play MP3s from command line :-)

External sources

No comments:

Post a Comment