summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorHarry Mallon <harry@codexdigital.com>2016-05-11 09:21:11 (GMT)
committerDomen Vrankar <domen.vrankar@gmail.com>2016-05-14 18:21:32 (GMT)
commitf7003a60557e828f08ee893c5da78b24423b5223 (patch)
treed685597bc3e2c7cf5f8b71d16cc28005cc8491f2 /Modules
parentb952336902e9206ba51e1d77b8e489bdd759f73f (diff)
downloadCMake-f7003a60557e828f08ee893c5da78b24423b5223.zip
CMake-f7003a60557e828f08ee893c5da78b24423b5223.tar.gz
CMake-f7003a60557e828f08ee893c5da78b24423b5223.tar.bz2
CPack/RPM release dist tag support
Some Linux distros require Release tag to be set to <ReleaseVersion><Dist>.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackRPM.cmake27
1 files changed, 24 insertions, 3 deletions
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 768d64f..330fc1e 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -80,10 +80,27 @@
#
# This is the numbering of the RPM package itself, i.e. the version of the
# packaging and not the version of the content (see
-# CPACK_RPM_PACKAGE_VERSION). One may change the default value if the
-# previous packaging was buggy and/or you want to put here a fancy Linux
+# :variable:`CPACK_RPM_PACKAGE_VERSION`). One may change the default value if
+# the previous packaging was buggy and/or you want to put here a fancy Linux
# distro specific numbering.
#
+# .. note::
+#
+# This is the string that goes into the RPM ``Release:`` field. Some distros
+# (e.g. Fedora, CentOS) require ``1%{?dist}`` format and not just a number.
+# ``%{?dist}`` part can be added by setting :variable:`CPACK_RPM_PACKAGE_RELEASE_DIST`.
+#
+# .. variable:: CPACK_RPM_PACKAGE_RELEASE_DIST
+#
+# The dist tag that is added RPM ``Release:`` field.
+#
+# * Mandatory : NO
+# * Default : OFF
+#
+# This is the reported ``%{dist}`` tag from the current distribution or empty
+# ``%{dist}`` if RPM macro is not set. If this variable is set then RPM
+# ``Release:`` field value is set to ``${CPACK_RPM_PACKAGE_RELEASE}%{?dist}``.
+#
# .. variable:: CPACK_RPM_PACKAGE_LICENSE
#
# The RPM package license policy.
@@ -1317,7 +1334,11 @@ function(cpack_rpm_generate_package)
# This is the case when the packaging is buggy (not) the software :=)
# If not set, 1 is a good candidate
if(NOT CPACK_RPM_PACKAGE_RELEASE)
- set(CPACK_RPM_PACKAGE_RELEASE 1)
+ set(CPACK_RPM_PACKAGE_RELEASE "1")
+ endif()
+
+ if(CPACK_RPM_PACKAGE_RELEASE_DIST)
+ set(CPACK_RPM_PACKAGE_RELEASE "${CPACK_RPM_PACKAGE_RELEASE}%{?dist}")
endif()
# CPACK_RPM_PACKAGE_LICENSE