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

Re: Where is %build's cd to build subdir setup come from?



On June 20, 2007 12:23:03 PM +0200 Toralf Lund <toralf procaptura com> wrote:
When doing rpm build with a common rpm spec file containing %setup etc,
the "build" execution will start off with something like:

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.84274
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd mypackage-1.0


- where mypackage-1.0 is typically "root" of the Source0: filename,
although it may also be specified via %setup -n or whatever.

Where exactly does the command "cd mypackage-1.0" come from? I mean, by
what mechanism does "setup" communicate to "build" that it needs to
change to this directory before starting the actual build?

I'm experimenting with a advanced (or possibly unnecessarily complex ;-))
build configuration involving a redefinition of "setup", so I really need
to know how exactly everything is done by default. Or differently put, if
I redefine setup, I always end up loosing the "cd" command in question....

%setup defines %buildsubdir, which triggers the cd, however you can't set
%buildsubdir yourself and have it work.  It's a magic (unfortunate) part
of rpm.

Redefining %setup is a bad idea.

-frank


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