[CMake] Fwd: CPack does not generate a RPM

Hendrik Sattler post at hendrik-sattler.de
Sun Apr 17 16:42:53 EDT 2016



Am 17. April 2016 21:21:01 MESZ, schrieb Domen Vrankar <domen.vrankar at gmail.com>:
>I've finally had time to look into this.
>
>The problem is that rpm expects a shared library to have execute
>permissions - during packaging missing execute permissions are ignored
>so dependency is found but once we try to install the package it
>figures out that it's missing hence the odd missing dependency error.
>
>To fix this simply set permissions that you want e.g.:
>
>set(LIBRARIES
>        ${LIB}/liblibrary.so
>        ${LIB}/liblibrary.so.5
>        ${LIB}/liblibrary.so.5.6.7)
>install(FILES ${LIBRARIES} DESTINATION lib
>  PERMISSIONS OWNER_EXECUTE # this permission is mandatory or package
>installation will fail
>)
>
>See the entire list of permissions here:
>https://cmake.org/cmake/help/v3.5/command/install.html
>
>I'll try to add some simple checking for such errors in CPack/RPM.

Actually the exec bit for library files is plain wrong. That RPM wrongly needs this is a bug in RPM. CMake should not make the world worse by making build systems set this exec bit on libraries. Just SILENTLY fix it up when generating the .rpm

Simple check: what happens when you try to execute the library from the command line? Only those files that have a defined behavior when running them should have the exec bit set.

HS



More information about the CMake mailing list