Bug 19426 - RFE - Adding a mktemp subpath to buildroot
RFE - Adding a mktemp subpath to buildroot
Product: Red Hat Linux
Classification: Retired
Component: rpm-build (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
David Lawrence
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2000-10-19 22:40 EDT by R P Herrold
Modified: 2007-04-18 12:29 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-05 10:20:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description R P Herrold 2000-10-19 22:40:50 EDT
From rpm-list 10/19/00


On Mon, 16 Oct 2000, Jim Knoble wrote:

> : It does show up the fact that the buildroot is not clean of files
> : (once you have figured out what is going on). This can be a nasty
> : problem in and of itself.
> (Sigh.) RPM really ought to take care of cleaning and (re)creating the
> build root automagically (probably at %build or %prep time) when
> BuildRoot is set to a safe value (e.g., not '/').
Thinking about this -- Is there any reason, as least in a -ba
context, _not_ to use a BuildRoot value of %{buildroot} PLUS a
temp sub-directory, based, say, on 'mktemp -d' ? -- This would
end this issue.

The mktemp package is tiny -- under 7k -- and are not
unreasonable as a Require for   rpm-build  .
It looks as simple as modifying /usr/lib/rpm/macros at about
line 116 with:

    %buildroot=`mktemp -d $TEMPBR/rpm-build.XXXXXX`

But grepping -i through /usr/lib/rpm shows that some
conditional definition of BuildRoot and buildroot is 
happening, so this may not be as simple as it appears.
... mktemp is in /bin if one is inclined to add the
full path --
Comment 1 Jeff Johnson 2000-10-22 09:01:14 EDT
There is little reason (other than legacy) to permit building without a
buildroot these day.
And,  if buildroot is enabled by default, then automagically re-creating in
%install and
removing in %clean are trivial to add.

There is legacy packaging, and that prevents changing rpm's implementation at
this time.

I see no reason to use mktemp to generate a random name of a sub-directory,
as detecting the generated name complicates building packages. Besides, I
that you can already do this from the command line if you choose, as the
in the implementation of buildroot are there to permit the command line to
override the
configurartion which overrides the value found in the spec file. That means
	rpm -ba ... --buildroot `mktemp /var/tmp/rpm-build.XXXXXX` ...
should do the job.
Comment 2 Jeff Johnson 2001-02-21 13:20:12 EST
Changing component.
Comment 3 Pavel Roskin 2001-12-04 17:47:47 EST
--buildroot doesn't work with rpm-4.0.3-1.03 as shipped with RedHat 7.2.

$ rpm -tb --buildroot /var/tmp/mc-build mc-4.5.99a.tar.gz 
--buildroot: unknown option

This can be a separate bug, but it's closely related.

In my opinion, there is no reason to honor the value of buildroot in the
specfile. Only the _existence_ of the option matters. Intruducing buildroot in
its present form (i.e. with directory name) was an error IMHO. The option should
be boolean.
Comment 4 Jeff Johnson 2001-12-05 10:20:20 EST
I agree, but what's done is done, and it's gonna take a while longer
to change the paradigm.
Comment 5 R P Herrold 2002-10-28 16:05:39 EST
Buildtroot roll in is sufficiently wide, that this is no longer the right
solution -- as the initiial submitter, I am closing

Note You need to log in before you can comment on or make changes to this bug.