How to use mock to build packages for SLC

Introduction

Mock project web page is here: http://www.fedoraproject.org/wiki/Projects/Mock (mock parameters explained).

Installation of mock

You need to install mock version => 0.6 (in older there is hard to change location of directory with config files). I did it that way:

wget http://linuxsoft.cern.ch/fedora/linux/extras/5/SRPMS/mock-0.6.8-3.fc5.src.rpm
rpmbuild --rebuild mock-0.6.8-3.fc5.src.rpm
rpm -i /usr/src/redhat/RPMS/`uname -i`/mock-0.6.8-3.`uname -i`.rpm

Configuration

As it is written in documentation: "Builds are done in /var/lib/mock, so be sure you have room. It cannot really be changed, but you can bind mount another directory on top of /var/lib/mock to use a bigger filesystem if needed."

Add yourself to mock group. Setup some workspace directory and copy there config file (see - slc-4-i386-core.cfg)

mkdir workspace
cd workspace
mkdir results
cp ?/slc-4-i386-core.cfg .

Change file slc-4-i386-core.cfg, following :

config_opts['buildgroup'] = 'build'
config_opts['chrootuser'] = 'mockbuild'
config_opts['chrootgroup'] = 'mockbuild'

Creation of (ch)root directory

Following command shall create directory /var/lib/mock/slc-4-i386-core-01

mock init -r slc-4-i386-core.cfg --configdir=. --resultdir=results --uniqueext=01

Unfortunately, SLC repo doesn't contain package buildsys-build, so we need to install mock in this chroot environment manually.

/usr/sbin/mock-helper yum --installroot /var/lib/mock/slc-4-i386-core-01/root install /usr/src/redhat/RPMS/i386/mock-0.6.8-1.i386.rpm

You will also need to install following packages:

/usr/sbin/mock-helper yum --installroot /var/lib/mock/slc-4-i386-core-01/root install rpm-build

Missing packages

But there are still some packages missing:

/usr/sbin/mock-helper yum --installroot /var/lib/mock/slc-4-i386-core-01/root install make gcc bison flex diffutils bzip2 cvs automake

Building

Sample SRPMs rebuilding could be done using following command:

mock rebuild -r slc-4-i386-core.cfg --debug --no-clean --configdir=. --resultdir=results --uniqueext=01 /afs/cern.ch/project/linux/cern/slc44/SRPMS/zsh-4.2.0-3.EL.3.src.rpm

You will find final RPM packages in results directory

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatcfg slc-4-i386-core.cfg r1 manage 1.1 K 2007-02-06 - 17:21 LeszekGrzanka mock config for SLC
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r6 - 2007-03-14 - LeszekGrzanka
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LinuxSupport All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback