SCIENTIFIC-LINUX-USERS Archives

November 2016

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, 4 Nov 2016 12:09:56 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (55 lines)
On 04/11/16 11:59, David Sommerseth wrote:
> On 04/11/16 11:13, Todd Chester wrote:
>> On 11/03/2016 04:38 AM, Nico Kadel-Garcia wrote:
>>
>>> Or, you could try what I do for backports. Install "mock", add
>>> yourself to the "mock" group, and run:
>>>
>>>           mock -r epel-7-x86_64 krusader-2.5.0-1.fc26.src.rpm
>>>
>>> Then install RPMs from /var/lib/mock/ or /var/cache/mock/
>>
>> What is "mock"?
> 
> That is the a build tool which does all the RPM builds inside a fresh,
> autocreated chroot to ensure you get a clean build.  If the spec file is
> lacking needed dependencies, the build will fail.  Which again helps
> preventing creating an RPM package including dependencies which just
> happened to be installed.

Sorry, that was a confusing sentence.  What I tried to say is:

If you had installed qt5-qtbase on your box, but it was not listed in
the Requires: section of the RPM .spec file, rpmbuild would happily
build the RPM.  But if you install this RPM on a system where qt5-qtbase
would not be installed, it would fail.

Further in the same scenario, if you had qt5-qtbase installed and then
installs your own built RPM it works fine.  If a user then uninstalls
qt5-qtbase it will happen without any alarms - and your own built RPM
will fail to run again.

Using mock, it will complain at build time that a Requires: dependency
is lacking.  And you would not get an RPM out of mock before this is
fixed.  And once fixed, yum install on that RPM will automatically pull
in the qt5-qtbase dependency.  If the user then tries to uninstall
qt5-qtbase later on, it will also want to uninstall your own built RPM
due to the dependency chain being correct.


So using mock will result in far saner packages than just using rpmbuild
directly.  Using rpmbuild directly is useful though in the beginning, to
ensure things seems to build fine.  But final packages should always go
via mock.


Another useful tool when you do packaging, is to run .spec file and
produced RPM files via rpmlint.  This will also provide a good overview
if the package is in a reasonable shape.


-- 
kind regards,

David Sommerseth

ATOM RSS1 RSS2