RPM Community Forums

Mailing List Message of <rpm-devel>

Re: Another strange request

From: Ralf S. Engelschall <rse+rpm-devel@rpm5.org>
Date: Fri 14 Dec 2007 - 13:09:56 CET
Message-ID: <20071214120955.GA95887@engelschall.com>
On Fri, Dec 14, 2007, Ralf S. Engelschall wrote:

> I'm currently trying to figure out whether the following would be
> possible to easily support VCS-less package modifications for end users:
>
> 1. Someone unpacks a *.src.rpm to the local filesystem
> 2. He changes some files (usually via svs(1) which automatically
>    generates the *.orig files for him, etc) according to his needs.
> 3. He then packs a new *.src.rpm from the changed source files.
>
> And here the request comes: could it be achieved that for each already
> existing "SourceX: foo" and "PatchX: bar" lines in the *.spec file,
> an RPM macro hack automatically generates additional "Source1000X:
> foo.orig" and "Patch1000X: bar.orig" lines in order to include those
> files into the new *.src.rpm?
>
> The question is not whether the Source1000X tags can be generated.
> That's clear, it can be done similar to what I did yesterday for
> the Environment tag. The question is how I can figure out in the
> generation-macro which *.orig files exists. For this I first have to...
>
> 1. reliably locate the *.spec file.
>    How can this be done?
>    A "rpm --eval '%{_specdir}'" doesn't work as it still might contain
>    %{name} which depends on the current package.
>
> 2. query all its SourceX and PatchX header.
>    How can this be done?
>    A "rpm -q --specfile *.spec --qf '%{SOURCE0}' didn't worked.
>
> Any clues?

Oh, just in case it is not clear: the *only* intention is to make sure
the *.orig files are included into the *.src.rpm file. Nothing more is
needed (not even a %setup or whatever for those files). So, perhaps
there is another solution to force RPM to include those files without
having to manually create SourceX and PatchX tags for them...

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com
Received on Fri Dec 14 13:10:31 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.