Hi everyone!
I run into a strange situation while running rpmbuild -bb. Would very appreciate your comments.
Background
I use SuSE 10.1.
My rpmbuild command is: rpmbuild -bb --buildroot /tmp/mypackage/BUILD --define ‘_topdir /tmp/mypackage’ myPackage.spec.
The RPM_BUILD_ROOT is set to /tmp/mypackage/BUILD.
The %build section in myPackage.spec file is completely empty.
Problem
After adding set -x to the .sh file which calls rpmbuild, I see the following output:
cd /tmp/mypackage/BUILD
**+ /bin/rm -rf /tmp/mypackage/BUILD
++ dirname /tmp/mypackage/BUILD
/bin/mkdir -p /tmp/mypackage
/bin/mkdir /tmp/mypackage/BUILD**
exit 0
I know that the “umask” and the “cd” commands are executed for every section in the spec file, so I’m not worried about them. However, the 4 other commands (in red) seem to appear out of nowhere!
I already searched my scripts and files for the mysterious commands, but found nothing.
Oh, thanks! I appreciate your answer.
So - just want to make sure - I can’t find these 4 commands in any of the scripts because they are part of the rpmb executable?
What happened in the move from 11.1 to 11.2? You used to be able to leave %install blank with rpmbuild -bb but now its a disaster.
In a large consortium using RedHat Linux and hoping to use openSUSE, I’ve been using the same spec file to generate binary RPMs using:
BuildRoot: %{_builddir}/%{name}-%{version}
which will extract a binary tarball to:
BUILD/myName-myVersion-myRelease.x86_64
Note in particular I defined BuildRoot: not something called Build:. By the way I can set it to anything I like, but it still won’t work. It worked perfectly in openSUSE 11.1.
for example, /usr/lib/rpm/macros will move the files to:
This causes builds to fail and means that you probably need:
%install
cp -rP * $RPM_BUILD_ROOT/
because ridiculously the definition of $RPM_BUILD_ROOT is changed from BUILD to BUILDROOT on the fly inside the scripts. I thought that perhaps I could avoid the change by logging in as root or setting up visudo for ALL rights to the user, but brp-compress wants to change the RPM_BUILD_ROOT no matter what.
Removing %build doesn’t do anything. This is the really old fix to the rpmbuild -bb problem that most people know about now.
The issue stated in the thread is a brand new issue which I alerted the developers to a few months ago, but have received no reply.
It looks like you will actually need to include:
%install
cp -rP $BUILDROOT/* $RPM_BUILD_ROOT
The logic is all wrong as the previous person (cat_in_hat) has so well described in detail.
There was never a requirement for an install step content. It was always left blank. I’ve been building on openSUSE 9.3, 10.3 and 11.0, 11.1 over the past 5 years and this is only found in 11.2. I’m using a build system that automatically generates the spec file for RedHat systems and Yellow Dog Linux which both work fine. Only openSUSE shows up this issue.