View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013609CMakeCPackpublic2012-10-26 08:552013-11-07 02:51
ReporterBarthelemy von Haller 
Assigned ToEric NOULARD 
PlatformLinuxOSRHELOS Version5
Product VersionCMake 2.8.9 
Target VersionFixed in VersionCMake 2.8.12 
Summary0013609: RPM generator wrongly add parents directories to the package
DescriptionWhen 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.
TagsNo tags attached.
Attached Filespatch file icon CpackRPM.patch [^] (2,024 bytes) 2013-04-03 11:06 [Show Content]
patch file icon 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch [^] (3,300 bytes) 2013-04-05 06:55 [Show Content]
patch file icon 0002-CPackRPM-add-usr-lib64-to-the-list-of-builtin-to-be-.patch [^] (1,720 bytes) 2013-04-05 06:55 [Show Content]

duplicate of 0012864closedEric NOULARD CPackRPM additional variable CPACK_RPM_FILTER_FILELIST to remove well-known directories from %files list 
related to 0012305closedEric NOULARD RPM should include directories 
has duplicate 0013854closedEric NOULARD rpm built with cmake failing with file conflict errors 
has duplicate 0013860closedEric NOULARD RPMs created by CPack don't install on Fedora 18 

Eric NOULARD (developer)
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 (reporter)
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 ?
Eric NOULARD (developer)
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.
Ari (reporter)
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.
Eric NOULARD (developer)
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.
Eric NOULARD (developer)
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
Ari (reporter)
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.
Eric NOULARD (developer)
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
Ari (reporter)
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 (reporter)
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
Eric NOULARD (developer)
2013-11-07 02:51

One can now use
to populate the list of dir to be excluded from CPackRPM automatic handling.

 Issue History
Date Modified Username Field Change
2012-10-26 08:55 Barthelemy von Haller New Issue
2012-10-26 10:11 Eric NOULARD Assigned To => Eric NOULARD
2012-10-26 10:11 Eric NOULARD Status new => assigned
2012-10-26 10:15 Eric NOULARD Relationship added related to 0012305
2012-10-26 10:16 Eric NOULARD Relationship added duplicate of 0012864
2012-10-26 10:18 Eric NOULARD Note Added: 0031340
2012-10-26 11:09 Barthelemy von Haller Note Added: 0031341
2012-11-04 04:36 Eric NOULARD Note Added: 0031410
2013-01-17 13:34 Eric NOULARD Relationship added has duplicate 0013854
2013-04-03 11:06 Ari File Added: CpackRPM.patch
2013-04-03 11:11 Ari Note Added: 0032748
2013-04-05 06:49 Eric NOULARD Note Added: 0032754
2013-04-05 06:51 Eric NOULARD File Added: 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch
2013-04-05 06:55 Eric NOULARD File Deleted: 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch
2013-04-05 06:55 Eric NOULARD File Added: 0001-CPackRPM-add-mechanism-to-remove-path-from-generated.patch
2013-04-05 06:55 Eric NOULARD File Added: 0002-CPackRPM-add-usr-lib64-to-the-list-of-builtin-to-be-.patch
2013-04-05 06:56 Eric NOULARD Note Added: 0032755
2013-04-05 06:59 Eric NOULARD Relationship added has duplicate 0013860
2013-04-05 09:27 Ari Note Added: 0032763
2013-04-05 09:37 Eric NOULARD Note Added: 0032764
2013-05-21 07:52 Ari Note Added: 0033105
2013-06-05 07:00 Dubrovskiy Viacheslav Note Added: 0033239
2013-11-07 02:51 Eric NOULARD Note Added: 0034405
2013-11-07 02:51 Eric NOULARD Status assigned => closed
2013-11-07 02:51 Eric NOULARD Resolution open => fixed
2013-11-07 02:51 Eric NOULARD Fixed in Version => CMake 2.8.12

Copyright © 2000 - 2018 MantisBT Team