[CMake] CPack: Problems creating debs (problem in tar command?)

Martin Felis martin at silef.de
Sat Apr 30 13:13:17 EDT 2011


Hi there,

I am currently trying to build a debian package using CPack, which 
worked surprisingly well, however when trying to install that package I 
get some errors that dpkg fails to create some files. I get error 
messages of the form:

Unpacking asteroids (from steroids-0.9.1-Linux.deb) ...
dpkg: error processing steroids-0.9.1-Linux.deb (--install):
  unable to create `/usr/share/steroids/config.rc.dpkg-new' (while 
processing `./usr/share/steroids/config.rc'): No such file or directory
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
  steroids-0.9.1-Linux.deb

By comparing the deb file with a previously hand made package it seems 
that the folders are not created by tar, i.e. assuming the files
   /usr/share/foo/bar.png
   /usr/share/foo/data/otherbar.png
should end up in the package, meaning in data.tar.gz, then using CPack 
only the files
   /usr/share/foo/bar.png
   /usr/share/foo/data/otherbar.png
get in. However in my hand crafted package also the directories make it 
into the data.tar.gz archive:
   /usr/share/foo
   /usr/share/foo/bar.png
   /usr/share/foo/data
   /usr/share/foo/data/otherbar.png

When manually creating the file data.tar.gz of the 
_CPack_Packages/Linux/DEB/<name>/usr folder with "tar czv ./usr" and 
creating a deb archive with the other generated files, I can install the 
package without any problems.

I am using Ubuntu 10.10 (Maverick Meerkat) and its cmake 2.8.2 package 
on an 32bit system.

The CPack configuration I use is the following:

SET(CPACK_PACKAGE_NAME "steroids")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "summary")
SET(CPACK_PACKAGE_VENDOR "<me at home.org>")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "9")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake 
${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_PACKAGE_CONTACT "<me at home.org>")
SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "<me at home.org>")
SET(CPACK_SOURCE_STRIP_FILES "")

Any help is appreciated.

Cheers,
Martin


More information about the CMake mailing list