[CMake] License agreement in package installation

Eric Noulard eric.noulard at gmail.com
Mon Sep 17 11:59:44 EDT 2012


2012/9/17 hce <jupiter.hce at gmail.com>:
> Hi,
>
> I need to add an interfactive license agreement to an RPM package when it is
> installed in Linux terminal (not GUI), it should display the license and
> asked whether the user agree or not. I noticed from cmake 2.8.8 document
> there is CPACK_RESOURCE_FILE_LICENSE may produce such process, am I right?

This is the right way to do it but...

> If I am wrong, how can I make it work with cmake / cpack?

This is not supported by CPack RPM, we could include the license text
file as a %doc file but..

..it is usually a bad idea to include interactivity (i.e. install time
question) in an RPM,
because most of the time no-one will be there to answer it:

http://stackoverflow.com/questions/2132828/adding-license-agreement-in-rpm-package

(see licensing guidelines of RPM based distros as well:
 http://fedoraproject.org/wiki/Packaging/LicensingGuidelines
 http://wiki.mandriva.com/en/Policies/Licensing)

On Debian dpkg sometimes ask question but there is a mean to avoid
them of provide default answers in a 'non-interactive' way:
http://serverfault.com/questions/84521/automate-dpkg-reconfigure-tzdata


That said, with CPackRPM
you may use CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
see:
cpack --help-variable CPACK_RPM_PRE_INSTALL_SCRIPT_FILE

in order to launch a pre-install script that may ask a question.

An appropriate alternative would be to pop-up the license agreement at
some other point:
  - Before downloading the RPM
  - On the first run of the installed software
  - ...

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list