View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007435CMakeCPackpublic2008-07-31 16:582008-10-01 09:51
ReporterPaul Hatfield 
Assigned ToBill Hoffman 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0007435: CPack allows RPM to strip debug symbols from binary
DescriptionWhen using CPack to create a RPM that includes a binary with debug symbols, the debug symbols are stripped.
Additional InformationThe following stores a binary that does have debug symbols in the RPM

While this does not:
TagsNo tags attached.
Attached Filespatch file icon cpack-rpm-postintall.patch [^] (5,679 bytes) 2008-08-25 04:27 [Show Content]
patch file icon cpack-rpm-bugs-7435-7000-6980.patch [^] (6,718 bytes) 2008-08-25 04:56 [Show Content]
patch file icon cpack-rpm-bugs-7435-6980.patch [^] (4,164 bytes) 2008-09-09 16:08 [Show Content]


Paul Hatfield (reporter)
2008-07-31 21:52

I can correct my issue by adding the following line in the spec file:
%define __spec_install_post /bin/true

I sent an e-mail to Eric Noulard the author of CPackRPM.cmake.
If this is the correct solution perhaps he can make it official.
Bill Hoffman (manager)
2008-07-31 22:35

I think the RPM tools do this by default. So, your fix could not be the default in CMake, it would have to be controlled by some cpack variable.
Eric NOULARD (developer)
2008-08-02 05:59

Hi all,
As already told by private e-mail I'm on holiday
and cannot test this.
However bill is write the default behaviour for rpmbuild -bb
is to strip executables.
Eric NOULARD (developer)
2008-08-02 06:18

Sorry for my terrible english Bill is "right" :=)
at the end of a build
rpmbuild invoke some default "post install scripts"
(which may be varying for different distros)
on redhat/fedora one will found something like:

+ /usr/lib/rpm/redhat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-java-repack-jars

%define __spec_install_post /bin/true

will replace the default postinstall behavior.
I agree with Bill this is a "user-specific" choice to avoid
stripping or not.

We may add CPACK_RPM_SPEC_INSTALL_POST variable which
may be user set for this case.

I'll propose a patch on my return from holiday (mid-august)
Eric NOULARD (developer)
2008-08-02 06:22

I may be wrong, check this too [^]
Bill Hoffman (manager)
2008-08-19 14:13

CPACK_RPM_SPEC_INSTALL_POST sounds like the best thing to do. As other things maybe could go into the spec file.
Eric NOULARD (developer)
2008-08-25 04:32

I did upload a patch against current CMake-2-6 branch.
With the patch CPackRPM now handles
which can be set ot whatever post-install command is needed to be inserted
in the spec file. In particular setting it to "/bin/true" will prevent
rpmbuild from stripping binaries.

I did add a more generic:
which may contains any "%define" lines to be inserted in the generated spec file.

The patch contains a warning
(as suggested in [^])
if ever CPackRPM is used with CPACK_USE_DESTDIR unset.
Eric NOULARD (developer)
2008-08-25 04:57

The freshly attached patch is better it fixes 3 bugs: [^] [^] [^]
Bill Hoffman (manager)
2008-09-09 14:20

So, in the patch i386 will no longer be the default arch. Is that ok, or will it break old projects?
Eric NOULARD (developer)
2008-09-09 16:08

Yes it's not a problem since when you don't specify arch in the spec file
the RPM get the host spec file, which is the better default way to go.
Unless you know you build an RPM with non-host arch (main 'noarch' case).

You may check the now default arch of the RPM with:
rpm -qp --queryformat '%{ARCH}\n' <generated-rpm-file>

for example for CMake rpm on my Debian Etch x64 I now get:
rpm -qp --queryformat '%{ARCH}\n' /home/eric/CMake/CMake-2.6_build/cmake-2.6.2-RC-3-Linux-x86_64.rpm

on i386 you should get i386 just as before.

I couldn't imagine in which way it could break older project,
but I have no testbox at hand to test this now.

However concerning this patch I'll upload a new one for which [^]
is not fixed because I propose another (should be better) way to fix
Bill Hoffman (manager)
2008-09-11 11:15

So, which patch should I apply?
Eric NOULARD (developer)
2008-09-11 12:01

You should apply the last one:
which fixes bugs 7435 and 6980.

I think bug 7000 should be handled in another way.
Eric NOULARD (developer)
2008-09-18 04:34

Hi Bill,

Did something prevent you from applying the
cpack-rpm-bugs-7435-6980.patch: [^]
for current CMake 2.6 RC?
Bill Hoffman (manager)
2008-09-19 17:46

Just moved it to CVS:
cvs commit -m "BUG: 7435 fixes to add optional post-install" CPackRPM.cmake
Committer: Bill Hoffman <>
/cvsroot/CMake/CMake/Modules/CPackRPM.cmake,v <-- CPackRPM.cmake
new revision: 1.8; previous revision: 1.7

Please let me know if this is correct, and I will move it to the next 2.6 RC.
Eric NOULARD (developer)
2008-09-21 05:56


I think you applied the wrong patch, I should have removed the wrong one
from the tracker but I did not find a way to do that.

The patch you applied does contain
an unconditional warning if DESTDIR is not set.

There is another solution to this DESTDIR problem (not only for RPMs)
which is currently discussed: [^]

Thus if you suppress the 4 following lines from CPackRPM.cmake file
then this may go to next 2.6 RC:

  MESSAGE("CPackRPM:Warning: You did not set CPACK_SET_DESTDIR to ON")
  MESSAGE("CPackRPM:Warning: this will make CPackRPM fail if you have installed files with absolute path")

Keeping this warning is not that bad, but this does not seem to be
the solution currently discussed for the DESTDIT issue.
Bill Hoffman (manager)
2008-09-22 09:56

$ cvs commit -m "BUG: 7435, remove warning for not setting DESTDIR" CPackRPM.cmake
Committer: Bill Hoffman <>
/cvsroot/CMake/CMake/Modules/CPackRPM.cmake,v <-- CPackRPM.cmake
new revision: 1.9; previous revision: 1.8

 Issue History
Date Modified Username Field Change
2008-07-31 16:58 Paul Hatfield New Issue
2008-07-31 21:52 Paul Hatfield Note Added: 0012913
2008-07-31 22:35 Bill Hoffman Note Added: 0012914
2008-08-02 05:59 Eric NOULARD Note Added: 0012921
2008-08-02 06:18 Eric NOULARD Note Added: 0012922
2008-08-02 06:22 Eric NOULARD Note Added: 0012923
2008-08-19 14:13 Bill Hoffman Note Added: 0013067
2008-08-19 14:13 Bill Hoffman Status new => assigned
2008-08-19 14:13 Bill Hoffman Assigned To => Bill Hoffman
2008-08-25 04:27 Eric NOULARD File Added: cpack-rpm-postintall.patch
2008-08-25 04:32 Eric NOULARD Note Added: 0013165
2008-08-25 04:56 Eric NOULARD File Added: cpack-rpm-bugs-7435-7000-6980.patch
2008-08-25 04:57 Eric NOULARD Note Added: 0013167
2008-09-09 14:20 Bill Hoffman Note Added: 0013387
2008-09-09 16:08 Eric NOULARD Note Added: 0013395
2008-09-09 16:08 Eric NOULARD File Added: cpack-rpm-bugs-7435-6980.patch
2008-09-11 11:15 Bill Hoffman Note Added: 0013422
2008-09-11 12:01 Eric NOULARD Note Added: 0013428
2008-09-18 04:34 Eric NOULARD Note Added: 0013506
2008-09-19 17:46 Bill Hoffman Note Added: 0013528
2008-09-21 05:56 Eric NOULARD Note Added: 0013536
2008-09-22 09:56 Bill Hoffman Note Added: 0013537
2008-10-01 09:51 Bill Hoffman Status assigned => closed
2008-10-01 09:51 Bill Hoffman Resolution open => fixed

Copyright © 2000 - 2018 MantisBT Team