MantisBT - CMake
View Issue Details
0013609CMakeCPackpublic2012-10-26 08:552013-11-07 02:51
Barthelemy von Haller 
CMake 2.8.9 
CMake 2.8.12 
0013609: RPM generator wrongly add parents directories to the package
When an install instruction is added such as :
install(FILES xxx.conf DESTINATION /etc/httpd/conf.d)

then the section %files in the generated spec file contains :
%dir "/etc"
%dir "/etc/httpd"
%dir "/etc/httpd/conf.d"

It is wrong as the RPM must not own system directories.
No tags attached.
duplicate of 0012864closed Eric NOULARD CPackRPM additional variable CPACK_RPM_FILTER_FILELIST to remove well-known directories from %files list 
related to 0012305closed Eric NOULARD RPM should include directories 
has duplicate 0013854closed Eric NOULARD rpm built with cmake failing with file conflict errors 
has duplicate 0013860closed Eric NOULARD RPMs created by CPack don't install on Fedora 18 
patch CpackRPM.patch (2,024) 2013-04-03 11:06
patch 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch (3,300) 2013-04-05 06:55
patch 0002-CPackRPM-add-usr-lib64-to-the-list-of-builtin-to-be-.patch (1,720) 2013-04-05 06:55
Issue History
2012-10-26 08:55Barthelemy von HallerNew Issue
2012-10-26 10:11Eric NOULARDAssigned To => Eric NOULARD
2012-10-26 10:11Eric NOULARDStatusnew => assigned
2012-10-26 10:15Eric NOULARDRelationship addedrelated to 0012305
2012-10-26 10:16Eric NOULARDRelationship addedduplicate of 0012864
2012-10-26 10:18Eric NOULARDNote Added: 0031340
2012-10-26 11:09Barthelemy von HallerNote Added: 0031341
2012-11-04 04:36Eric NOULARDNote Added: 0031410
2013-01-17 13:34Eric NOULARDRelationship addedhas duplicate 0013854
2013-04-03 11:06AriFile Added: CpackRPM.patch
2013-04-03 11:11AriNote Added: 0032748
2013-04-05 06:49Eric NOULARDNote Added: 0032754
2013-04-05 06:51Eric NOULARDFile Added: 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch
2013-04-05 06:55Eric NOULARDFile Deleted: 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch
2013-04-05 06:55Eric NOULARDFile Added: 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch
2013-04-05 06:55Eric NOULARDFile Added: 0002-CPackRPM-add-usr-lib64-to-the-list-of-builtin-to-be-.patch
2013-04-05 06:56Eric NOULARDNote Added: 0032755
2013-04-05 06:59Eric NOULARDRelationship addedhas duplicate 0013860
2013-04-05 09:27AriNote Added: 0032763
2013-04-05 09:37Eric NOULARDNote Added: 0032764
2013-05-21 07:52AriNote Added: 0033105
2013-06-05 07:00Dubrovskiy ViacheslavNote Added: 0033239
2013-11-07 02:51Eric NOULARDNote Added: 0034405
2013-11-07 02:51Eric NOULARDStatusassigned => closed
2013-11-07 02:51Eric NOULARDResolutionopen => fixed
2013-11-07 02:51Eric NOULARDFixed in Version => CMake 2.8.12

2012-10-26 10:18   
This bug a a duplicate of 0012864, the later has been backlogged because no one has time to work on it.

Would you be willing to work on a patch?
Barthelemy von Haller   
2012-10-26 11:09   

Sorry, I didn't find the duplicate.

I could work on a patch depending on the complexity of the task. I have never taken a look at the code of CPack. Are there instructions for contributors somewhere ?
2012-11-04 04:36   
Hi Barthelemy,

Sorry for delayed answer.
No there aren't any centralized contributors instructions besides
instructions for the CMake workflow using git: [^]

Concerning the CPack code you'll find it in
<CMakeSource>/Source/CPack/ for the C++ part
<CMakeSource>/Modules/CPack*.cmake for the CMake script part.

Source file must be limited to 80 columns,
and CMake script should be using lower case for cmake commands/macros
UPPERCASE being used for variable name and/or CMake command arguments.

If you have further general questions please ask them on the
cmake-developers ML: [^]

For question related to this specific issue, ask them on the tracker
I'll try to answer as-fast-as-possible.
2013-04-03 11:11   
Hi Eric,

This patch tackles the problem that RPM packages generated with CPack takes ownership of directories owned be other packages (chkconfig and filesystem in my case).

By default /etc /etc/init.d /usr /usr/share /usr/bin /usr/lib /usr/include are removed from the file list. The user can add to this list by providing CPACK_RPM_EXCLUDE_LIST in the CMake/CPack configuration.

Please consider reviewing and considering this patch.
2013-04-05 06:49   
Hi Ari,

I did commit a modified & enhanced version of you patch.

Merge topic 'CPackRPM-avoidOwningSystemDirs' into next

bac5772 CPackRPM add mechanism to remove path from generated list of file in RPM spec.

It is in stage/CPackRPM-avoidOwningSystemDirs
and merged to next.

May be you can try it, tell me if it's Ok for you.
I'll attach the patch to the tracker as well just in case it's more handy for you.
2013-04-05 06:56   
I did update the previous patch in order to add /usr/lib64 to the builtin list of exclusion. Just merged to next as well.

Merge topic 'CPackRPM-avoidOwningSystemDirs' into next

f055c99 CPackRPM add /usr/lib64 to the list of builtin to-be-excluded path
2013-04-05 09:27   
Hi Eric,

I have installed the enhanced patch and build most of our RPMs without problems.

Everything works great!

Thank you for your attention.
2013-04-05 09:37   
Ok I'm glad then.
If ever some more default paths seems reasonable to add
then tell me I may add them before the merge to master.

Even if any extra dir exclusion can now be done using
2013-05-21 07:52   
Hi Eric,

I have not ran into any more default paths to add. I'm just wondering there is something in particular keeping you from merging this to master? Can I help with anything?
Dubrovskiy Viacheslav   
2013-06-05 07:00   
> add /usr/lib64 to the builtin list of exclusion

I think you need to include all dirs from filesystem package.
This package is always installed in the system and there is no sense to pack a directory belonging to it.

[slava@dubrwork ~]$ rpm -ql filesystem
2013-11-07 02:51   
One can now use
to populate the list of dir to be excluded from CPackRPM automatic handling.