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() ...@@ -24,6 +24,7 @@ endmacro()
set_from_component(LICENSE) set_from_component(LICENSE)
set_from_component(VENDOR) set_from_component(VENDOR)
set_from_component(VERSION)
# #
# Support for the %posttrans scriptlet # Support for the %posttrans scriptlet
...@@ -80,6 +81,7 @@ set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH}) ...@@ -80,6 +81,7 @@ set(CMAKE_MODULE_PATH ${orig_CMAKE_MODULE_PATH})
restore(LICENSE) restore(LICENSE)
restore(VENDOR) restore(VENDOR)
restore(VERSION)
if(${orig_${base_var}}) if(${orig_${base_var}})
set(${base_var} ${orig_${base_var}}) set(${base_var} ${orig_${base_var}})
endif() endif()
......
...@@ -33,13 +33,14 @@ SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts ...@@ -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_NAME ${CPACK_PACKAGE_NAME})
SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
IF(CMAKE_VERSION VERSION_LESS "3.6.0") 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() ELSE()
SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT") SET(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON) OPTION(CPACK_RPM_DEBUGINFO_PACKAGE "" ON)
MARK_AS_ADVANCED(CPACK_RPM_DEBUGINFO_PACKAGE) 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() ENDIF()
SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}") SET(CPACK_RPM_PACKAGE_RELEASE "1%{?dist}")
......
...@@ -57,6 +57,7 @@ IF(NOT "${MAJOR_VERSION}" MATCHES "[0-9]+" OR ...@@ -57,6 +57,7 @@ IF(NOT "${MAJOR_VERSION}" MATCHES "[0-9]+" OR
ENDIF() ENDIF()
SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}") SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}")
SET(SERVER_VERSION ${VERSION})
MESSAGE(STATUS "MariaDB ${VERSION}") MESSAGE(STATUS "MariaDB ${VERSION}")
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base 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}") SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
......
...@@ -245,7 +245,8 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -245,7 +245,8 @@ MACRO(MYSQL_ADD_PLUGIN)
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT} NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT}
AND INSTALL_SYSCONF2DIR) AND INSTALL_SYSCONF2DIR)
IF (ARG_STORAGE_ENGINE) IF (ARG_STORAGE_ENGINE)
SET(ver " = %{version}-%{release}") STRING(REPLACE "-" "_" ver ${SERVER_VERSION})
SET(ver " = ${ver}-%{release}")
ELSE() ELSE()
SET(ver "") SET(ver "")
ENDIF() ENDIF()
...@@ -256,6 +257,9 @@ MACRO(MYSQL_ADD_PLUGIN) ...@@ -256,6 +257,9 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE) SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE)
ENDIF() ENDIF()
SET(CPACK_RPM_${ARG_COMPONENT}_USER_FILELIST ${ignored} PARENT_SCOPE) 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_CLIENT AND UNIX)
IF (NOT ARG_CONFIG) IF (NOT ARG_CONFIG)
SET(ARG_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.cnf") 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