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

Tue Sep 27 16:49:56 UTC 2011
R P Herrold <herrold at owlriver.com>

On Tue, 27 Sep 2011, 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?

A naiive build algorithm simply submits and checks the return

Build Requirements are readily queriable, and testable as to 
whether they are met; as such one need not pay the time cost 
of enqueuing a build that is pre-ordained to fail by doing 
minimal checking first

Driving such a system off of versioned BR's require a bit more 
logic than that of the last paragraph, and may not always be 

Mutual cross-dependant BR's require manual solution 'out of 
band' of a submission engine, usually by 'short circuiting' 
around one missing 'leg' of such a cross-dependency; this kind 
of issue can also solved in .spec file conditionals logic, 
keyed on '--defines', although this is not seen in the CentOS 
project's upstream very often

>From my notes on the topic:

[herrold at centos-5 R2spec]$ cat aa_README

To break dependency loops

1.      identify a pair (or more) of affected packages

2.      note up top the circular:
#       circular on: R-acme and R-beta -- parent seems to be: 

3.      add to each package: 1) %check conditional header,
                 see: R-graph.spec

of the form:

#       check by default -- to break circular BR's use:
#       $ rpmbuild --define 'nocheck 1' [--nodeps] ...
%define docheck 0
%if "%{nocheck}" != "1"
%define docheck 1
%define nocheck 0

                 2) mark the Release, and

of the form:

Release:          1%{?dist}.%{docheck}%{nocheck}

                 3) %check stanza patches

of the form:

%if "%{docheck}" == "1"
%{_bindir}/R CMD check %{packname}

4.      build the likely parent with the following:

         rpmbuild -ba --nodeps --define 'nocheck 1'    acme.spec

5.      Assuming the acme build succeeds, install it 'nodeps' 

         sudo rpm -Uvh --nodeps   acme-result.01.whatever

6.      Assuming the acme install succeeds, build the 
subordinate in a usualfashion:

         rpmbuild -ba     beta.spec

7.      Assuming the beta build succeeds, install it conventionally:

         sudo rpm -Uvh   beta-result.10.whatever

8.      Assuming the beta install succeeds, build the parent 
in a usualfashion:

         rpmbuild -ba     acme.spec

9.      Assuming a clean build, remove the bootstrap 'acme' 
binary thus:

         sudo rpm -e --nodeps acme
                 - and -
         sudo rpm -Uvh acme-result.10.whatever

10.     files ending in ".01" are still needing solution and a
         non-nodeps build; files ending: ".10" are done

         rpm -qa | grep ^R | grep "\.[01][01]$"

[herrold at centos-5 ~]$ rpm -qa | grep ^R | grep "\.[01][01]$"
[herrold at centos-5 ~]$ date
Tue Jun  2 12:27:57 EDT 2009
[herrold at centos-5 ~]$

and R-Hmisc is blocked by packaging problems in:
         R-TeachingDemos and R-Design

rev: 090608


A sample .spec file demonstrating this is at:


As I have mentioned before, I have privately packaged most of 
the R finance, stats, and econometric packages.  Not all are 
of a License re-distributable form, sadly

  - Russ herrold

  .-- -... ---.. ... -.- -.--
Copyright (C) 2011 R P Herrold
       herrold at owlriver.com
    My words are not deathless prose,
       but they are mine.