[CMake] Relocatable RPM

Eric Noulard eric.noulard at gmail.com
Wed Aug 18 02:43:22 EDT 2010


2010/8/17 Rolf Eike Beer <eike at sf-mail.de>:
> Am Tuesday 17 August 2010 schrieb Eric Noulard:
>
>> set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
>>
>> and CPackRPM will try to build a relocatable package.
>> This will surely FAIL if:
>>      - some file are installed with absolute path
>
> Do you mean the packaging will fail or the installation?

**Packaging** will fail. In fact you can make an RPM with CPackRPM
but the generated RPM won't be relocatable.

> When you have a package with a prefix of /opt and relocate it to /usr/local there is usually no
> problem with files e.g. in /etc, they are simply not relocated.

Yes *usually* because when you write an RPM .spec file "by hand" you take
care to specify the fact that those /etc/blah files are %config files and not
just %files.

Currently CPackRPM is not smart enough to do that automatically because

1) It has no clue whether if those files were installed using absolute
path or not
     not mentioning the fact that some if not all those absolute files
are %config files which
     do not need to be relocated.

2) The installation of absolutely installed files **requires** the use
of CPACK_SET_DESDIR flag to ON
     which is not properly handled by CPackRPM yet...
    see http://public.kitware.com/Bug/view.php?id=7000

Thoses issues are on my TODO list but I will
       a) finish current work on component packaging
       b) propose a solution for the 7000 bug on DESTDIR (not only for RPM)
       c) then handle fully relocatable RPM

Any volunteer and/or patch are welcomed :-)
-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list