View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012096CMakeCPackpublic2011-04-16 13:062011-09-05 11:37
ReporterAlexey Uratkin 
Assigned ToEric NOULARD 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSRPM based distrosOS Version
Product VersionCMake 2.8.4 
Target VersionCMake 2.8.5Fixed in VersionCMake 2.8.5 
Summary0012096: CPackRPM: Error while using component install mode
DescriptionI am going to use CPack to build RPM.
I need to build more than one package.

The instruction is at:
http://www.itk.org/Wiki/CMake:Component_Install_With_CPack [^]

I've done all according to the instruction, but got no packages.

I've look into generated spec files by CPack and found that ALL files from ALL packages included to each package.

More detail investigation revealed that:
"Modules/CPackRPM.cmake" use CPACK_RPM_ABSOLUTE_INSTALL_FILES variable set by "Source/CPack/cmCPackGenerator.cxx"
I've traced "Source/CPack/cmCPackGenerator.cxx" and discovered that CPACK_RPM_ABSOLUTE_INSTALL_FILES filled with all files from all packages.

This gets me down and I've created a patch which solved this problem.

I think it should be included to the next release.
TagsNo tags attached.
Attached Filespatch file icon cpack_rpm.patch [^] (2,317 bytes) 2011-04-16 13:07 [Show Content]
patch file icon 0001-CPackRPM-Fix-12096-handle-absolute-install-path-with.patch [^] (3,268 bytes) 2011-04-17 15:01 [Show Content]
gz file icon CPackTestAbsolutePath-0.2.0-Source.tar.gz [^] (948 bytes) 2011-04-17 15:09

 Relationships

  Notes
(0026196)
Eric NOULARD (developer)
2011-04-16 17:07

Thank you for the report and the patch.
I'll have a look soon.

Did you try with CPack 2.8.4 or current git master branch?

By the way could you give me some example of INSTALL(TARGETS ...)
you use in your CMakeLists.txt.
Normally CPACK_RPM_ABSOLUTE_INSTALL_FILES is triggered by absolute destination.
(0026197)
Alexey Uratkin (reporter)
2011-04-16 17:37

I tried with CMake 2.8.4 official release.

I've got a difficult distributed make system. But for tests you could use simple example that covered topic issue:

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

SET(TARGET app)
SET(SRCS
    main.cpp
    f.cpp
    )
SET(HDRS
    f.h
    )
SET(CONFS
    f.conf
    )

ADD_EXECUTABLE(${TARGET} ${SRCS})

INSTALL(
    PROGRAMS
    ${EXECUTABLE_OUTPUT_PATH}/${TARGET}
    DESTINATION
    /usr/bin
    COMPONENT app
    )

INSTALL(
    FILES
    ${HDRS}
    DESTINATION
    /usr/include
    COMPONENT hdrs
    )

INSTALL(
    FILES
    ${CONFS}
    DESTINATION
    /etc
    COMPONENT conf
    )


SET(CPACK_RPM_COMPONENT_INSTALL ON)
SET(CPACK_GENERATOR "RPM")
SET(CPACK_COMPONENTS_ALL app hdrs conf)

SET(CPACK_COMPONENT_APP_GROUP "Runtime")
SET(CPACK_COMPONENT_HDRS_GROUP "Development")
SET(CPACK_COMPONENT_CONF_GROUP "Runtime")

INCLUDE(CPack)

In result of "make package" I want to get 3 package. Default CPack behavior doesn't provide it.
(0026206)
Eric NOULARD (developer)
2011-04-17 15:16

Alexey,

I did some more work on your patch in order to merge it to current
CMake codebase. The corresponding patch and sample test project is
attached to the tracker.

There is the corresponding stage/CPackRPM-fix12096 branch which I just
merged to next.

It should do what you expect.
Note however that CPackRPM is doing his best to build relocatable package
so that you'd better not do thing like:

INSTALL(
    FILES
    ${HDRS}
    DESTINATION
    /usr/include
    COMPONENT hdrs
    )

but instead:
INSTALL(
    FILES
    ${HDRS}
    DESTINATION
    include
    COMPONENT hdrs
    )

and then chose CPACK_PACKAGING_INSTALL_PREFIX in order to setup your
custom packaging install prefix if the default provided by the
generator does not suits you need.

That's the reason for which
INSTALL(
    FILES
    ${CONFS}
    DESTINATION
    /etc
    COMPONENT conf
    )

is oK with the side effect that those files will be flagged as "%config"
as it should be. The "automatic" %config flag has been made for ease
of use. If you don't want that, please file another bug report and
we will see how we can handle that. Providing a patch proposal would even
be better.

Thank you for the report and the patch.
(0026207)
Eric NOULARD (developer)
2011-04-17 15:18

Fetching upstream next
Merge topic 'CPackRPM-fix12096' into next

d3fd945 CPackRPM Fix 0012096: handle absolute install path with component install
(0027345)
David Cole (manager)
2011-09-05 11:37

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

 Issue History
Date Modified Username Field Change
2011-04-16 13:06 Alexey Uratkin New Issue
2011-04-16 13:07 Alexey Uratkin File Added: cpack_rpm.patch
2011-04-16 17:04 Eric NOULARD Assigned To => Eric NOULARD
2011-04-16 17:04 Eric NOULARD Status new => assigned
2011-04-16 17:07 Eric NOULARD Note Added: 0026196
2011-04-16 17:37 Alexey Uratkin Note Added: 0026197
2011-04-17 15:01 Eric NOULARD File Added: 0001-CPackRPM-Fix-12096-handle-absolute-install-path-with.patch
2011-04-17 15:09 Eric NOULARD File Added: CPackTestAbsolutePath-0.2.0-Source.tar.gz
2011-04-17 15:16 Eric NOULARD Note Added: 0026206
2011-04-17 15:17 Eric NOULARD Target Version => CMake 2.8.5
2011-04-17 15:18 Eric NOULARD Note Added: 0026207
2011-04-17 15:18 Eric NOULARD Status assigned => resolved
2011-04-17 15:18 Eric NOULARD Fixed in Version => CMake 2.8.5
2011-04-17 15:18 Eric NOULARD Resolution open => fixed
2011-09-05 11:37 David Cole Status resolved => closed
2011-09-05 11:37 David Cole Note Added: 0027345


Copyright © 2000 - 2018 MantisBT Team