Bug 250951 - rpmbuild -bp rpm.spec cannot find rpm-4.4.2.tar.gz
Summary: rpmbuild -bp rpm.spec cannot find rpm-4.4.2.tar.gz
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm   
(Show other bugs)
Version: 7
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2007-08-06 01:48 UTC by Philip Ashmore
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-08-28 06:16:54 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Philip Ashmore 2007-08-06 01:48:57 UTC
Description of problem:
rpmbuild -bp rpm.spec cannot find rpm-4.4.2.tar.gz

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

How reproducible:

Steps to Reproduce:
1. rpm -i rpm-4.4.2-46.fc7.src.rpm
2. cd ~/rpmbuild/rpm-4.4.2
3. rpmbuild -bp rpm.spec

The home directory (~) expands differently depending on your user name, so I've
put '~' everywhere the absolute path to my home directory occured.
Actual results:
error: File ~/rpmbuild/rpm-1.10.2/rpm-4.4.2.tar.gz: No such file or directory

Expected results:
rpmbuild should be looking for ~/rpmbuild/rpm-4.4.2/rpm-4.4.2.tar.gz

Additional info:
I've installed Mike A. Harris's rpmbuild-nonroot files - see 
It appears from looking at the rpm.spec file that it's using the version info
from rpm.spec line 74:
    Requires: popt = 1.10.2
- to locate the package source directory.

Comment 1 Paul Nasrat 2007-08-06 10:54:58 UTC
I don't recommend Mike Harris's rpmbuild-nonroot , try rpmdevtools from fedora
as using %{version} will get confused in packages like rpm that have packages
with multiple versions (it's the %package popt ... Version: not the line you
point out).

Comment 2 Philip Ashmore 2007-08-08 01:02:11 UTC
I just tried rpmdevtools.
It seems to only allow you to install one source RPM package that gets unpacked
into the ~/rpmbuild/SOURCES directory - except for the .spec file - that goes
into the ~/rpmbuild/SPEC directory.

I tried to add the line
    %_sourcedir     %{_topdir}/SOURCES/%{name}-%{version}
to ~/.rpmmacros so that each installed source RPM would reside in it's own
directory, but the problem re-surfaced - it seems that having "%{version}"
anywhere in the %_sourcedir reproduces this problem - as you stated.

rpmbuild needs to copy the "version" variable to "rpm_version" or something
similiar the first time the "release" tag (barring a better option) is seen in
order to resolve this situation as it appears that the "version" variable is
being stepped on and so is unusable for this purpose.
This approach hinges around the issue that there seems to be no way to identify
a particular package as the "root" or "payload" package that these variables
should come from - the one the entire source RPM would hopefully have been named

Also is there a good reason for keeping the spec files in their own directory?

Comment 3 Panu Matilainen 2007-08-08 09:39:00 UTC
The only sane fix for this is to not try to bundle several packages with
different packages into one spec IMO. Popt living inside rpm is a historical
artifact mostly, one that's about to be removed for good by making popt into a
standalone package as it should: see bug #249352.

Comment 4 Red Hat Bugzilla 2007-08-21 05:35:32 UTC
User pnasrat@redhat.com's account has been closed

Comment 5 Panu Matilainen 2007-08-22 06:33:53 UTC
Reassigning to owner after bugzilla made a mess, sorry about the noise...

Comment 6 Panu Matilainen 2007-08-28 06:16:54 UTC
This has now been "fixed" in rawhide by splitting out popt from the rpm package. 

Attempting to fix all the cases where separate packages with their own versions
are produced from a single spec with any arbitrary %_sourcedir isn't worth it.

Note You need to log in before you can comment on or make changes to this bug.