Macros in Source fields (was: Re: Prelink success story :))

Michael Schwendt ms-nospam-0306 at arcor.de
Fri Feb 27 13:18:37 UTC 2004


On Fri, 27 Feb 2004 06:51:02 -0500 (EST), Mike A. Harris wrote:

> On Fri, 27 Feb 2004, Michael Schwendt wrote:
> 
> >> Macros work fine for me in Source tags, with URLs and without.  
> >> See the xchat spec file for an example.
> >> 
> >> pts/34 mharris at porkchop:~/rpmbuild/rpms/xchat$ grep Source xchat.spec
> >> Source:    http://www.xchat.org/files/source/2.0/xchat-%{version}.tar.bz2
> >
> >You haven't payed attention to the detail:
> >
> >  $ wget http://www.xchat.org/files/source/2.0/xchat-%{version}.tar.bz2
> >  ERROR 404: Not Found.
> 
> Why on earth would you wget on the commandline with an rpm macro 
> embedded into the commandline?  That is user-error.  Do not cut 
> and paste the URL from the spec file to the commandline.

Do not put macros into web URLs.
 
> First of all, if you have the src.rpm installed, you _have_ the 
> source code already, and do not need to download it.

I do have to compare the included tarball MD5 with upstream MD5.
Alternatively, I need to visit the web page, find the download
section and download manually from there.

> If you want 
> to anyway for some reason, you have the URL where it is located 
> and can hand edit it to be useable if desired, or can cut and 
> paste the directory and go from there.

Often doesn't work because directory indexing is not allowed.
 
> I believe you can also query the spec file using --specfile to 
> get the Source and Patch lines, however I'd have to confirm that.

Only to find out the URL is no longer valid because the packager
has a working one in his own private bookmarks.
 
> >And upon building source and binary rpm, the
> >http://www.xchat.org/files/source/2.0/ is stripped off, and only
> >the expanded xchat-%version.tar.bz2 is included in the RPM
> >header.
> 
> $ rpm -qp --qf '%{source}\n' /mnt/redhat/beehive/comps/dist/fc2/xchat/2.0.7-3/SRPMS/xchat-2.0.7-3.src.rpm
> xchat-2.0.7.tar.bz2

Proves what I write above. :)
 
> 2) To store the URL (if any given) in the Source field of the RPM 
> header, for people querying the src.rpm from the commandline 
> with rpm.

See above, didn't work for you.

> I'm not about to change the Source fields in any of my own spec
> files to hard code the version and remove the existing macro
> usage, which is correct,

No one requires you do to that. You have misunderstood what all this
is about. *sigh*

> howver feel free to edit your own spec
> files and change the version number in 10 places every time a new

Why 10 places? Two places is enough. "Version:" and "Source:",
everywhere else %{version} is fine.

> version of the software you're maintaining comes out, and ensure
> every location is updated, and track down the bugs/problems 
> caused if you forget in some location.
 
If I forgot to updated the version in Source tag, the package would not
even build. We've discussed this earlier.


Sorry for cutting off much of your message, but I don't understand what
you're aiming at. I don't want another heated thread based on
misunderstandings.

-- 





More information about the fedora-devel-list mailing list