[CentOS-devel] Advice on compiling multiple packages with mock

Tue Sep 27 15:31:20 UTC 2011
Johnny Hughes <mailing-lists at hughesjr.com>

On 09/27/2011 09:50 AM, Ljubomir Ljubojevic wrote:
> Време: 09/27/2011 01:52 PM, Patrick Lists пише:
>> On 09/27/2011 01:44 PM, Ljubomir Ljubojevic wrote:
>>> Can someone point me in the right direction? How do you compile multiple
>>> packages continuously with mock?
>>>
>>> I have some 50 srpms waiting to be recompiled via mock for both i386 and
>>> x86_64 (again).
>>>
>>> 1. Is there a command I can give so all the packages are compiled in one go?
>>>
>>> 2. Do I have to sort them in proper order (dependencies) or can I just
>>> command to mock to check and sort them?
>>>
>>> Any help is appreciated, examples welcomed.
>>

You need to somehow script the proper order and/or dependencies if you
are using mock.  You would also need to script something that would add
the built packages into a repo if you need to build them "staged" (that
is, you build package A and it is needed for Package B later ... you
need some kind of script to move the .rpms from A into one of your repos
and run createrepo on it before you build package B).

There are things that do staging for mock ... one is plague, the other
is koji ... I am sure there are others.

>> Smock (which uses mock) might help:
>>
>> "Smock is a thin wrapper around mock to let you build up a whole set of
>> dependant RPMs against an external distro."
>>
>> http://git.annexia.org/?p=fedora-mingw.git;a=tree;f=smock
>>
>

I have not used this ...

> That is nice I will try it later today.
> 
> I have another (hopefully last) question. How do you build i686 packages 
> in mock (or for that matter in rpmbuild)? Do you just change it's name? 
> or use command option or change it in some macro?
> 

You need to use a command like this to build i686 for mock:

setarch i686 mock --statedir="{somepath}/state" --resultdir="{some path
to put built files}" -r "{some mock config file}" --arch="i686" {SRPM to
build}

Here is some example scripts that I use for building mock packages (this
is for the c5 mock we use for centos5 and is in c5 extras ... newer
versions for c6 will have different options):

http://people.centos.org/hughesjr/buildsystem/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos-devel/attachments/20110927/93a33a59/attachment-0007.sig>