Re: Installing during rebuild

[email protected] (Bob Proulx)
Newsgroups gmane.linux.redhat.rpm.general
Message-ID <[email protected]>
Wyse, Chris wrote:
> Is there a way to prevent the rpmbuild of the source rpm from performing
> the installation?  My install section is executed during rpmbuild - I
> really only want the installation done when I install the binary rpm.
> Am I missing something or doing something wrong (or both)?

Hmm...  Never install directly into the root of the filesystem.  That
would be bad.  The best way to prevent this from happening
accidentally is to never rpmbuild as root.  If you are not root then
you won't have permission to splat files into the root filesystem.

Make sure the rpm spec file is setting BuildRoot: to an image area.
A typical setting might be:

  BuildRoot: %{_tmpdir}/%{name}-%{version}-build

Then rpmbuild will %install normally but the installation will go into
the image area.  When using the above the path would typically be
something like /var/tmp/<package>-<version>-build/* enabling the
package to be built to a non-root user.

Summary: Never rpmbuild as root.

Bob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.