Re: %doc: how to specify a Source<n> for the %doc directive?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 10, 2015 at 12:21:16PM +0100, zosrothko wrote:
> Hi
> 
> I have a rpm.spec with 2 Sources, one for the source code named Source0 and the
> second for the documentation named Source1 -- see below snippet of the spec --.
> The execution of the %doc directive jumps into the Source0 directory --
> rendered in bold in the log below -- while it should jumps into the Source1
> directory poco-1.7.0-all-doc in  as specified by the second %setup
> 
> So how could I fix this directory change?
> 
> Source0:           file://localhost/home/fandre/poco/releases/%{name}-%
> {version}-all.tar.gz
> Source1:           file://localhost/home/fandre/poco/releases/%{name}-%
> {version}-all-doc.tar.gz
> ...
> %prep
> #%setup -qn %{name}-%{gittag0}
> %setup -T -b 0 -qn %{name}-%{version}-all
> %setup -T -b 1 -qn %{name}-%{version}-all-doc

The second line here is the problem.  One of the following is what I'd
suggest:

  # Setup will put you in the directory you just unpacked.  You can then
  # unarchive the second source into that directory:
  %setup -T -b 0 -qn %{name}-%{version}-all
  tar -xzvf %{source1}

  # The second time you run setup it will run inside of the directory that
  # the first setup command created.  We must make sure that the -n
  # parameters match, otherwise rpm will be confused about the directory to
  # place the documentation into.
  %setup -T -b 1 -qn %{name}-%{version}-all
  %setup -T -D -a 1 -qn %{name}-%{version}-all

Both of the above styles create a single "build directory" for rpm and untar
the second source archive inside of there.  This is the way that rpm was
designed so it's the way we work with it.

You can find more information on when various rpm flags prove useful here:
http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html#S3-RPM-INSIDE-SETUP-MULTI-SOURCE

-Toshio

Attachment: pgpzmkq1UAa0c.pgp
Description: PGP signature

--
packaging mailing list
packaging@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/packaging@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux