[ACCEPTED]-rpmbuild change compression format-rpm-spec

Accepted answer
Score: 25

I was working with some RPM stuff today 12 and accidentally stumbled upon the answer 11 for ya!

Put these in your spec file:

%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio

That will 10 still use gzip but pass it -0 for a level, which 9 should just store. On my RPM, it made it 8 grow from 21MB to 76MB, so I'm pretty sure 7 this is your answer!

BTW, I found that in 6 one of the macro files - you can also do bzdio and 5 any number from 0 to 9 to use bzip2. This was on 4 RHEL4; later versions of RPM seem to support 3 more compression options; but again, for 2 what you want, the above should be what 1 you need.

Score: 6

Please check the file /usr/lib/rpm/macros 6 in your build machine, (the file maybe diff 5 in path), it has a total support list of 4 compression methods there: e.g.:

329 #       Compression type and level for source/binary package payloads.
330 #               "w9.gzdio"      gzip level 9 (default).
331 #               "w9.bzdio"      bzip2 level 9.
332 #               "w7.xzdio"      xz level 7, xz's default.
333 #               "w7.lzdio"      lzma-alone level 7, lzma's default
334 #
335 #%_source_payload       w9.gzdio
336 #%_binary_payload       w9.gzdio

so here 3 just as Aaron said, you can set it here 2 for universal, or set specifically for your 1 proj. spec.

Score: 0

I have used "%define _binary_payload w9.xzdio" on 8 RHEL 6.6. As I understand, the default 7 compression tool used in RHEL 6 is xz, but 6 the default compression level appears to 5 be 2, even though 7 is supposed to be xz's 4 default. I kicked it up to 9 and some giant 3 RPMs went from 653MB to 439MB. I was able 2 to save a total of 1 gigabyte over the default 1 compression.

Score: 0

I ran into the same issue with Ant building 9 a runnable Jar RPM with Spring Boot Loader 8 complaining of this:

Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/accessors-smart-1.2.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file

My ant build task was 7 like this:

<exec executable="rpmbuild"  failonerror="true"> 
  <env key="version" value="${fullversion}" /> 
  <arg value="-ba" /> 
  <arg value="--clean" />
  <arg value="${specfile}" />
</exec>

My solution to build an RPM with 6 a runnable JAR was to disable the repacking, setting 5 the macro definitions on the spec file did 4 not do it for me.

Adding this to the spec 3 file was what worked for me:

#Disable jar unpacking
%define __jar_repack 0

Reference: https://bugzilla.redhat.com/show_bug.cgi?id=219731

Thanks 2 to the previous posters for helping to focus 1 in on the issue too.

Erion

More Related questions