Bug 250951 - rpmbuild -bp rpm.spec cannot find rpm-4.4.2.tar.gz
rpmbuild -bp rpm.spec cannot find rpm-4.4.2.tar.gz
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-05 21:48 EDT by Philip Ashmore
Modified: 2007-11-30 17:12 EST (History)
0 users

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


Attachments (Terms of Use)

  None (edit)
Description Philip Ashmore 2007-08-05 21:48:57 EDT
Description of problem:
rpmbuild -bp rpm.spec cannot find rpm-4.4.2.tar.gz

Version-Release number of selected component (if applicable):
rpm-build-4.4.2-46.fc7.i386.rpm

How reproducible:
very

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 
http://www.rpm.org/hintskinks/buildtree/
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 06:54:58 EDT
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-07 21:02:11 EDT
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
after.

Also is there a good reason for keeping the spec files in their own directory?
Comment 3 Panu Matilainen 2007-08-08 05:39:00 EDT
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 01:35:32 EDT
User pnasrat@redhat.com's account has been closed
Comment 5 Panu Matilainen 2007-08-22 02:33:53 EDT
Reassigning to owner after bugzilla made a mess, sorry about the noise...
Comment 6 Panu Matilainen 2007-08-28 02:16:54 EDT
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.