Mombu the GNU Linux Forum sponsored links

Go Back   Mombu the GNU Linux Forum > GNU_Linux > How can I disable the strip binary option in rpmbuild?
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 5th September 20:55
External User
 
Posts: 1
Default How can I disable the strip binary option in rpmbuild?



Hi,


I have an interesting scenario here.
The md5sum of my binary before rpmbuild is ***.

After "rpmbuild -bb filename.spec",
I went to the location of my binary.
The md5sum of my binary after rpmbuild is YYY.

Basically, the binary still works perfectly. It is only the md5sum is
different before and after rpmbuild.

----------------------------------------------------------------------------------------

I noticed that in rpmbuild, it automatically strips the binary.
Hence I believe that this causes my binaries md5sum to differ.

I tried to strip the binary before rpmbuild, it does not help.
I looked into options of rpmbuild, no available clue on disabling the
strip option.

Please take note that my spec is only copying the existing binary from
source to destination.
There is no make install.

------------------------------------------------------------------------------------------

My question is:
1. Is the strip option causing the md5sum to differ?
2. If so, how can I disable the strip binary option in rpmbuild?

Thanks for reading,
Have a great day ahead.
  Reply With Quote


  sponsored links


2 5th September 20:55
gilles allard
External User
 
Posts: 1
Default How can I disable the strip binary option in rpmbuild?



I think that md5sum is for the whole file, binary or not. Stripping remove
the symbol section ( I assume the format of your file is Elf ); so the
content of the file and its structure are modified. The md5sum will be different.


You should have a look at the result of "rpm --showrc"; may be you will find
a macro "__os_install_post". Usually this is the step where files are
stripped running a script ( this is my case ); the definition of this
macros may resides in "/usr/lib/rpm/macros" or in some more specific macro
files. You should try to run rpmbuild using --define='__os_install_post
<what_you_need>'. This is the way I usually handle that point.

So hope this will help.
  Reply With Quote


  sponsored links


3 5th September 20:55
External User
 
Posts: 1
Default How can I disable the strip binary option in rpmbuild?


Thanks
Managed to figure this out

in the define portion
add in
%define __os_install_post %{nil}

this will disable internal strip by rpmbuild.
However in the prompt out statements from rpmbuild, it still indicate
that stripping is done.

The other way I found out is that
in %install label
add in
export DONT_STRIP=1

This should helps too.
Thanks a million again.
: )
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666