View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015209CMakeCPackpublic2014-10-16 09:102016-01-04 11:51
ReporterLuc J. Bourhis 
Assigned ToDomen Vrankar 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.12.2 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015209: RPM generation chokes on directory symlinks with latest rpmbuild
DescriptionAs stated here (https://bugzilla.redhat.com/show_bug.cgi?id=1005529 [^]), the following specs file is no more legal as of rpmbuild 4.11

%files
%dir xxx
yyy/

when xxx or yyy are directory symlinks instead of proper directories. Unfortunately CPack has not been taught that and it generates %dir xxx for a directory symlink xxx.
Steps To ReproduceUsing the CMakeLists.txt attached to this bug report, issue "make package", on a Linux machine with rpmbuild 4.11 (I tested with Fedora 20). You should get the following error message:

error: Not a directory: /home/luc/Developer/sandbox/build/_CPack_Packages/Linux/RPM/it-will-fail-0.1.1-Linux/usr/usr/share/test/project/subdir
    Not a directory: /home/luc/Developer/sandbox/build/_CPack_Packages/Linux/RPM/it-will-fail-0.1.1-Linux/usr/usr/share/test/project/subdir
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (487 bytes) 2014-10-16 09:10 [Show Content]
patch file icon CPackRPM.cmake.patch [^] (564 bytes) 2014-10-17 08:22 [Show Content]
patch file icon 0001-CPackRPM-handling-of-symbolic-links.patch [^] (12,666 bytes) 2014-11-08 16:03 [Show Content]

 Relationships

  Notes
(0037040)
Alex Rettig (reporter)
2014-10-17 08:23

I just ran into the same problem.

The solution is easy: in CPackRPM.cmake there is a check, whether a file IS_DIRECTORY, then a %dir entry is created in the SPEC file. But the file must not be considered as directory (thus no %dir prepended to the entry), if also IS_SYMLINK.

The attached patch CPackRPM.cmake.patch fixes the issue. It fits to the according file as of version 3.0.2 of CMake.

Please consider it for integration to the repository.
(0037165)
Domen Vrankar (developer)
2014-11-08 16:07

The patch only solves problems with directory packages but does not check if a symbolic link is created in a way that it can be relocated for relocatable packages.

I have written a more extensive patch that also tries to create symbolic links as relocatable as possible.

Attached patch: 0001-CPackRPM-handling-of-symbolic-links.patch
(0037742)
Brad King (manager)
2015-01-19 10:56

Re 0015209:0037165: Thanks. Please look at extending the test suite to cover this case.
(0038374)
Brad King (manager)
2015-03-31 14:11

The change has been applied along with test cases:

 CPackRPM: Add basic symlink support
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=681f3a2f [^]
(0040083)
Robert Maynard (manager)
2016-01-04 11:51

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2014-10-16 09:10 Luc J. Bourhis New Issue
2014-10-16 09:10 Luc J. Bourhis File Added: CMakeLists.txt
2014-10-17 08:22 Alex Rettig File Added: CPackRPM.cmake.patch
2014-10-17 08:23 Alex Rettig Note Added: 0037040
2014-10-17 08:29 Brad King Assigned To => Domen Vrankar
2014-10-17 08:29 Brad King Status new => assigned
2014-10-17 08:42 Brad King Target Version => CMake 3.2
2014-11-08 16:03 Domen Vrankar File Added: 0001-CPackRPM-handling-of-symbolic-links.patch
2014-11-08 16:07 Domen Vrankar Note Added: 0037165
2015-01-19 10:56 Brad King Note Added: 0037742
2015-02-04 15:37 Brad King Target Version CMake 3.2 => CMake 3.3
2015-03-31 14:11 Brad King Note Added: 0038374
2015-03-31 14:11 Brad King Status assigned => resolved
2015-03-31 14:11 Brad King Resolution open => fixed
2015-03-31 14:11 Brad King Fixed in Version => CMake 3.3
2016-01-04 11:51 Robert Maynard Note Added: 0040083
2016-01-04 11:51 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team