[CentOS] Building a 64bit rpm

Fri Apr 11 14:26:09 UTC 2008
Ross S. W. Walker <rwalker at medallion.com>

Johnny Hughes wrote:
> Ignacio Vazquez-Abrams wrote:
> > On Tue, 2008-04-08 at 10:49 -0600, Joseph L. Casale wrote:
> >> I want to build the 64bit version of Xen 3.2, they only show one srpm
> >> available. I assume if its compiled on a x86_64 version of CentOS 5.1
> >> it will be a 64bit rpm when its done?
> > 
> > Yes.
> > 
> >> I am aware its not good to build as root but out of curiosity, if I
> >> used a vm that I would later destroy, is the only caveat to building
> >> as root potential damage to the build system, or can the actual rpm be
> >> built incorrectly?
> > 
> > Both. Consider using mock.
> Ignacio's suggestion to use mock, especially on x86_64 is a good one.
> You will have an endless source of problems trying to build x86_64 RPMS 
> on a normally installed tree if there are any i386 packages on there 
> except for:
> glibc.i686 and glibc-devel.i386
> AND ... if you have not installed from a x86_64 ONLY tree, then you do 
> have i386 packages on your x86_64 machine.
> If, however, you configure mock properly (and EPEL should have some good 
> config files for centos too I think) then you will get good clean 
> buildroots for your x86_64 packages.
> Trying to build packages with i[3,4,5,6]86 stuff polluting your 
> buildroots can cause you to link to the wrong libraries or cause you to 
> not be able to build things with ld errors.  Building on multilib arches 
> is not the easiest thing to do.

I second what both Ignacio and Johnny said and can attest to the
problems of building on mixed arch.

Having said that though, xen 3.2 builds clean on x86_64 as root
without mock.

I must also say, if you are building with Xen, then PVs provide
the same functionality as mock for a build environment, and
if you use LVM and snapshots you can get easy roll-back, though
mock does provide the nifty feature of pulling in the build

It would be nice to have yum install the build requirements. Has
anybody developed a plugin to allow yum to install SRPMs and
optionally install the requirements as part of this?

When I do a rpm -qp --requires on the source package it lists
the build requirements, so it seems like it wouldn't be an
impossible task to write a yum plugin to handl this.


This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.