[CMake] CPack: setting multiple RPM pre/post (un)install scripts

Domen Vrankar domen.vrankar at gmail.com
Mon May 30 02:06:55 EDT 2016


2016-05-30 0:44 GMT+02:00 Thomas Teo <t.teo at acfr.usyd.edu.au>:
> 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:

This could never be done. As Andrew already mentioned you'll have to
merge them together yourself before feeding the path to CPackRPM.

> 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?

This is documentation error. It's probably best that the user merges
multiple scripts as appropriate so I'll fix it in the documentation.

Regards,
Domen


More information about the CMake mailing list