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.
--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.
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.
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.
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??
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.