[CentOS] Building a 64bit rpm

Tue Apr 8 18:04:23 UTC 2008
Ned Slider <nedslider at f2s.com>


Akemi Yagi wrote:
> On Tue, Apr 8, 2008 at 10:34 AM, Frank Cox <theatre at sasktel.net> wrote:
>> On Tue, 08 Apr 2008 19:29:01 +0200
>>  Rudi Ahlers <Rudi at SoftDux.com> wrote:
>>
>>  > I build mine as root ( a normal user account gave me some erorrs), and
>>  > all seems well?
>>
>>  Use yum to install rpmdevtools.  Then rpmdev-setuptree will do all of the work
>>  that's required to build rpms as a user.
> 
> I suppose rpmdevtools is only available from EPEL.  But the following
> procedures will do the job:
> 
> cd
> mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
> echo "%_topdir %(echo $HOME)/rpmbuild" > .rpmmacros
> 
> Then as root, yum install rpm-build
> 

Johnny wrote a nice article here about building SRPMs:

http://www.linuxhelp.net/forums/How_to_Build_Enterprise_Srpms_t3384.html

Never had any problems since following Johnny's advice :)

You can modify Johnny's scripts to build for different targets (i386, 
i686, x86_64 etc). For a build target of x86_64, you may want to specify 
-m64.