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

Re: $RPM_BUILD_ROOT vs. %_buildroot



On Wed, 20 Dec 2000, Jeff Johnson wrote:

>On Wed, Dec 20, 2000 at 12:04:27AM -0500, Mike A. Harris wrote:
>> Aside from backwards compatibility issues, is there any good
>> reason to continue using $RPM_BUILD_ROOT over %_buildroot?
>>
>
>No reason except that you have absolutely no guarantee that the macro names
>won't change, thereby breaking your packaging. Even if the names are preserved
>forever, you have no guarantee that the value will be as expected or
>desired when the macro is expanded in a new or different context. Try doing
>	%define	_sourcedir /tmp
>or
>	%define _dbapi 2
>in the middle of a spec file if you want to watch the worms crawl out of
>the can.
>
>That's not true with RPM_* shell variables, the names are never going to change,
>and the context in which the variables are set (i.e. beginning of a build
>scriptlet) is simple, clear and explicit.

Ok, thats what I wanted to hear.  The reason I asked, is because
in my quest for RPM young jedi status, I am reading all the
config files (next source code) trying to become more enlightened
in the ways of the dark side, and I came across a comment
mentioning obsolescence (sp?):

[/usr/lib/rpm/macros]
#==============================================================================
# ---- Scriptlet template templates.
#       Global defaults used for building scriptlet templates.
#
# XXX legacy configuration, this will be eliminated after rpm-3.0.4.
%_preScriptEnvironment  \
RPM_SOURCE_DIR=\"%{_sourcedir}\"\
RPM_BUILD_DIR=\"%{_builddir}\"\
RPM_OPT_FLAGS=\"%{optflags}\"\
RPM_ARCH=\"%{_arch}\"\
RPM_OS=\"%{_os}\"\
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
RPM_DOC_DIR=\"%{_docdir}\"\
export RPM_DOC_DIR\
RPM_PACKAGE_NAME=\"%{name}\"\
RPM_PACKAGE_VERSION=\"%{version}\"\
RPM_PACKAGE_RELEASE=\"%{release}\"\
export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE\
%{?buildroot:RPM_BUILD_ROOT=\"%{buildroot}\"\
export RPM_BUILD_ROOT}

%___build_shell         %{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}
%___build_args          -e
%___build_cmd           %{?_sudo:%{_sudo} }%{?_remsh:%{_remsh} %{_remhost} }%{?_%___build_pre   \
RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
RPM_OPT_FLAGS=\"%{optflags}\"\
RPM_ARCH=\"%{_arch}\"\
RPM_OS=\"%{_os}\"\
export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\
RPM_DOC_DIR=\"%{_docdir}\"\
export RPM_DOC_DIR\


The "XXX legacy configuration, this will be eliminated after
rpm-3.0.4." is the part I'm refering to.  It appeared to me that
the RPM_BLAH_BLAH stuff was legacy only and would disappear.

So, is my assumption incorrect?  Is the comment invalid?
Thanks again.

TTYL


----------------------------------------------------------------------
      Mike A. Harris  -  Linux advocate  -  Open source advocate
          This message is copyright 2000, all rights reserved.
  Views expressed are my own, not necessarily shared by my employer.
----------------------------------------------------------------------

Emacs is my operating system, and Linux its device driver.
  -- Bake Timmons





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