top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

rpmbuild environment CentOS5 vs CentOS6

0 votes
310 views

On CentOS5 I was used to create a simple spec file where at the end I'll declare files and directories I wan't to package:

%files
%dir /opt/myapp
%dir /opt/myapp/bin
%dir /opt/myapp/etc
/opt/myapp/bin/exec01
/opt/myapp/etc/myapp.conf

I'll copy the file in /usr/src/redhat/SPECS and run "rpmbuild -bb myapp.spec".

On CentOS6 rpm-build package no longer creates the /usr/src/redhat/... directory tree. I followed the CentOS6 Wiki instructions to setup my rpmbuild environment for a regular user.

When I try to build the package on CentOS6 I'm getting this error for every single file and directory:

File not found:

/home/myhome/rpmbuild/BUILDROOT/myapp-5.2-1el6.x86_64/opt/myapp/bin/exec01

I tried to override buildroot:

rpmbuild -bb --define="buildroot /" myapp.spec
 error: %{buildroot} can not be "/"

As a workaround I can manually create /home/myhome/rpmbuild/BUILDROOT/myapp-5.2-1el6.x86_64/ and copy all my file in there but that's a lot of extra work.

Is there a way to get the same functionality on CentOS6 where rpmbuild will collect the files from the main / directory and build the rpm package?

posted Jul 2, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

make sure you have rpmdevtools

yum install rpmdevtools

then run

rpmdev-setuptree

to setup the ~/rpmbuild tree structure

answer Jul 2, 2013 by anonymous
Similar Questions
0 votes

What's the proper way to remove *all symbols* from ELF binaries when building packages with rpmbuild on CentOS? Seems that an out of the box rpmbuild install only discards debugging symbols (strip -g).

That's the default configuration for %__os_install_post on CentOS, the step in charge on stripping binaries:

 $ rpmbuild --showrc
 (..)
 -14: __os_install_post
 %{_rpmconfigdir}/brp-compress
 %{_rpmconfigdir}/brp-strip
 %{_rpmconfigdir}/brp-strip-static-archive
 %{_rpmconfigdir}/brp-strip-comment-note

ELF binaries are stripped with /usr/lib/rpm/brp-strip, this script explicitly calls to /usr/bin/strip with "-g" flag and discards only debugging symbols.

Seems that the people usually installs "redhat-rpm-config" package to achieve this. Indeed it builds RPMs with all symbols removed, but it also installs some helper scripts and macros that change other behaviors, for example SRPMs are signed with SHA-256.

When "redhat-rpm-config" package is installed, %__os_install_post variable is modified and find-debuginfo.sh is executed, this script will remove all symbols, but it will *also* build "-debug" packages, and that's not what I'm looking for.

For the moment, I have have added another script to %__os_install_post step that removes all symbols using "strip --strip-all", but I wonder if this is the most straightforward method, thanks.

+1 vote

I would like to install cyrus-imapd 2.4 in CentOS6. I have found rpm cyrus 2.4 for CentOS6 on rpmseek.
cyrus-imapd-2.4.17-30.1.x86_64.rpm

But there are conflicts with postfix 2.6.6. Can I ignore this conflicts or is there a suitable version of ppstfix available?

+1 vote

I have just installed (with kikstart) centOS6.4 on a PC which was previously running OpenSUSE (11.x). This PC has an apple keyboard and I'm unable to setup this keyboard. In .xsession-errors I get this messages :

Error: No Symbols named "latin9" in the include file "macintosh_vndr/fr"
 Exiting
 Abandoning symbols file "(null)"

** (gnome-settings-daemon:8160): WARNING **: Could not activate the XKB  configuration
Error: No Symbols named "latin9" in the include file "macintosh_vndr/fr"
 Exiting
 Abandoning symbols file "(null)"

** (gnome-settings-daemon:8160): WARNING **: Could not activate the XKB configuration

Google found on a RedHat forum that it seams to be an old known bug but do not find any update or workaround. I've several PC using Apple keyboards as users have also Apple laptops and they do not want to work with two different keyboards.

+1 vote

I want to install path.py in my Python 3.4 environment on a Centos 5 box. My /usr/local/bin/ contains:

easy_install-3.4 
python3.4  
etc. 

We are behind a proxy server and I tried this:

# /usr/local/bin/easy_install-3.4 path.py 

Searching for path.py 
Reading https://pypi.python.org/simple/path.py/ 
Download error on https://pypi.python.org/simple/path.py/: hostname '172.29.68.1  
' doesn't match either of 'www.python.org', 'python.org', 'pypi.python.org',  
'docs.python.org', 'testpypi.python.org', 'bugs.python.org', 'wiki.python.org',  
'hg.python.org', 'mail.python.org', 'packaging.python.org', 'pythonhosted.org',  
'www.pythonhosted.org', 'test.pythonhosted.org', 'us.pycon.org', 'id.python.org' --  
Some packages may not be found! 

Couldn't find index page for 'path.py' (maybe misspelled?), Am I best to use pip or easy_install? also if easy_install, how can I fix the above error?

...