Bug 379181

Summary: RFE: Enable me to use yum-builddep on .spec files
Product: [Fedora] Fedora Reporter: Sindre Pedersen Bjørdal <sindrepb>
Component: yum-utilsAssignee: Seth Vidal <skvidal>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: awilliam, davidf, matt, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-21 21:36:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sindre Pedersen Bjørdal 2007-11-13 00:18:05 UTC
Description of problem:
yum-builddep currently allows you to use yum to get the build dependencies of a
SRPM. This is a very useful tool, but I think adding the ability to get the
build deps from a .spec file would be a great feature. It would allow me, and
other people working with packaging, to get the build dependencies specified in
the spec automatically, instead of manually parsing the spec for the
buildrequires and yum installing them as I do now. The build requires are there
in the spec, so I assume it wouldn't be that hard to add this feature to the
existing yum-builddep tool, then again, what do I know.

Version-Release number of selected component (if applicable):
1.1.8-1

Steps to Reproduce:
1. Start building an RPM from scratch, by getting the source tarball and writing
a .spec file. 
2. Add the build deps you know of to the .spec
3. yum-builddep file.spec
  
Actual results:
No such package(s) file.spec.src

Expected results:
Install the build deps specified in the spec (along with the basic tools
required for building any rpm package) with dep resolving and all so I can
proceed with the packaging.

Additional info:
I know I can create a SRPM from a spec using some rpm trickery, the makefile in
the fedora build system does this, but I'd still like to get the builddeps with
yum-builddep

Comment 1 Seth Vidal 2007-11-13 03:39:17 UTC
if you have a spec file then you can probably make a srpm out of it and just
pass that to yum-builddep.

Doesn't that achieve the same result?


Comment 2 Panu Matilainen 2007-11-13 09:39:22 UTC
There's no way to query build dependencies of a spec from rpm-python currently,
that'd need doing first to properly handle it.

Comment 3 Adam Williamson 2009-09-24 21:46:29 UTC
*** Bug 525580 has been marked as a duplicate of this bug. ***

Comment 4 Matt McCutchen 2011-03-21 15:07:09 UTC
(In reply to comment #1)
> if you have a spec file then you can probably make a srpm out of it and just
> pass that to yum-builddep.
> 
> Doesn't that achieve the same result?

Yes.  That's what mock does.  It's just slower.

(In reply to comment #2)
> There's no way to query build dependencies of a spec from rpm-python currently,
> that'd need doing first to properly handle it.

I am thinking of implementing this.  It should only take a couple lines of code to expose the spec->buildRestrictions field to python.

Comment 5 Panu Matilainen 2011-03-21 15:19:19 UTC
Actually this has been implemented recently, in F >= 15 yum-builddep can be used on spec files directly.