<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I have an application repository that is built with CMake, but<br>
requires additional/custom handling when packaging -- hence the need<br>
for a custom .spec file.</blockquote><div><br></div><div>Can this not be done from CMakeLists.txt by setting some additional CPACK_* variables depending on the build environment?<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">After running CMake and make to generate the<br>
artifacts, 'make package' (CPack) tells me that the source tar.gz<br>
isn't found. The  'Source' directive inside my .spec file contains a<br>
name that is different from the name of the repository or the<br>
application.<br></blockquote><div><br></div><div>Not certain what exactly you're doing here - while creating binary packages Source directive is not used (CPackRPM is always the build driver so the build phase of rpm is skipped and instead the CPackRPM prepared/built files are used directly). Are you trying to produce a binary or a source rpm?<br></div><div><br>If the answer is binary then you'll have to change your spec file. First generate a spec file template by setting <a href="https://cmake.org/cmake/help/v3.6/module/CPackRPM.html#variable:CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE">CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE [1]</a><br></div><div>and then change it to suit your needs.<br><br></div><div>For examples you can look into <a href="https://github.com/Kitware/CMake/tree/master/Tests/RunCMake/CPack/tests">CPack tests [2]</a> (CUSTOM_BINARY_SPEC_FILE test is using a custom spec file).<br><br></div><div>Regards,<br><br></div><div>Domen<br></div></div><div class="gmail_quote"><br>[1] <a href="https://cmake.org/cmake/help/v3.6/module/CPackRPM.html#variable:CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE">https://cmake.org/cmake/help/v3.6/module/CPackRPM.html#variable:CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE</a><br>[2] <a href="https://github.com/Kitware/CMake/tree/master/Tests/RunCMake/CPack/tests">https://github.com/Kitware/CMake/tree/master/Tests/RunCMake/CPack/tests</a><br></div></div></div>