SCIENTIFIC-LINUX-USERS Archives

November 2014

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
David Sommerseth <[log in to unmask]>
Reply To:
Date:
Fri, 14 Nov 2014 23:34:47 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (52 lines)
On 13/11/14 21:30, ToddAndMargo wrote:
>> Do you know how to use 'mock'? Can you RPM
>> wrap it, or work from the older RPM's to update them and build them
>> with 'mock', so you get a clean list of the dependencies in the .spec
>> file?
> 
> Hi Nico,
> 
> Sadly, I don't know how.

A very quick and rough mock crash course, purely from my memory and it
may contain some errors.

yum install mock

Then ensure you become member of the new 'mock' group.

rpm -hvi $SRC_RPM

Then edit ~/rpmbuild/SPECS/$package.spec file with your modifications.
Look for the %setup section, where %configure often is a macro for
running ./configure.  But arguments to %configure are passed on further
to ./configure.

rpmbuild -bs  ~/rpmbuild/SPECS/$package.spec

This should give you a src.rpm in ~/rpmbuild/SRPMS/$package....

To run a mock build, do this:

  mock --rebuild $SRC_RPM -r $CONFIGNAME

$CONFIGNAME can for example be epel-7-x86_64.  When it has completed (or
failed), you can find the results in /var/lib/mock/.... with complete
build logs and all packaged RPMs if it was successful.

All defalt configs packaged with mock can be found in /etc/mock.  You'll
see an extensive list of Fedora and EPEL here.  Might even find
addtional ones for CentOS or SL other places too.  The point is that
using this method you can easily build packages for many distros in a
safe and correct manner, without too much worries.  All builds happens
in a mock chroot with the proper compiler and libraries installed for
that distro.

For anyone who haven't played with mock, I can highly recommend it!


-- 
kind regards,

David Sommerseth

ATOM RSS1 RSS2