How to avoid stripping when building RPMs

Posted in Linux

I’ve found 3 ways to disable the strip binary option when building RPMs. Any one of these methods will get the job done. The last one is obviously pretty ghetto, but they all work!

If you’re doing normal builds, the first two are good choices, but if you’re trying to package a bunch of binaries using RPM, I’ve found that the build will still fail, even using both the %define and the shell variable.

extracting debug info from ...
*** ERROR: No build ID note found in ...

At the top of your spec file, where the rest of your defines are, add this:

%define __os_install_post %{nil}

In the install section, export this variable:

export DONT_STRIP=1

Or find the script that’s getting called and swap it out with an empty script that does nothing when it is called. You can’t just delete it because rpmbuild will fail if it’s not there, but a simple one liner will work.

#!/bin/sh

On Fedora systems that script is /usr/lib/rpm/find-debuginfo.sh
Don’t forget to chmod +x so it will be executable.

Posted by admica   @   21 April 2009

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« Fallout 4
Next Post
Palm and Blackberry users revolt »
Powered by Wordpress   |   Lunated designed by ZenVerse