View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008988CMakeCPackpublic2009-05-08 11:432009-11-22 13:32
ReporterEric NOULARD 
Assigned ToEric NOULARD 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in VersionCMake-2-8 
Summary0008988: CPack RPM generator should support post (un)install scripts and/or custom spec file
DescriptionThe RPM spec file enables the developer to specify some
actions (i.e. scripts) to be run:

before installing (%pre)
or after installing (%post).

In the same way before un-installing (%preun)
or after un-installing (%postun)
more informations there:
http://www.rpm.org/max-rpm/s1-rpm-inside-scripts.html [^]

Some CPack RPM users may want to use thoses features:
http://www.cmake.org/pipermail/cmake/2009-May/029247.html [^]
TagsNo tags attached.
Attached Files? file icon CPackRPM.cmake [^] (14,709 bytes) 2009-05-08 13:39
patch file icon bug-8988-erk1.patch [^] (9,692 bytes) 2009-05-08 13:39 [Show Content]

 Relationships

  Notes
(0016357)
Eric NOULARD (developer)
2009-05-08 13:49

The attached patch (against CMake-2-6 branch) add
the requested support.

if the user defines one or several of thoses vars:
CPACK_RPM_POST_INSTALL_SCRIPT_FILE
CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE

with appropriate file names, the content of the specified files
will be embedded in the RPM spec file in the appropriate sections.

Moreover the current patch add custom user spec file.
If the user defines
CPACK_RPM_USER_BINARY_SPECFILE
to a custom made spec file, CPack RPM will use this spec file
instead of using its own generated spec file.
The user provided file will be
CONFIGURE( ... @ONLY) at CPack time.

Since the spec file usable by CPack RPM is a bit special
(because it skips some usual spec file step) one can ask CPackRPM
for a template file using

cd /your/build/dir
cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM

then CPack will end with the following "error":
CPack: Compress package
CMake Error at ../../cmake-Verk-2_6/share/cmake-2.6/Modules/CPackRPM.cmake:314 (MESSAGE):
  CPackRPM: STOP here Generated USER binary spec file templare is:
  /home/eric/CMake/builds/CMake-V2_6-CDTbuild/_CPack_Packages/Linux-x86_64/RPM/SPECS/cmake.spec.in

the user may copy the spec file and make appropriate changes before
using it with CPACK_RPM_USER_BINARY_SPECFILE.

Note that as usual all this CPACK_RPM_xxx vars may be defined either in
the user CMakeLists.txt or from the cpack command line.
(0016397)
Eric NOULARD (developer)
2009-05-12 10:07

Seems to be working OK for at least one user
http://www.cmake.org/pipermail/cmake/2009-May/029383.html [^]
(0016398)
Eric NOULARD (developer)
2009-05-12 10:08

More discussion on the topic there
http://www.cmake.org/pipermail/cmake/2009-May/029348.html [^]
(0018018)
Eric NOULARD (developer)
2009-10-07 15:27

This patch will need an update for CMake-2.8
see related bugs:
http://public.kitware.com/Bug/view.php?id=9679 [^]
(0018396)
Eric NOULARD (developer)
2009-11-11 15:55

Preparing updated patch for CVS HEAD.
(0018397)
Eric NOULARD (developer)
2009-11-11 15:56

Committed to HEAD.

Committer: Eric Noulard <eric.noulard@gmail.com>
/cvsroot/CMake/CMake/Modules/CPackRPM.cmake,v <-- Modules/CPackRPM.cmake
new revision: 1.18; previous revision: 1.17
(0018537)
Eric NOULARD (developer)
2009-11-22 13:32

may be included in 2.8.1

 Issue History
Date Modified Username Field Change
2009-05-08 11:43 Eric NOULARD New Issue
2009-05-08 13:39 Eric NOULARD File Added: CPackRPM.cmake
2009-05-08 13:39 Eric NOULARD File Added: bug-8988-erk1.patch
2009-05-08 13:49 Eric NOULARD Note Added: 0016357
2009-05-12 10:07 Eric NOULARD Note Added: 0016397
2009-05-12 10:08 Eric NOULARD Note Added: 0016398
2009-09-14 14:49 Bill Hoffman Status new => assigned
2009-09-14 14:49 Bill Hoffman Assigned To => Alex Neundorf
2009-09-14 14:49 Bill Hoffman Assigned To Alex Neundorf => Bill Hoffman
2009-10-07 15:27 Eric NOULARD Note Added: 0018018
2009-11-11 15:55 Eric NOULARD Note Added: 0018396
2009-11-11 15:56 Eric NOULARD Note Added: 0018397
2009-11-22 13:32 Eric NOULARD Assigned To Bill Hoffman => Eric NOULARD
2009-11-22 13:32 Eric NOULARD Note Added: 0018537
2009-11-22 13:32 Eric NOULARD Status assigned => closed
2009-11-22 13:32 Eric NOULARD Resolution open => fixed
2009-11-22 13:32 Eric NOULARD Fixed in Version => CMake-2-8


Copyright © 2000 - 2018 MantisBT Team