deb.rst 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700
  1. CPack DEB Generator
  2. -------------------
  3. The built in (binary) CPack DEB generator (Unix only)
  4. Variables specific to CPack Debian (DEB) generator
  5. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  6. The CPack DEB generator may be used to create DEB package using :module:`CPack`.
  7. The CPack DEB generator is a :module:`CPack` generator thus it uses the
  8. ``CPACK_XXX`` variables used by :module:`CPack`.
  9. The CPack DEB generator should work on any Linux host but it will produce
  10. better deb package when Debian specific tools ``dpkg-xxx`` are usable on
  11. the build system.
  12. The CPack DEB generator has specific features which are controlled by the
  13. specifics ``CPACK_DEBIAN_XXX`` variables.
  14. ``CPACK_DEBIAN_<COMPONENT>_XXXX`` variables may be used in order to have
  15. **component** specific values. Note however that ``<COMPONENT>`` refers to
  16. the **grouping name** written in upper case. It may be either a component name
  17. or a component GROUP name.
  18. Here are some CPack DEB generator wiki resources that are here for historic
  19. reasons and are no longer maintained but may still prove useful:
  20. - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/Configuration
  21. - https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack/PackageGenerators#deb-unix-only
  22. List of CPack DEB generator specific variables:
  23. .. variable:: CPACK_DEB_COMPONENT_INSTALL
  24. Enable component packaging for CPackDEB
  25. * Mandatory : NO
  26. * Default : OFF
  27. If enabled (ON) multiple packages are generated. By default a single package
  28. containing files of all components is generated.
  29. .. variable:: CPACK_DEBIAN_PACKAGE_NAME
  30. CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
  31. Set Package control field (variable is automatically transformed to lower
  32. case).
  33. * Mandatory : YES
  34. * Default :
  35. - :variable:`CPACK_PACKAGE_NAME` for non-component based
  36. installations
  37. - :variable:`CPACK_DEBIAN_PACKAGE_NAME` suffixed with -<COMPONENT>
  38. for component-based installations.
  39. .. versionadded:: 3.5
  40. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME`` variables.
  41. See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
  42. .. variable:: CPACK_DEBIAN_FILE_NAME
  43. CPACK_DEBIAN_<COMPONENT>_FILE_NAME
  44. .. versionadded:: 3.6
  45. Package file name.
  46. * Mandatory : YES
  47. * Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].deb``
  48. This may be set to ``DEB-DEFAULT`` to allow the CPack DEB generator to generate
  49. package file name by itself in deb format::
  50. <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
  51. Alternatively provided package file name must end
  52. with either ``.deb`` or ``.ipk`` suffix.
  53. .. versionadded:: 3.10
  54. ``.ipk`` suffix used by OPKG packaging system.
  55. .. note::
  56. Preferred setting of this variable is ``DEB-DEFAULT`` but for backward
  57. compatibility with the CPack DEB generator in CMake prior to version 3.6 this
  58. feature is disabled by default.
  59. .. note::
  60. By using non default filenames duplicate names may occur. Duplicate files
  61. get overwritten and it is up to the packager to set the variables in a
  62. manner that will prevent such errors.
  63. .. variable:: CPACK_DEBIAN_PACKAGE_EPOCH
  64. .. versionadded:: 3.10
  65. The Debian package epoch
  66. * Mandatory : No
  67. * Default : -
  68. Optional number that should be incremented when changing versioning schemas
  69. or fixing mistakes in the version numbers of older packages.
  70. .. variable:: CPACK_DEBIAN_PACKAGE_VERSION
  71. The Debian package version
  72. * Mandatory : YES
  73. * Default : :variable:`CPACK_PACKAGE_VERSION`
  74. This variable may contain only alphanumerics (A-Za-z0-9) and the characters
  75. . + - ~ (full stop, plus, hyphen, tilde) and should start with a digit. If
  76. :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` is not set then hyphens are not
  77. allowed.
  78. .. note::
  79. For backward compatibility with CMake 3.9 and lower a failed test of this
  80. variable's content is not a hard error when both
  81. :variable:`CPACK_DEBIAN_PACKAGE_RELEASE` and
  82. :variable:`CPACK_DEBIAN_PACKAGE_EPOCH` variables are not set. An author
  83. warning is reported instead.
  84. .. variable:: CPACK_DEBIAN_PACKAGE_RELEASE
  85. .. versionadded:: 3.6
  86. The Debian package release - Debian revision number.
  87. * Mandatory : No
  88. * Default : -
  89. This is the numbering of the DEB package itself, i.e. the version of the
  90. packaging and not the version of the content (see
  91. :variable:`CPACK_DEBIAN_PACKAGE_VERSION`). One may change the default value
  92. if the previous packaging was buggy and/or you want to put here a fancy Linux
  93. distro specific numbering.
  94. .. variable:: CPACK_DEBIAN_PACKAGE_ARCHITECTURE
  95. CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE
  96. The Debian package architecture
  97. * Mandatory : YES
  98. * Default : Output of ``dpkg --print-architecture`` (or ``i386``
  99. if ``dpkg`` is not found)
  100. .. versionadded:: 3.6
  101. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE`` variables.
  102. .. variable:: CPACK_DEBIAN_PACKAGE_DEPENDS
  103. CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
  104. Sets the Debian dependencies of this package.
  105. * Mandatory : NO
  106. * Default :
  107. - An empty string for non-component based installations
  108. - :variable:`CPACK_DEBIAN_PACKAGE_DEPENDS` for component-based
  109. installations.
  110. .. versionadded:: 3.3
  111. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS`` variables.
  112. .. note::
  113. If :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` or
  114. more specifically :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS`
  115. is set for this component, the discovered dependencies will be appended
  116. to :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS` instead of
  117. :variable:`CPACK_DEBIAN_PACKAGE_DEPENDS`. If
  118. :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS` is an empty string,
  119. only the automatically discovered dependencies will be set for this
  120. component.
  121. Example::
  122. set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
  123. .. variable:: CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
  124. .. versionadded:: 3.6
  125. Sets inter-component dependencies if listed with
  126. :variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables.
  127. * Mandatory : NO
  128. * Default : -
  129. .. variable:: CPACK_DEBIAN_PACKAGE_MAINTAINER
  130. The Debian package maintainer
  131. * Mandatory : YES
  132. * Default : ``CPACK_PACKAGE_CONTACT``
  133. .. variable:: CPACK_DEBIAN_PACKAGE_DESCRIPTION
  134. CPACK_DEBIAN_<COMPONENT>_DESCRIPTION
  135. The Debian package description
  136. * Mandatory : YES
  137. * Default :
  138. - :variable:`CPACK_DEBIAN_<COMPONENT>_DESCRIPTION` (component
  139. based installers only) if set, or :variable:`CPACK_DEBIAN_PACKAGE_DESCRIPTION` if set, or
  140. - :variable:`CPACK_COMPONENT_<compName>_DESCRIPTION` (component
  141. based installers only) if set, or :variable:`CPACK_PACKAGE_DESCRIPTION` if set, or
  142. - content of the file specified in :variable:`CPACK_PACKAGE_DESCRIPTION_FILE` if set
  143. If after that description is not set, :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` going to be
  144. used if set. Otherwise, :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` will be added as the first
  145. line of description as defined in `Debian Policy Manual`_.
  146. .. versionadded:: 3.3
  147. Per-component ``CPACK_COMPONENT_<compName>_DESCRIPTION`` variables.
  148. .. versionadded:: 3.16
  149. Per-component ``CPACK_DEBIAN_<COMPONENT>_DESCRIPTION`` variables.
  150. .. versionadded:: 3.16
  151. The ``CPACK_PACKAGE_DESCRIPTION_FILE`` variable.
  152. .. _Debian Policy Manual: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description
  153. .. variable:: CPACK_DEBIAN_PACKAGE_SECTION
  154. CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
  155. Set Section control field e.g. admin, devel, doc, ...
  156. * Mandatory : YES
  157. * Default : "devel"
  158. .. versionadded:: 3.5
  159. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION`` variables.
  160. See https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections
  161. .. variable:: CPACK_DEBIAN_ARCHIVE_TYPE
  162. .. versionadded:: 3.7
  163. .. deprecated:: 3.14
  164. The archive format used for creating the Debian package.
  165. * Mandatory : YES
  166. * Default : "gnutar"
  167. Possible value is:
  168. - gnutar
  169. .. note::
  170. This variable previously defaulted to the ``paxr`` value, but ``dpkg``
  171. has never supported that tar format. For backwards compatibility the
  172. ``paxr`` value will be mapped to ``gnutar`` and a deprecation message
  173. will be emitted.
  174. .. variable:: CPACK_DEBIAN_COMPRESSION_TYPE
  175. .. versionadded:: 3.1
  176. The compression used for creating the Debian package.
  177. * Mandatory : YES
  178. * Default : "gzip"
  179. Possible values are:
  180. ``lzma``
  181. Lempel–Ziv–Markov chain algorithm
  182. ``xz``
  183. XZ Utils compression
  184. ``bzip2``
  185. bzip2 Burrows–Wheeler algorithm
  186. ``gzip``
  187. GNU Gzip compression
  188. ``zstd``
  189. .. versionadded:: 3.22
  190. Zstandard compression
  191. .. variable:: CPACK_DEBIAN_PACKAGE_PRIORITY
  192. CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY
  193. Set Priority control field e.g. required, important, standard, optional,
  194. extra
  195. * Mandatory : YES
  196. * Default : "optional"
  197. .. versionadded:: 3.5
  198. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_PRIORITY`` variables.
  199. See https://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities
  200. .. variable:: CPACK_DEBIAN_PACKAGE_HOMEPAGE
  201. The URL of the web site for this package, preferably (when applicable) the
  202. site from which the original source can be obtained and any additional
  203. upstream documentation or information may be found.
  204. * Mandatory : NO
  205. * Default : :variable:`CMAKE_PROJECT_HOMEPAGE_URL`
  206. .. versionadded:: 3.12
  207. The ``CMAKE_PROJECT_HOMEPAGE_URL`` variable.
  208. .. note::
  209. The content of this field is a simple URL without any surrounding
  210. characters such as <>.
  211. .. variable:: CPACK_DEBIAN_PACKAGE_SHLIBDEPS
  212. CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS
  213. May be set to ON in order to use ``dpkg-shlibdeps`` to generate
  214. better package dependency list.
  215. * Mandatory : NO
  216. * Default :
  217. - :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` if set or
  218. - OFF
  219. .. note::
  220. You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value
  221. if you use this feature, because if you don't ``dpkg-shlibdeps``
  222. may fail to find your own shared libs.
  223. See https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
  224. .. note::
  225. You can also set :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS`
  226. to an appropriate value if you use this feature, in order to please
  227. ``dpkg-shlibdeps``. However, you should only do this for private
  228. shared libraries that could not get resolved otherwise.
  229. .. versionadded:: 3.3
  230. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS`` variables.
  231. .. versionadded:: 3.6
  232. Correct handling of ``$ORIGIN`` in :variable:`CMAKE_INSTALL_RPATH`.
  233. .. variable:: CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS
  234. .. versionadded:: 3.20
  235. May be set to a list of directories that will be given to ``dpkg-shlibdeps``
  236. via its ``-l`` option. These will be searched by ``dpkg-shlibdeps`` in order
  237. to find private shared library dependencies.
  238. * Mandatory : NO
  239. * Default :
  240. .. note::
  241. You should prefer to set :variable:`CMAKE_INSTALL_RPATH` to an appropriate
  242. value if you use ``dpkg-shlibdeps``. The current option is really only
  243. needed for private shared library dependencies.
  244. .. variable:: CPACK_DEBIAN_PACKAGE_DEBUG
  245. May be set when invoking cpack in order to trace debug information
  246. during the CPack DEB generator run.
  247. * Mandatory : NO
  248. * Default : -
  249. .. variable:: CPACK_DEBIAN_PACKAGE_PREDEPENDS
  250. CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS
  251. Sets the `Pre-Depends` field of the Debian package.
  252. Like :variable:`Depends <CPACK_DEBIAN_PACKAGE_DEPENDS>`, except that it
  253. also forces ``dpkg`` to complete installation of the packages named
  254. before even starting the installation of the package which declares the
  255. pre-dependency.
  256. * Mandatory : NO
  257. * Default :
  258. - An empty string for non-component based installations
  259. - :variable:`CPACK_DEBIAN_PACKAGE_PREDEPENDS` for component-based
  260. installations.
  261. .. versionadded:: 3.4
  262. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_PREDEPENDS`` variables.
  263. See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
  264. .. variable:: CPACK_DEBIAN_PACKAGE_ENHANCES
  265. CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES
  266. Sets the `Enhances` field of the Debian package.
  267. Similar to :variable:`Suggests <CPACK_DEBIAN_PACKAGE_SUGGESTS>` but works
  268. in the opposite direction: declares that a package can enhance the
  269. functionality of another package.
  270. * Mandatory : NO
  271. * Default :
  272. - An empty string for non-component based installations
  273. - :variable:`CPACK_DEBIAN_PACKAGE_ENHANCES` for component-based
  274. installations.
  275. .. versionadded:: 3.4
  276. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_ENHANCES`` variables.
  277. See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
  278. .. variable:: CPACK_DEBIAN_PACKAGE_BREAKS
  279. CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS
  280. Sets the `Breaks` field of the Debian package.
  281. When a binary package (P) declares that it breaks other packages (B),
  282. ``dpkg`` will not allow the package (P) which declares `Breaks` be
  283. **unpacked** unless the packages that will be broken (B) are deconfigured
  284. first.
  285. As long as the package (P) is configured, the previously deconfigured
  286. packages (B) cannot be reconfigured again.
  287. * Mandatory : NO
  288. * Default :
  289. - An empty string for non-component based installations
  290. - :variable:`CPACK_DEBIAN_PACKAGE_BREAKS` for component-based
  291. installations.
  292. .. versionadded:: 3.4
  293. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_BREAKS`` variables.
  294. See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-breaks
  295. .. variable:: CPACK_DEBIAN_PACKAGE_CONFLICTS
  296. CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS
  297. Sets the `Conflicts` field of the Debian package.
  298. When one binary package declares a conflict with another using a `Conflicts`
  299. field, ``dpkg`` will not allow them to be unpacked on the system at
  300. the same time.
  301. * Mandatory : NO
  302. * Default :
  303. - An empty string for non-component based installations
  304. - :variable:`CPACK_DEBIAN_PACKAGE_CONFLICTS` for component-based
  305. installations.
  306. .. versionadded:: 3.4
  307. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONFLICTS`` variables.
  308. See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-conflicts
  309. .. note::
  310. This is a stronger restriction than
  311. :variable:`Breaks <CPACK_DEBIAN_PACKAGE_BREAKS>`, which prevents the
  312. broken package from being configured while the breaking package is in
  313. the "Unpacked" state but allows both packages to be unpacked at the same
  314. time.
  315. .. variable:: CPACK_DEBIAN_PACKAGE_PROVIDES
  316. CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES
  317. Sets the `Provides` field of the Debian package.
  318. A virtual package is one which appears in the `Provides` control field of
  319. another package.
  320. * Mandatory : NO
  321. * Default :
  322. - An empty string for non-component based installations
  323. - :variable:`CPACK_DEBIAN_PACKAGE_PROVIDES` for component-based
  324. installations.
  325. .. versionadded:: 3.4
  326. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_PROVIDES`` variables.
  327. See https://www.debian.org/doc/debian-policy/ch-relationships.html#s-virtual
  328. .. variable:: CPACK_DEBIAN_PACKAGE_REPLACES
  329. CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES
  330. Sets the `Replaces` field of the Debian package.
  331. Packages can declare in their control file that they should overwrite
  332. files in certain other packages, or completely replace other packages.
  333. * Mandatory : NO
  334. * Default :
  335. - An empty string for non-component based installations
  336. - :variable:`CPACK_DEBIAN_PACKAGE_REPLACES` for component-based
  337. installations.
  338. .. versionadded:: 3.4
  339. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_REPLACES`` variables.
  340. See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
  341. .. variable:: CPACK_DEBIAN_PACKAGE_RECOMMENDS
  342. CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS
  343. Sets the `Recommends` field of the Debian package.
  344. Allows packages to declare a strong, but not absolute, dependency on other
  345. packages.
  346. * Mandatory : NO
  347. * Default :
  348. - An empty string for non-component based installations
  349. - :variable:`CPACK_DEBIAN_PACKAGE_RECOMMENDS` for component-based
  350. installations.
  351. .. versionadded:: 3.4
  352. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_RECOMMENDS`` variables.
  353. See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
  354. .. variable:: CPACK_DEBIAN_PACKAGE_SUGGESTS
  355. CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS
  356. Sets the `Suggests` field of the Debian package.
  357. Allows packages to declare a suggested package install grouping.
  358. * Mandatory : NO
  359. * Default :
  360. - An empty string for non-component based installations
  361. - :variable:`CPACK_DEBIAN_PACKAGE_SUGGESTS` for component-based
  362. installations.
  363. .. versionadded:: 3.4
  364. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_SUGGESTS`` variables.
  365. See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
  366. .. variable:: CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS
  367. .. versionadded:: 3.6
  368. * Mandatory : NO
  369. * Default : OFF
  370. Allows to generate shlibs control file automatically. Compatibility is defined by
  371. :variable:`CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY` variable value.
  372. .. note::
  373. Libraries are only considered if they have both library name and version
  374. set. This can be done by setting SOVERSION property with
  375. :command:`set_target_properties` command.
  376. .. variable:: CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY
  377. .. versionadded:: 3.6
  378. Compatibility policy for auto-generated shlibs control file.
  379. * Mandatory : NO
  380. * Default : "="
  381. Defines compatibility policy for auto-generated shlibs control file.
  382. Possible values: "=", ">="
  383. See https://www.debian.org/doc/debian-policy/ch-sharedlibs.html#s-sharedlibs-shlibdeps
  384. .. variable:: CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
  385. CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_EXTRA
  386. This variable allow advanced user to add custom script to the
  387. control.tar.gz.
  388. Typical usage is for conffiles, postinst, postrm, prerm.
  389. * Mandatory : NO
  390. * Default : -
  391. Usage::
  392. set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
  393. "${CMAKE_CURRENT_SOURCE_DIR}/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
  394. .. versionadded:: 3.4
  395. Per-component ``CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_EXTRA`` variables.
  396. .. variable:: CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION
  397. CPACK_DEBIAN_<COMPONENT>_PACKAGE_CONTROL_STRICT_PERMISSION
  398. .. versionadded:: 3.4
  399. This variable indicates if the Debian policy on control files should be
  400. strictly followed.
  401. * Mandatory : NO
  402. * Default : FALSE
  403. Usage::
  404. set(CPACK_DEBIAN_PACKAGE_CONTROL_STRICT_PERMISSION TRUE)
  405. This overrides the permissions on the original files, following the rules
  406. set by Debian policy
  407. https://www.debian.org/doc/debian-policy/ch-files.html#s-permissions-owners
  408. .. note::
  409. The original permissions of the files will be used in the final
  410. package unless this variable is set to ``TRUE``.
  411. In particular, the scripts should have the proper executable
  412. flag prior to the generation of the package.
  413. .. variable:: CPACK_DEBIAN_PACKAGE_SOURCE
  414. CPACK_DEBIAN_<COMPONENT>_PACKAGE_SOURCE
  415. .. versionadded:: 3.5
  416. Sets the ``Source`` field of the binary Debian package.
  417. When the binary package name is not the same as the source package name
  418. (in particular when several components/binaries are generated from one
  419. source) the source from which the binary has been generated should be
  420. indicated with the field ``Source``.
  421. * Mandatory : NO
  422. * Default :
  423. - An empty string for non-component based installations
  424. - :variable:`CPACK_DEBIAN_PACKAGE_SOURCE` for component-based
  425. installations.
  426. See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
  427. .. note::
  428. This value is not interpreted. It is possible to pass an optional
  429. revision number of the referenced source package as well.
  430. Packaging of debug information
  431. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  432. .. versionadded:: 3.13
  433. Dbgsym packages contain debug symbols for debugging packaged binaries.
  434. Dbgsym packaging has its own set of variables:
  435. .. variable:: CPACK_DEBIAN_DEBUGINFO_PACKAGE
  436. CPACK_DEBIAN_<component>_DEBUGINFO_PACKAGE
  437. Enable generation of dbgsym .ddeb package(s).
  438. * Mandatory : NO
  439. * Default : OFF
  440. .. note::
  441. Setting this also strips the ELF files in the generated non-dbgsym package,
  442. which results in debuginfo only being available in the dbgsym package.
  443. .. note::
  444. Binaries must contain debug symbols before packaging so use either ``Debug``
  445. or ``RelWithDebInfo`` for :variable:`CMAKE_BUILD_TYPE` variable value.
  446. Additionally, if :variable:`CPACK_STRIP_FILES` is set, the files will be stripped before
  447. they get to the DEB generator, so will not contain debug symbols and
  448. a dbgsym package will not get built. Do not use with :variable:`CPACK_STRIP_FILES`.
  449. Building Debian packages on Windows
  450. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  451. .. versionadded:: 3.10
  452. To communicate UNIX file permissions from the install stage
  453. to the CPack DEB generator the "cmake_mode_t" NTFS
  454. alternate data stream (ADT) is used.
  455. When a filesystem without ADT support is used only owner read/write
  456. permissions can be preserved.
  457. Reproducible packages
  458. ^^^^^^^^^^^^^^^^^^^^^
  459. .. versionadded:: 3.13
  460. The environment variable ``SOURCE_DATE_EPOCH`` may be set to a UNIX
  461. timestamp, defined as the number of seconds, excluding leap seconds,
  462. since 01 Jan 1970 00:00:00 UTC. If set, the CPack DEB generator will
  463. use its value for timestamps in the package.