Disable Binary stripping in Rpmbuild excerpt from: http://livecipher.blogspot.com/2012/06/ disable-binary-stripping-in-rpmbuild.htmlstripping binary files in Rpmbuild
When we create an RPM using Rpmbuild, the binary files is stripped. The intention is to reduce the file size, without affecting the functionality. This is the default setting, configured using the RPM Macro__os_install_post. This blog is entry talks about what to disable this option. This is do using the compression scripts, installed as part of Rpm-build rpm. The RPM macro __os_install_post is defined to execute these scripts. The scripts used to compress the binary file size is as follows.
$ rpm--SHOWRC | grep-a 4 ': __os_install_post '
-14: __os_install_post
/usr/lib/rpm/brp-compress
/usr/lib/rpm/brp-strip
/usr/lib/rpm/brp-strip-static-archive
/usr/lib/rpm/brp-strip-comment-note
Recently, I had an uncommon requirement to disable this option. I don't want to reduce the file size of any files packaged in the RPM. This was achievable using any of 3 mechanisms.
- Spec file
- ~/.rpmmacros
- /etc/rpm/macros
To prevent binary stripping for specific rpm, we could add following line at the top of any RPM spec file.
%global __os_install_post%{nil}
To prevent binary stripping for all RPMs created by specific user, we could add following line in ~/.rpmmacros file:
%__os_install_post%{nil}
To prevent binary stripping for all RPMs created by all users, we could add following line In/etc/rpm/macros file:
%__os_install_post%{nil}
Rpmbuild spec packaging jar becomes smaller, set suppress binary disable binary stripping in Rpmbuild