summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-11-26 18:58:10 +0100
committerSergei Golubchik <serg@mariadb.org>2021-01-12 16:47:23 +0100
commit78806be6d34a6083f09e79bfddcaaac9d7708dd3 (patch)
tree48392fca374ef4f6551c718539f72b3c606ccbf5
parent64d2849b3eea78167cf479d9efe39e718dba36af (diff)
downloadmariadb-git-78806be6d34a6083f09e79bfddcaaac9d7708dd3.tar.gz
MDEV-24292 support semi-independent versioning for sub-packages
2. Embed plugin version into the RPM package version introduce SERVER_VERSION, because plugins can overwrite VERSION (and columnstore actually does)
-rw-r--r--cmake/Internal/CPack/CPackRPM.cmake2
-rw-r--r--cmake/cpack_rpm.cmake5
-rw-r--r--cmake/mysql_version.cmake1
-rw-r--r--cmake/plugin.cmake6
4 files changed, 11 insertions, 3 deletions
diff --git a/cmake/Internal/CPack/CPackRPM.cmake b/cmake/Internal/CPack/CPackRPM.cmake
index 6e376b2255f..174d28b9a14 100644
--- a/cmake/Internal/CPack/CPackRPM.cmake
+++ b/cmake/Internal/CPack/CPackRPM.cmake
@@ -24,6 +24,7 @@ endmacro()
set_from_component(LICENSE)
set_from_component(VENDOR)
+set_from_component(VERSION)
#
# Support for the %posttrans scriptlet
@@ -80,6 +81,7 @@ set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})
restore(LICENSE)
restore(VENDOR)
+restore(VERSION)
if(${orig_${base_var}})
set(${base_var} ${orig_${base_var}})
endif()
diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake
index 0ff3fdedcda..f64d16918d2 100644
--- a/cmake/cpack_rpm.cmake
+++ b/cmake/cpack_rpm.cmake
@@ -33,13 +33,14 @@ SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts
)
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
+SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
IF(CMAKE_VERSION VERSION_LESS "3.6.0")
- SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
+ SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
ELSE()
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON)
MARK_AS_ADVANCED(CPACK_RPM_DEBUGINFO_PACKAGE)
- SET(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${VERSION}")
+ SET(CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX "/usr/src/debug/${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}")
ENDIF()
SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")
diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake
index 85273136a32..fd8d02155b3 100644
--- a/cmake/mysql_version.cmake
+++ b/cmake/mysql_version.cmake
@@ -57,6 +57,7 @@ IF(NOT "${MAJOR_VERSION}" MATCHES "[0-9]+" OR
ENDIF()
SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}")
+ SET(SERVER_VERSION ${VERSION})
MESSAGE(STATUS "MariaDB ${VERSION}")
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 2dab9a651da..e0f6c1da292 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -245,7 +245,8 @@ MACRO(MYSQL_ADD_PLUGIN)
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT}
AND INSTALL_SYSCONF2DIR)
IF (ARG_STORAGE_ENGINE)
- SET(ver " = %{version}-%{release}")
+ STRING(REPLACE "-" "_" ver ${SERVER_VERSION})
+ SET(ver " = ${ver}-%{release}")
ELSE()
SET(ver "")
ENDIF()
@@ -256,6 +257,9 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE)
ENDIF()
SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE)
+ IF (ARG_VERSION)
+ SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_VERSION ${SERVER_VERSION}_${ARG_VERSION} PARENT_SCOPE)
+ ENDIF()
IF(NOT ARG_CLIENT AND UNIX)
IF (NOT ARG_CONFIG)
SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.cnf")