CPackDeb: Use `CPACK_PACKAGE_DESCRIPTION_FILE`
Rationale
My initial problem was caused by the inability to set the package description in a generic way. E.g, I have a project which produces RPM and/or DEB packages. Setting the only CPACK_COMPONENT_<COMPONENT>_DESCRIPTION
is not possible: Debian Policy Manual require to format it properly (not needed for RPM). Unfortunately, there is CPACK_RPM_<component>_PACKAGE_DESCRIPTION
, but no corresponding CPACK_DEB_<component>_PACKAGE_DESCRIPTION
, so I can't assign the "Deb-only" description. Nowadays, the only way is to assign per-generator (if supported) description (and per-component) and format the generic description according to Debian rules... which is IMO not really nice way.
What has been done
Setting the Deb package description code was rewritten:
- introduced
CPACK_DEBIAN_<COMPONENT>_DESCRIPTION
w/ fallbackCPACK_COMPONENT_<COMPONENT>_DESCRIPTION
- if none of above have set, try to read the description from
CPACK_PACKAGE_DESCRIPTION_FILE
(that was missed in CPackDeb) toCPACK_DEBIAN_PACKAGE_DESCRIPTION
- the
CPACK_PACKAGE_DESCRIPTION_SUMMARY
could be used as the description (if still not set) or prepended to the description text as supposed by the Debian Policy Manual - report error if still no description (w/ the text as it was before)
- format the obtained description according to the guidelines
- the code was refactored to use modern CMake commands (the commits before adding the new features)
Topic-rename: cpack-DEB-use-CPACK_PACKAGE_DESCRIPTION_FILE