rpm build error: Directory not found /usr/src/packages/BUILDROOT

Hi everbody,
Would you give me any suggestions about the problem is explained below.

I have just installed SuSE 12.2.

I have entered the command below

rpmbuild -ba /usr/src/packages/SPECS/myfile.spec 

then I got error

error: Directory not found /usr/src/packages/BUILDROOT/myfile.i386/file1

Before this version, it was suse 10.1 and was working properly.

I m invoking buildrpm command as a rootuser.

The only difference which I realized that …/BUILDROOT directory is absent in 10.1.

I think rpmbuilds uses …/BUILD directory in 10.1 .

It is new in 12.2.

Is there any particular need to evoke the command as the root user? I always build my rpm packages as normal user and it creates it’s own rpmbuild directory in my home folder.

On Thu 17 Jan 2013 12:16:02 PM CST, roll84 wrote:

Hi everbody,
Would you give me any suggestions about the problem is explained below.

I have just installed SuSE 12.2.

I have entered the command below

rpmbuild -ba /usr/src/packages/SPECS/myfile.spec

then I got error
> -error: Directory not found
> /usr/src/packages/BUILDROOT/myfile.i386/file1-

Before this version, it was suse 10.1 and was working properly.

I m invoking buildrpm command as a rootuser.

The only difference which I realized that …/BUILDROOT directory is
absent in 10.1.

I think rpmbuilds uses …/BUILD directory in 10.1 .

It is new in 12.2.

Hi
You don’t need to be root user for building rpms…

It now uses your home directory for building in and should create
automatically the rpmbuild directory structure including BUILD and
BUILDROOT.

Have you looked at using the Open Build Service and the cli client osc?


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
up 15:12, 3 users, load average: 0.08, 0.09, 0.06
CPU Intel® i5 CPU M520@2.40GHz | GPU Intel® Ironlake Mobile

Yes, it is exactly as you said.
rpmbuild command is in a script which can be invoked by root user. Some copy and remove actions performed needs root permission.

Consequently, I have to be root.
Other circumstance (Being ordinary user) costs me some overhead.

On Thu 17 Jan 2013 02:26:01 PM CST, roll84 wrote:

Consequently, I have to be root.
Other circumstance (Being ordinary user) costs me some overhead.

Hi
I would grab any recent src rpm and rebuild that with rpm;


rpmbuild --rebuild <some.src.rpm>

This should create the correct build structure for you to re-use.

No overhead using OBS :wink: then use osc locally. You should consider it,
so much simpler and less system overhead with having to manually install
all the devel files… building locally has the space overhead for rpms
(I’m currently using 9GB of disk space for 71 different OBS projects)


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 12.2 (x86_64) Kernel 3.4.11-2.16-desktop
up 17:21, 3 users, load average: 0.00, 0.03, 0.05
CPU Intel® i5 CPU M520@2.40GHz | GPU Intel® Ironlake Mobile

Would fakeroot work? I think there are packages for it on obs. You can use it such as: fakeroot rpmbuild -bb package.spec