Bug 19426 - RFE - Adding a mktemp subpath to buildroot
Summary: RFE - Adding a mktemp subpath to buildroot
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm-build
Version: 7.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact: David Lawrence
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2000-10-20 02:40 UTC by R P Herrold
Modified: 2007-04-18 16:29 UTC (History)
0 users

Clone Of:
Last Closed: 2001-12-05 15:20:25 UTC

Attachments (Terms of Use)

Description R P Herrold 2000-10-20 02:40:50 UTC
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 13:01:14 UTC
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 18:20:12 UTC
Changing component.

Comment 3 Pavel Roskin 2001-12-04 22:47:47 UTC
--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 15:20:20 UTC
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 21:05:39 UTC
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.