<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 12 sept. 2019 à 02:27, Ashish Sadanandan <<a href="mailto:ashish.sadanandan@gmail.com">ashish.sadanandan@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hello,</div><div>I'm using CPack to create RPMs for an application. I have this working but the CPack step is quite slow. While investigating this, I noticed that all files in a directory I'm packaging, which contains a large number of small files, is being listed in the spec file.</div><div><br></div><div>For instance, say I have</div><div> <br></div><div> set(CPACK_PACKAGING_INSTALL_PREFIX /opt/myapp)</div><div>
install(DIRECTORY ${CMAKE_BINARY_DIR}/myapp/foo<br>
DESTINATION foo<br>
COMPONENT myapp</div><div>
)</div><div><br></div><div>In the %files section I see</div><div><br></div><div>
%files<br></div><div>
%dir
/opt/myapp/foo</div><div>
"
/opt/myapp/foo/file1"</div><div>
"
/opt/myapp/foo/file2"</div><div>
...<br></div><div>
"
/opt/myapp/foo/file60000" <br></div><div><br></div><div>If I were writing the spec file by hand, this entire section could be replaced by a single line</div><div><br></div><div>
%files<br></div><div>
/opt/myapp/foo <br></div></div></blockquote><div><br></div><div>CPack has no idea that the list of files are coming from an installed *directory*, because CPack is not doing the install CMake is.<br>Thus CPackRPM and other CPack generators collect all installed bits inside a given [temporary] prefix directory.<br></div><div><br></div><div>Now may be you can tell CPack to ignore some of you installed files/directory by using: CPACK_RPM_USER_FILELIST</div><div> <a href="https://cmake.org/cmake/help/v3.15/cpack_gen/rpm.html#cpack_gen:CPack%20RPM%20Generator">https://cmake.org/cmake/help/v3.15/cpack_gen/rpm.html#cpack_gen:CPack%20RPM%20Generator</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>RPM will package all files within the directory if you specify the directory under %files (<a href="http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html" target="_blank">http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html</a> - the "The %dir Directive" section)</div><div>Is there an option to list just the directory instead of recursively listing all contained files within the directory?</div></div></blockquote><div><br></div><div>AFAIK, No there is not.</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'm not claiming this is the reason for CPack being slow, I came across this while investigating performance and if nothing else, this will result in a cleaner looking spec file.</div></div></blockquote><div><br></div><div>For performance sake you can try CPACK_RPM_USER_BINARY_SPECFILE, CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE</div><div>and handcraft your "user" spec file in order to see if it helps the packaging performance.</div><div>and/or you can set CPACK_RPM_PACKAGE_DEBUG to 1 in order to get more timed traces of CPackRPM execution.</div><div><br></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>