Rpmbuild works differently on Centos 6

Issues related to applications and software problems
Post Reply
JimsOffice
Posts: 16
Joined: 2008/01/16 15:49:04

Rpmbuild works differently on Centos 6

Post by JimsOffice » 2012/05/04 14:06:37

I am attempting to generate an .rpm file from a spec file that works OK on cents 4 and 5. But fails miserably on 6.

Here's the %files section of the spec file:


%files
%defattr(-,root,root)
/usr/local/bin/logpoll
/etc/cron.daily/logpoll_cron
/etc/cron.d/logpoll_cmd

When I do a rpmbuild -bb logpoll.spec

I get a bunch of messages, "file not found" that reference (for example)


rpmbuild -bb logpoll.spec
Processing files: logpoll-1-62.x86_64
error: File not found: /home/jim/rpmbuild/BUILDROOT/logpoll-1-62.x86_64/usr/local/bin/logpoll
error: File not found: /home/jim/rpmbuild/BUILDROOT/logpoll-1-62.x86_64/etc/cron.daily/logpoll_cron
error: File not found: /home/jim/rpmbuild/BUILDROOT/logpoll-1-62.x86_64/etc/cron.d/logpoll_cmd

I'm guessing something in the configuration changed. I tried rpmbuild --buildroot=/ -bb logpoll.spec
and

rpmbuild --buildroot='' -bb logpoll.spec

But it complained that the buildroot can't be /.

Can anyone tell me how I can get rpmbuild back to working like it did before?

Thanks,
Jim.

azca
Posts: 174
Joined: 2006/06/03 18:06:13
Location: Peoria, AZ USA

Rpmbuild works differently on Centos 6

Post by azca » 2012/05/04 21:06:16

On my CentOS-6 system, the directory 'BUILDROOT' was automatically created by something I rebuilt.

I have this:

[code]
[username@sony rpmbuild]$ ls -al
total 32
drwxr-xr-x 8 username username 4096 Jan 27 10:41 .
drwxr-xr-x 5 username username 4096 Feb 5 08:21 ..
drwxr-xr-x 2 username username 4096 Feb 12 06:09 BUILD
drwxr-xr-x 2 username username 4096 Feb 12 06:08 BUILDROOT
drwxr-xr-x 4 username username 4096 Feb 4 11:04 RPMS
drwxr-xr-x 2 username username 4096 Feb 12 05:59 SOURCES
drwxr-xr-x 2 username username 4096 Feb 12 06:01 SPECS
drwxr-xr-x 2 username username 4096 Feb 12 06:08 SRPMS
[username@sony rpmbuild]$
[/code]
So maybe just creating 'BUILDROOT' manually would solve the problem?

Edit to add: http://wiki.centos.org/HowTos/RebuildSRPM

AndrewSerk
Posts: 60
Joined: 2010/11/21 03:41:16

Re: Rpmbuild works differently on Centos 6

Post by AndrewSerk » 2012/05/07 15:04:38

This is what I do to setup a build environment:
[code]su -c 'yum groupinstall "Development tools" '
rpmdev-setuptree
su -c 'useradd mockbuild'[/code]


Then you can build from /home/usrname/rpmbuild/.......

Hope this helps,

Andrew

Post Reply