[CMake] [CMake/CPack] empty debian package

Eric Noulard eric.noulard at gmail.com
Fri Mar 28 06:35:09 EDT 2008


2008/3/28, Jerome Arbez-Gindre <jerome.arbez-gindre at laposte.net>:
> Hi
>
> I think I'll give up to make debian packages with CMake/CPack and come back
> to a more classical upstream/packager separate roles scheme.
>
> What I can see after having test:
>
> INSTALL(PROGRAMS spm-check  DESTINATION ${DESTDIR}/etc/rc.d/init.d)
>  INSTALL(PROGRAMS spm DESTINATION sbin)
>
> ==> gives a deb file with
>                   ./usr/
>                   ./usr/sbin/
>                   ./usr/sbin/spm
>        and a rpm file with
>                   /usr
>                    /usr/sbin
>                   /usr/sbin/spm
>
> INSTALL(PROGRAMS spm-check  DESTINATION ${DESTDIR}/etc/rc.d/init.d)
>  INSTALL(PROGRAMS spm DESTINATION sbin)
>  SET(CPACK_SET_DESTDIR ON)
>
>  ==> gives a deb file with
>                    ./usr/
>                    ./usr/local/
>                    ./usr/local/sbin/
>                    ./usr/ocal/sbin/spm
>         and a rpm file with
>                    /etc
>                    /etc/rc.d
>                    /etc/rc.d/init.d
>                    /etc/rc.d/init.d/spm-check
>                    /usr
>                    /usr/local
>                    /usr/local/sbin
>                    /usr/local/sbin/spm
>
> (note the "local" !!!!)

This behavior is "normal".
You should'nt refer to ${DESTDIR} in your CMakeLists.txt
DESTDIR is used at "make install" time and not at CMake run time.

In your case putting ${DESTDIR} should evaluate to empty string
giving in both cases:
INSTALL(PROGRAMS spm-check  DESTINATION /etc/rc.d/init.d)
which is an absolute PATH case which does not work (either RPM or DEB)
when CPACK_SET_DESTDIR is OFF (default case).

I've submitted a bug report:
http://public.kitware.com/Bug/view.php?id=6673

When using relative path:
INSTALL(PROGRAMS spm DESTINATION sbin)

the path is prefixed with CMAKE_INSTALL_PREFIX you can
choose at CMake run time.
If you didn't chose one the default value is "/usr/local"
thus the result for RPM case.

As I told previously DEB generator seems [consistently] buggy
regarding absolute path handling in both cases.

So your results are consistents :-).

-- 
Erk


More information about the CMake mailing list