deb.rst 22 KB

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