MantisBT - CMake
View Issue Details
0012061CMakeCPackpublic2011-04-08 16:462012-01-02 15:56
Martin Konrad 
Eric NOULARD 
normalminoralways
closedfixed 
 
CMake 2.8.5CMake 2.8.5 
0012061: CPackDeb fails if using components and CONTROL_EXTRA
CPackDeb fails if several deb files are created from components while using CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.

CPack Error: Problem running tar command: "/usr/bin/cmake" -E tar cfz control.tar.gz ./control ./md5sums ./postinst ./postrm
Please check [...]build/_CPack_Packages/Linux/DEB/Deb.log for errors

Deb.log contains these messages:

CMake Error: archive_read_disk_entry_from_file: (Empty error message)
CMake Error: Problem creating tar: control.tar.gz
# untar componentExampleStartWithControlExtra.tar.bz2
mkdir build
cd build
cmake ../Source
make
cpack

If the CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA line is commented out cpack runs like a charm. If using CONTROL_EXTRA it fails.
No tags attached.
related to 0012062closed Domen Vrankar CPackDeb: The EXTRA control files may not be specified on a per-component basis 
bz2 componentExampleStartWithControlExtra.tar.bz2 (1,141) 2011-04-08 16:46
https://public.kitware.com/Bug/file/3807/componentExampleStartWithControlExtra.tar.bz2
patch 0001-CPackDeb-Handle-dirs-for-CONTROL_EXTRA-correctly-whe.patch (1,089) 2011-04-08 17:34
https://public.kitware.com/Bug/file/3808/0001-CPackDeb-Handle-dirs-for-CONTROL_EXTRA-correctly-whe.patch
Issue History
2011-04-08 16:46Martin KonradNew Issue
2011-04-08 16:46Martin KonradFile Added: componentExampleStartWithControlExtra.tar.bz2
2011-04-08 16:52Martin KonradNote Added: 0026151
2011-04-08 17:01Martin KonradNote Added: 0026152
2011-04-08 17:34Martin KonradFile Added: 0001-CPackDeb-Handle-dirs-for-CONTROL_EXTRA-correctly-whe.patch
2011-04-08 17:35Martin KonradNote Added: 0026153
2011-04-09 03:22Eric NOULARDAssigned To => Eric NOULARD
2011-04-09 03:22Eric NOULARDStatusnew => assigned
2011-04-09 03:42Eric NOULARDNote Added: 0026154
2011-04-09 03:42Eric NOULARDNote Added: 0026155
2011-04-09 03:42Eric NOULARDStatusassigned => resolved
2011-04-09 03:42Eric NOULARDFixed in Version => CMake 2.8.5
2011-04-09 03:42Eric NOULARDResolutionopen => fixed
2011-04-09 03:50Eric NOULARDRelationship addedrelated to 0012062
2011-07-08 17:56David ColeTarget Version => CMake 2.8.5
2012-01-02 15:56David ColeNote Added: 0028098
2012-01-02 15:56David ColeStatusresolved => closed

Notes
(0026151)
Martin Konrad   
2011-04-08 16:52   
It seems that the postinst and postrm files are in the wrong directory if packaging components:

./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/LibrariesGroup
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/LibrariesGroup/usr
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/LibrariesGroup/usr/lib
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/LibrariesGroup/usr/lib/libmylib.a
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/control.tar.gz
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/debian-binary
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/data.tar.gz
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/control
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/md5sums
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/usr
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/usr/bin
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/ApplicationsGroup/usr/bin/mylibapp
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/postrm
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/HeadersGroup
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/HeadersGroup/usr
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/HeadersGroup/usr/include
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/HeadersGroup/usr/include/mylib.h
./_CPack_Packages/Linux/DEB/MyLib-1.0.0-Linux/postinst
(0026152)
Martin Konrad   
2011-04-08 17:01   
In my eyes another question arises: Shouldn't it be possible to use a postinst/postrm file for a single/for each deb file (e.g. for running depmod -a after installing the libraries)? Up to now it's only possible to specifiy CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA globally. We could use something like PACK_COMPONENT_FOO_DEBIAN_PACKAGE_CONTROL_EXTRA but we're still stuck with the problem that we can only have one file named "postinst" in the source directory.
(0026153)
Martin Konrad   
2011-04-08 17:35   
Please check the uploaded patch.
(0026154)
Eric NOULARD   
2011-04-09 03:42   
Hi Martin,

I'll try the patch.
Concerning the per-component EXTRA control yes that's right.
The same issue arose on the ML concerning RPM
(no bug but no way to specify per-component)

Now for the unique name issue, may it's because CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
interface has not the appropriate interface.

We should be able to have postrm name postrm-whatever in the source
and get copied to postrm by CPackDeb.

e.g. CPackRPM defines:
CPACK_RPM_POST_INSTALL_SCRIPT_FILE
which contains the name of the file to be used in post-install step.

we could make CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA a list of
"pair filename" instead of a list of filename.

I think this issue "per-component extra control" should be handled
in a separate feature request. I'll file one for Deb and on for RPM.
(0026155)
Eric NOULARD   
2011-04-09 03:42   
Merge topic 'CPackDeb-fix12061' into next

b22fcfb CPackDeb: Handle dirs for CONTROL_EXTRA correctly when packaging components
(0028098)
David Cole   
2012-01-02 15:56   
Closing resolved issues that have not been updated in more than 4 months.