summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-16 14:11:35 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-05-16 14:11:35 (GMT)
commitd3db070e9eb7890958ae2b9d91085f5c7c6770f8 (patch)
tree0d219ed62ac1ec81240d19a5b64d64892fc8a5d0 /Modules
parentbc7598fde0e6d9322667f14be8d062b8ba68e666 (diff)
parentf5089cfccd96f2c94838faa1736fa452ae4bb853 (diff)
downloadCMake-d3db070e9eb7890958ae2b9d91085f5c7c6770f8.zip
CMake-d3db070e9eb7890958ae2b9d91085f5c7c6770f8.tar.gz
CMake-d3db070e9eb7890958ae2b9d91085f5c7c6770f8.tar.bz2
Merge topic 'cpack-rpm-adding-dist-to-release-tag'
f5089cfc CPack/RPM adding dist to release tag test f7003a60 CPack/RPM release dist tag support
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 dca5f00..aecb7fc 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -104,10 +104,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.
@@ -1341,7 +1358,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