Section 5.8. Rebuilding an RPM Package for a Different Architecture


5.8. Rebuilding an RPM Package for a Different Architecture

S ometimes you'll find an RPM has been prepared that would be perfect for your systemexcept that the RPM was built for a machine of a different architecture. This can be frustrating, but if you can obtain the source RPM, it's a fairly simple matter to make a binary RPM that is tuned to your system.

5.8.1. How Do I Do That?

Assuming that you have set up your ~/.rpmmacros file (see Lab 5.7, "Making Your Own RPM Packages"), simply obtain a source RPM file, and then execute rpmbuild with the --rebuild option:

$ rpmbuild --rebuild  $ rpmbuild --rebuild ImageMagick*.src.rpm Installing ImageMagick-6.2.2.0-2.src.rpm Executing(%prep): /bin/sh -e /home/chris/rpm/tmp/rpm-tmp.32955 + umask 022 + cd /home/chris/rpm/tmp ...(Lines snipped)... Executing(--clean): /bin/sh -e /home/chris/rpm/tmp/rpm-tmp.88067 + umask 022 + cd /home/chris/rpm/tmp + rm -rf ImageMagick-6.2.2 + exit 0

The new RPM packages will be found in ~/rpm/RPMS/.

5.8.2. How Does It Work?

When rebuilding a package, rpmbuild performs the equivalent of a source package installation (rpm -i), followed by a build-all (rpmbuild -ba), and then deletes the source files.

5.8.3. What About...

5.8.3.1. ...editing the spec file before rebuilding?

rpmbuild's --rebuild option is useful only for a direct rebuild without any changes. If you need to edit the spec file, install the source RPM, edit the spec file, and then build the RPM packages normally (see Lab 5.7, "Making Your Own RPM Packages").

5.8.4. Where Can I Learn More?

  • The manpage for rpmbuild




Fedora Linux
Fedora Linux: A Complete Guide to Red Hats Community Distribution
ISBN: 0596526822
EAN: 2147483647
Year: 2006
Pages: 115
Authors: Chris Tyler

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net