I try to pack some map files for our geoserver in an internal rpm package. For the build part, this is just to copy the files. I think this works as expected. But it takes t
Please check the file /usr/lib/rpm/macros in your build machine, (the file maybe diff in path), it has a total support list of 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 just as Aaron said, you can set it here for universal, or set specifically for your proj. spec.
I ran into the same issue with Ant building a runnable Jar RPM with Spring Boot Loader 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 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 a runnable JAR was to disable the repacking, setting the macro definitions on the spec file did not do it for me.
Adding this to the spec file was what worked for me:
#Disable jar unpacking
%define __jar_repack 0
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=219731
Thanks to the previous posters for helping to focus in on the issue too.
Erion
I was working with some RPM stuff today and accidentally stumbled upon the answer for ya!
Put these in your spec
file:
%define _source_payload w0.gzdio
%define _binary_payload w0.gzdio
That will still use gzip
but pass it -0
for a level, which should just store. On my RPM, it made it grow from 21MB to 76MB, so I'm pretty sure this is your answer!
BTW, I found that in one of the macro
files - you can also do bzdio
and any number from 0
to 9
to use bzip2
. This was on RHEL4; later versions of RPM seem to support more compression options; but again, for what you want, the above should be what you need.
I have used "%define _binary_payload w9.xzdio" on RHEL 6.6. As I understand, the default compression tool used in RHEL 6 is xz, but the default compression level appears to be 2, even though 7 is supposed to be xz's default. I kicked it up to 9 and some giant RPMs went from 653MB to 439MB. I was able to save a total of 1 gigabyte over the default compression.