[CMake] Relocatable RPM

Eric Noulard eric.noulard at gmail.com
Thu Feb 11 12:56:00 EST 2010


2010/2/11 Will Dicharry <wdicharry at stellarscience.com>:
> Is there a way to make an RPM package generated with CPack relocatable?

Should be possible, theoretically.
Currently the spec file generated by CPackRPM is not.

As far as I remember relocatable RPM should avoid absolute file
install and use %prefix directive.
(correct me if I'm wrong).

I dropped the usage of %prefix  in CPackRPM
some time ago but I could not remember why,  I'll dig into this later.

If you want to try yourself whether if it's possible or not
you may use cmake-2.8 RC1:
http://www.cmake.org/files/v2.8/

In this RC, CPackRPM supports user-provided spec file.
http://www.vtk.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
or
cmake --help-module CPackRPM

the idea of user specified spec file is too allow user to provide its
own spec file
to CPackRPM.

However since CPackRPM use a short-cutted version of spec file
(because CPack generic generator does the install not rpmbuild)
you should begin with a template CPackRPM compatible spec file:

1) generate the template using cpack:
cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM

2) modify the generated spec file.

3) use your spec file
cpack -D CPACK_RPM_USER_BINARY_SPECFILE=/path/to/your.spec -G RPM

If you find a solution I would be glad to integrate it in the mainline.

In any case I suggest you open a feature request for CPackRPM in the
bug tracker.
If you do so, please send the bug number here that way I would be aware of it.


-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list