<div dir="ltr">Thanks Eric. Here is the patch for supporting the compression level on cmake 2.8.7.<div>-Anil<br><div><br></div><div><div>---<br></div><div> cmake/modules/patches/CPackRPM.cmake |   51 +++++++++++++++++++++++++++++++---</div>
<div> 1 file changed, 47 insertions(+), 4 deletions(-)</div><div><br></div><div>diff --git a/cmake/modules/patches/CPackRPM.cmake b/cmake/modules/patches/CPackRPM.cmake</div><div>index bf476ad..db4823f 100644</div><div>--- a/cmake/modules/patches/CPackRPM.cmake</div>
<div>+++ b/cmake/modules/patches/CPackRPM.cmake</div><div>@@ -68,6 +68,12 @@</div><div> #     to lzma or xz compression whereas older cannot use such RPM.</div><div> #     Using this one can enforce compression type to be used.</div>
<div> #     Possible value are: lzma, xz, bzip2 and gzip.</div><div>+#  CPACK_RPM_COMPRESSION_LEVEL</div><div>+#     Mandatory : NO</div><div>+#     Default   : -</div><div>+#     May be used to set the compression level. If this is not specified it defaults</div>
<div>+#     to best possible compression level. </div><div>+#     Possible values are: 0-9. </div><div> #  CPACK_RPM_PACKAGE_REQUIRES</div><div> #     Mandatory : NO</div><div> #     Default   : -</div><div>@@ -374,17 +380,54 @@ IF (CPACK_RPM_COMPRESSION_TYPE)</div>
<div>    IF(CPACK_RPM_PACKAGE_DEBUG)</div><div>      MESSAGE(&quot;CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}&quot;)</div><div>    ENDIF(CPACK_RPM_PACKAGE_DEBUG)</div><div>+</div><div>
+   IF(DEFINED CPACK_RPM_COMPRESSION_LEVEL)</div><div>+     # validate the compression level for the compression type</div><div>+     IF(CPACK_RPM_COMPRESSION_LEVEL GREATER 9)</div><div>+       IF(CPACK_RPM_PACKAGE_DEBUG)</div>
<div>+        message(&quot;CPackRPM:Debug: Compression level should be less than 9 for lzma&quot;)</div><div>+       ENDIF(CPACK_RPM_PACKAGE_DEBUG) </div><div>+       set(CPACK_RPM_COMPRESSION_LEVEL 9)</div><div>+     ENDIF(CPACK_RPM_COMPRESSION_LEVEL GREATER 9)</div>
<div>+</div><div>+     IF(CPACK_RPM_COMPRESSION_LEVEL LESS 0)</div><div>+       IF(CPACK_RPM_PACKAGE_DEBUG)</div><div>+        message(&quot;CPackRPM:Debug: Compression level should be greater than 0 for lzma&quot;)</div>
<div>+       ENDIF(CPACK_RPM_PACKAGE_DEBUG)</div><div>+       set(CPACK_RPM_COMPRESSION_LEVEL 0)</div><div>+     ENDIF(CPACK_RPM_COMPRESSION_LEVEL LESS 0)</div><div>+   ELSE(DEFINED CPACK_RPM_COMPRESSION_LEVEL)</div><div>
+     # compression level not defined, use the highest level for</div><div>+     # given compression type</div><div>+     IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;lzma&quot;)</div><div>+       SET(CPACK_RPM_COMPRESSION_LEVEL 9)</div>
<div>+     ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;lzma&quot;)</div><div>+     IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;xz&quot;)</div><div>+       SET(CPACK_RPM_COMPRESSION_LEVEL 7)</div><div>+     ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;xz&quot;)</div>
<div>+     IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;bzip2&quot;)</div><div>+       SET(CPACK_RPM_COMPRESSION_LEVEL 9)</div><div>+     ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;bzip2&quot;)</div><div>+     IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;gzip&quot;)</div>
<div>+       SET(CPACK_RPM_COMPRESSION_LEVEL 9)</div><div>+     ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;gzip&quot;)</div><div>+   ENDIF(DEFINED CPACK_RPM_COMPRESSION_LEVEL)</div><div>+</div><div>+   IF(CPACK_RPM_PACKAGE_DEBUG)</div>
<div>+     message(&quot;CPackRPM:Debug: Compression level set to ${CPACK_RPM_COMPRESSION_LEVEL}&quot;)</div><div>+   ENDIF(CPACK_RPM_PACKAGE_DEBUG)</div><div>+</div><div>    IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;lzma&quot;)</div>
<div>-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w9.lzdio&quot;)</div><div>+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.lzdio&quot;)</div>
<div>    ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;lzma&quot;)</div><div>    IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;xz&quot;)</div><div>-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w7.xzdio&quot;)</div>
<div>+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.xzdio&quot;)</div><div>    ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;xz&quot;)</div><div>    IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;bzip2&quot;)</div>
<div>-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w9.bzdio&quot;)</div><div>+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.bzdio&quot;)</div>
<div>    ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;bzip2&quot;)</div><div>    IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;gzip&quot;)</div><div>-     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w9.gzdio&quot;)</div>
<div>+     SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w${CPACK_RPM_COMPRESSION_LEVEL}.gzdio&quot;)</div><div>    ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;gzip&quot;)</div><div> ELSE(CPACK_RPM_COMPRESSION_TYPE)</div>
<div>    SET(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;&quot;)</div><div>-- </div><div>1.7.9.5</div></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 5:24 AM, Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">2013/7/2 Anil Gunturu &lt;<a href="mailto:anil.gunturu@skyfab.com">anil.gunturu@skyfab.com</a>&gt;:<br>
<div><div class="h5">&gt; Hi,<br>
&gt;<br>
&gt; I understand that CPACK_RPM_COMPRESSION_TYPE can used to change the<br>
&gt; compression type. Is it also possible to specify the compression level?<br>
&gt; Selecting a compression type of gzip puts the following line in the spec<br>
&gt; file:<br>
&gt; %define _binary_payload w9.gzdio<br>
&gt;<br>
&gt;  But is it possible specific fast compression say for example:<br>
&gt; %define _binary_payload w6.gzdio<br>
&gt;<br>
&gt; I am looking to speed up the time for RPM packaging, at the expense<br>
&gt; compression ratio.<br>
<br>
</div></div>Currently the compression level is not configurable, since it was not<br>
designed for that when introduced:<br>
see <a href="http://public.kitware.com/Bug/view.php?id=10363" target="_blank">http://public.kitware.com/Bug/view.php?id=10363</a>.<br>
<br>
Have a look at CPackRPM.cmake module and you&#39;ll see:<br>
<br>
# CPACK_RPM_COMPRESSION_TYPE<br>
#<br>
if (CPACK_RPM_COMPRESSION_TYPE)<br>
   if(CPACK_RPM_PACKAGE_DEBUG)<br>
     message(&quot;CPackRPM:Debug: User Specified RPM compression type:<br>
${CPACK_RPM_COMPRESSION_TYPE}&quot;)<br>
   endif()<br>
   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;lzma&quot;)<br>
     set(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w9.lzdio&quot;)<br>
   endif()<br>
   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;xz&quot;)<br>
     set(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w7.xzdio&quot;)<br>
   endif()<br>
   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;bzip2&quot;)<br>
     set(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w9.bzdio&quot;)<br>
   endif()<br>
   if(CPACK_RPM_COMPRESSION_TYPE STREQUAL &quot;gzip&quot;)<br>
     set(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;%define _binary_payload w9.gzdio&quot;)<br>
   endif()<br>
else()<br>
   set(CPACK_RPM_COMPRESSION_TYPE_TMP &quot;&quot;)<br>
endif()<br>
<br>
So if you want to play with the compression level you&#39;ll currently<br>
have to patch CPackRPM.cmake.<br>
If you wish you could file a feature request<br>
<a href="http://public.kitware.com/Bug/bug_report_page.php" target="_blank">http://public.kitware.com/Bug/bug_report_page.php</a><br>
for adding control for the compression level, if you provide a patch<br>
I&#39;ll have a look.<br>
<br>
As an alternative you can use CPACK_RPM_SPEC_MORE_DEFINE like this:<br>
set(CPACK_RPM_SPEC_MORE_DEFINE &quot;%define _binary_payload w6.gzdio&quot;)<br>
and leave CPACK_RPM_COMPRESSION_TYPE empty/undefined.<br>
<br>
<br>
--<br>
Erk<br>
L&#39;élection n&#39;est pas la démocratie -- <a href="http://www.le-message.org" target="_blank">http://www.le-message.org</a><br>
</blockquote></div><br></div>