Bug 26210

Summary: rpm --tarbuild vestigial
Product: [Retired] Red Hat Linux Reporter: D. Hugh Redelmeier <hugh>
Component: rpm-buildAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: hugh
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-06 19:41:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description D. Hugh Redelmeier 2001-02-05 20:46:29 UTC
In RHL7.0, the rpm(8) lists --tarbuild as a flag but there is no
description of the meaning.  Furthermore, the rpm command seems not to
recognize this flag.  My guess is that the -t option fulfills this
function.  BTW, the -t option is not well described.  How does it determine
which file to use as the spec?  It appears to understand .tgz files (I
tried this), but the manual does not suggest this.

Comment 1 Jeff Johnson 2001-02-07 17:58:15 UTC
--tarbuild is identical to other rpm build modes except 
	1) argument is a tar ball
	2) a file with extension *.spec is expected, and silently extracted
	to perform the build.

Te option, if correctly used, should handle variant extensions, as the internal
gzip
magic is used to determine operation, not the external extension.

I suspect that you need to install the rpm-build package as well.

Comment 2 D. Hugh Redelmeier 2001-03-25 23:17:32 UTC
Please check again.  The rpm man page, in the synopsis, lists:
	rpm [--tarbuild] [tarredsource]+
If I type "rpm --tarbuild rp-pppoe-3.0.tar.gz", I get from rpm 4.02:
	--tarbuild: unknown option
(This is the same message as I get when I try "rpm --unlikelyoption".)

Another brush with this stuff.
I needed to build the Roaring Penguin PPPoE package.  I fetched the tarball.  It
contains two .spec files.  So I tried "rpm -ta rp-pppoe-3.0.tar.gz".  It the
wrong .spec :-(.  I think that it should allow me to specify which one I want OR
build all of them.

None of this matches the synopsis which says:
	rpm [-b|t] [package_spec]+
I think that it should say something like:
	rpm -b [package_spec]+
	rpm -t tarredsource

The documentation is unclear and wrong and the program's behaviour is
counterintuitive so the documentation matters.

Another example: A failed build leave crud around that interferes with the next
build.  Just what does --clean do?  It sounds as if it will only work after a
build completes.  I really need it *before* a build.


Comment 3 Jeff Johnson 2001-03-26 13:53:28 UTC
A tarbuild  expects a single *.spec file, having two spec files is asking for
trouble,.
Build rp-pppoe from a spec file using rpm -ba instead.

Yup the doco for rpm sucks.

If you want to clean everything before a build, then you need to run
	rpm --clean --rmsource --force <your_specfile_here>
just before building.

Comment 4 D. Hugh Redelmeier 2001-04-29 16:30:51 UTC
According to my experiments,
         rpm --clean --rmsource --force <your_specfile_here>
only cleans up the source, not the wreckage of a previous build.  This is really
inconvenient.  I infer that it is the responsibility of the .spec file %prep
section to explicitly blow away $RPM_BUILD_ROOT, but only if it isn't /!

rpm -b allows for multiple spec files, why doesn't -t??

Comment 5 Jeff Johnson 2001-07-29 16:22:36 UTC
The usual convention is to clean $RPM_BUILD_ROOT at the
start of %install, not %prep:
	%install
	rm -rf ${RPM_BUILD_ROOT}
but this is left to the packager, not rpm.

rpm does guarantee that RPM_BUILD_ROOT is not "/"
oe any of the myriad variant's like /../

Building from a tarball is a hack to extract a single conventionally
named spec file from a tarball, and then run "rpm -ba". I see no
need to implement anything other than what is there now.