[CMake] CPack: setting multiple RPM pre/post (un)install scripts
Andrew Melo
andrew.melo at gmail.com
Sun May 29 19:18:18 EDT 2016
Hi
On Sunday, May 29, 2016, Thomas Teo <t.teo at acfr.usyd.edu.au> wrote:
> Hi All,
> In building an RPM package, I'd like to set multiple (un)install scripts -
> an application specific one which starts services that are installed by the
> RPM, and also to call ldconfig so that the shared library list is updated.
> The CMake/CPack documentation states this is supported (eg
> https://cmake.org/cmake/help/v3.0/module/CPackRPM.html):
>
> May be used to embed a pre (un)installation script in the spec file.
> The refered (sic) script file*(s)* will be read...
> (my emphasis)
>
> However the example doesn't indicate how one would specify multiple script
> files. I've tried several different methods:
>
> SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE
> "${CMAKE_SOURCE_DIR}/a.sh;${CMAKE_SOURCE_DIR}/b.sh" )
> SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE
> "${CMAKE_SOURCE_DIR}/a.sh,${CMAKE_SOURCE_DIR}/b.sh" )
> SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/a.sh"
> "${CMAKE_SOURCE_DIR}/b.sh" )
> SET(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/a.sh
> ${CMAKE_SOURCE_DIR}/b.sh" )
>
>
> Which often result in the error:
>
> CMake Error at /usr/share/cmake-3.4/Modules/CPackRPM.cmake:1377 (if):
> if given arguments:
>
> "EXISTS" "/home/thomas/src/<project>/a.sh"
> "/home/thomas/src/<project>/b.sh"
>
> Looking at the CMake code in the referenced file (CPackRPM.cmake) it
> appears that it could never handle multiple script files as there is no
> iteration.
> Is it possible the documentation is in error and only one script for each
> type of action (pre/post, un/install) can be specified?
FWIW, I make one script with all the desired actions and it works great.
>
> All assistance appreciated.
>
> Cheers,
> Thomas
>
> --
> Thomas Teo
> Australian Centre for Field Robotics
> The University of Sydney
>
> t.teo at acfr.usyd.edu.au
> www.acfr.usyd.edu.au
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
--
It's dark in this basement.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160529/479fdbe8/attachment.html>
More information about the CMake
mailing list