A quick overview, what I'm doing is bundling a nodejs application using enclose.js into a single binary, then using rpmbuild to turn the whole project with config files into a single package. Everything is fine before packaging but there's a binary file that gets corrupted after the result rpm is installed. That file is a 40MB binary while the rpm is 52MB but after installation the binary extracted is only 15MB.

This is my spec file:

Name: Packager
Version: 2.0
Release: 0
License: Proprietary
Group: System/Extras
Distribution: Linux CentOS
Packager: Ammar Lakis <ammar.lakis@gmail.com>
Requires: mongodb-server
Summary: A quick packager

Package made for packaging

cd %{my_source}
npm run build

cp -r %{my_source}/pkg/ $RPM_BUILD_ROOT

systemctl enable packager


and the building process is done with this command

rpmbuild -bb --define 'my_source /root/Packager/' packager.spec

Is there anything causing the truncating of the bundled files ?


By default, rpmbuild strips binaries and libraries (using /usr/lib/rpm/brp-compress) after they have been placed in the rpm file. You should be able to disable this by adding to the start of your spec file

%global __os_install_post %{nil}
  • Yeah, i got bit by this too. a couple things: 1) technically brp-compress is not the issue, it just compresses man pages. But __os_install_post does a lot more 2) do rpmbuild --showrc > /tmp/rpmbuild_showrc.txt to see all that it does. /usr/lib/rpm/redhat/brp-strip does the strip, but it also repackages static libs, jar files, and some other things. – Rich Homolka Jun 10 '16 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.