Rpmbuild Spec package jar becomes smaller, set suppress binary file disable binary stripping in Rpmbuild

Source: Internet
Author: User
Tags rpmbuild

Disable Binary stripping in Rpmbuild excerpt from: http://livecipher.blogspot.com/2012/06/ disable-binary-stripping-in-rpmbuild.htmlstripping binary files in Rpmbuild
RedHat Package Manage
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.