Commit 78806be6 authored by Sergei Golubchik's avatar Sergei Golubchik

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)
parent 64d2849b
......@@ -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()
......
......@@ -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}")
......
......@@ -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}")
......
......@@ -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")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment