[CMake] [CPack] debian binary package

Tristan Carel tristan.carel at gmail.com
Sat Aug 18 11:23:12 EDT 2007


On 8/14/07, Mathieu Malaterre <mathieu.malaterre at gmail.com> wrote:
> On 8/14/07, Tristan Carel <tristan.carel at gmail.com> wrote:
> > I will make more serious test with `advanced' options:
> > DEBIAN_PACKAGE_DEPENDS, stuff like that...
>
> If anyone has any experience with this, he should speak now or hold
> his peace forever.

`CPack.cmake' module fills `CPackConfig.cmake' and
`CPackSourceConfig.cmake' with all CMake variables which starts by
`CPACK'.
Thus to overload DEBIAN_PACKAGE_{DESCRIPTION,SUGGEST,RECOMMENDS,...}
variables understood by Debian generator, I guess there is no other
way than to use a custom CPack config file template instead of the one
provided by CMake release.

Something like:

@_CPACK_OTHER_VARIABLES_@
SET(DEBIAN_PACKAGE_SECTION "@DEBIAN_PACKAGE_SECTION@")
SET(DEBIAN_FOO "@DEBIAN_FOO@")

I can also append Debian stuff after file's creation but I believe it
is too tricky. I just don't want to have to write code like
SET(VARIABLE \"${VARIABLE}\")
It is too much painful, or I miss something.

RPM generator may suffer the same problem (see RPM_PACKAGE_LICENSE
variable for example).

Is that too intrusive to use CPACK_<GENERATOR_NAME>_variable for
variable naming conventions so that all  variables specific to a
generator are grabbed by CPack.cmake?

dirty workaround:
Index: CPackDeb.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CPackDeb.cmake,v
retrieving revision 1.6
diff -u -w -r1.6 CPackDeb.cmake
--- CPackDeb.cmake      14 Aug 2007 14:20:20 -0000      1.6
+++ CPackDeb.cmake      18 Aug 2007 14:56:00 -0000
@@ -64,12 +64,20 @@

 # Section: (recommended)
 IF(NOT DEBIAN_PACKAGE_SECTION)
+  IF(CPACK_DEBIAN_PACKAGE_SECTION)
+    SET(DEBIAN_PACKAGE_SECTION ${CPACK_DEBIAN_PACKAGE_SECTION})
+  ELSE(CPACK_DEBIAN_PACKAGE_SECTION)
   SET(DEBIAN_PACKAGE_SECTION "devel")
+  ENDIF(CPACK_DEBIAN_PACKAGE_SECTION)
 ENDIF(NOT DEBIAN_PACKAGE_SECTION)

 # Priority: (recommended)
 IF(NOT DEBIAN_PACKAGE_PRIORITY)
+  IF(CPACK_DEBIAN_PACKAGE_PRIORITY)
+    SET(DEBIAN_PACKAGE_PRIORITY ${CPACK_DEBIAN_PACKAGE_PRIORITY})
+  ELSE(CPACK_DEBIAN_PACKAGE_PRIORITY)
   SET(DEBIAN_PACKAGE_PRIORITY "optional")
+  ENDIF(CPACK_DEBIAN_PACKAGE_PRIORITY)
 ENDIF(NOT DEBIAN_PACKAGE_PRIORITY )

As written above, a clean way would be to completely rename these variables.


Otherwise, the behavior is the one expected, it works well.
For the moment, I have tested:
DEBIAN_PACKAGE_SECTION
DEBIAN_PACKAGE_PRIORITY
CPACK_PACKAGE_DESCRIPTION_SUMMARY



-- 
Tristan Carel
Music with dinner is an insult both to the cook and the violinist.
http://www.tristancarel.com


More information about the CMake mailing list