[CMake] CPack RPM: why not <name>-<version>-<release>-<arch>.rpm filename?

Eric Noulard eric.noulard at gmail.com
Wed Dec 30 06:09:28 EST 2009


2009/12/30 Winfried Dobbe <winfried_mb2 at xmsnet.nl>:
>
> When I build a RPM with current CVS CMAKE/CPack for project <projectname>
> the file name of the generated rpm is:
> <projectname>-<version>-Linux.rpm
>
> The common filename for an rpm is
> <projectname>-<version>-<release>-<architecture>.rpm
>
> Putting "Linux" in the file name doesn't provide much information because
> I don't know any other OS that uses the RPM package system.
>
> When I look in the CPackRPM.cmake module I see that the following line is
> commented out:
>
> #SET(CPACK_RPM_FILE_NAME
> "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
> and replaced by:
> SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
>
> When I set the following variable in my CMakeLists.txt:
> set(CPACK_OUTPUT_FILE_NAME
> "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
>
> the rpm is generated with the filename that I expect in directory
> _CPack_Packages/Linux/RPM, but after that I get the error:
> CPack Error: Problem copying the package:
> /home/wdobbe/checkout/btbuild/_CPack_Packages/Linux/RPM/buildtools-1.0.0-Linux.rpm
> to /home/wdobbe/checkout/btbuild/buildtools-1.0.0-Linux.rpm
> CPack Error: Error when generating package: buildtools
> make: *** [package] Error 1
>
> So even though I set the rpm output file name, CPack still looks for the
> "default" file name.
>
> Can somebody (Eric?) clarify this behaviour?

Yes this is currently a "design" problem in the CPack Generic generator,
currently a specific generator may not decide the name of the
generated (package) filename.
The name is given to him by the upper level CPack Generic Generator.
This cause another problem for supporting Component Install with RPM:
http://public.kitware.com/Bug/view.php?id=7645

I did file a bug on this particular topic
http://public.kitware.com/Bug/view.php?id=9900
but I did not start anything for now :-(

Do you want to contribute?

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list