Unpacking SRPMs

Orion Poplawski orion at cora.nwra.com
Fri May 17 16:01:36 UTC 2013

On 05/17/2013 09:59 AM, Orion Poplawski wrote:
> On 05/17/2013 08:37 AM, Florian Weimer wrote:
>> I'd like some scriptable way to unpack SRPMs up and including to the %prep
>> stage.  Ideally, the results would end up in a directory I specify, and
>> intermediate directories which only contain a single subdirectory are
>> skipped.  (The eventual goal is to run two such directory tress through diff
>> -uraN, and I want to avoid spurious differences due to an update from foo-1.2
>> to foo-1.3.)
>> I've already learned the hard way that I need to use something like mock
>> because some %prep script assume that build requires are installed.  But mock
>> does not appear to support an option to stop after the %prep stage.
>> Unpacking SRPMs seems to be fairly common operation.  Has something like this
>> already been implemented?
> Something like:
> rpm -i -D "_sourcedir /tmp/dir1" srpm
> rpmbuild -bp --nodeps -D "_builddir /tmp/dir1" /tmp/dir1/*.spec
> Should do the trick.


rpm -ivh -D "_sourcedir /tmp/dir1" -D "_specdir /tmp/dir1" <srpm>
rpmbuild -bp --nodeps -D "_builddir /tmp/dir1" /tmp/dir1/*.spec

Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       orion at nwra.com
Boulder, CO 80301                   http://www.nwra.com

More information about the devel mailing list