From ab3a6ca67032f22c763c8a1b97d644d4a8701334 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 7 Jul 2019 15:07:13 +0200 Subject: [PATCH] cleanup: CPACK_RPM_* package description add cmake helper macro SET_IF_UNSET() and use it for CPACK_* variables --- cmake/cpack_rpm.cmake | 11 +---------- cmake/misc.cmake | 6 ++++++ cmake/mysql_version.cmake | 25 ++++++++++++++----------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmake/cpack_rpm.cmake b/cmake/cpack_rpm.cmake index 46f606c5986..4c72ac69d1a 100644 --- a/cmake/cpack_rpm.cmake +++ b/cmake/cpack_rpm.cmake @@ -45,17 +45,8 @@ SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2") SET(CPACK_RPM_PACKAGE_RELOCATABLE FALSE) SET(CPACK_PACKAGE_RELOCATABLE FALSE) SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases") -SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_SUMMARY}) SET(CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_URL}) -SET(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_RPM_PACKAGE_SUMMARY} - -It is GPL v2 licensed, which means you can use the it free of charge under the -conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/). - -MariaDB documentation can be found at https://mariadb.com/kb -MariaDB bug reports should be submitted through https://jira.mariadb.org - -") +SET(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}") SET(CPACK_RPM_shared_PACKAGE_VENDOR "MariaDB Corporation Ab") SET(CPACK_RPM_shared_PACKAGE_LICENSE "LGPLv2.1") diff --git a/cmake/misc.cmake b/cmake/misc.cmake index 928c33fd8d2..2a0c57b1973 100644 --- a/cmake/misc.cmake +++ b/cmake/misc.cmake @@ -11,3 +11,9 @@ ELSE() SET(__msg1_${id} ${hash} CACHE INTERNAL "") ENDFUNCTION() ENDIF() + +MACRO(SET_IF_UNSET VAR VAL) + IF(NOT DEFINED ${VAR}) + SET(${VAR} ${VAL}) + ENDIF() +ENDMACRO() diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 26e8538bbbc..114af99f954 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -70,24 +70,27 @@ ENDMACRO() GET_MYSQL_VERSION() SET(MYSQL_TCP_PORT_DEFAULT 0) -IF(NOT MYSQL_TCP_PORT) - SET(MYSQL_TCP_PORT 3306) -ENDIF() +SET_IF_UNSET(MYSQL_TCP_PORT 3306) -IF(NOT COMPILATION_COMMENT) - SET(COMPILATION_COMMENT "Source distribution") -ENDIF() +SET_IF_UNSET(COMPILATION_COMMENT "Source distribution") INCLUDE(package_name) IF(NOT CPACK_PACKAGE_FILE_NAME) GET_PACKAGE_FILE_NAME(CPACK_PACKAGE_FILE_NAME) ENDIF() -IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME) - SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mariadb-${VERSION}") -ENDIF() -SET(CPACK_PACKAGE_CONTACT "MariaDB Developers ") -SET(CPACK_PACKAGE_VENDOR "MariaDB Foundation") +SET_IF_UNSET(CPACK_SOURCE_PACKAGE_FILE_NAME "mariadb-${VERSION}") +SET_IF_UNSET(CPACK_PACKAGE_CONTACT "MariaDB Developers ") +SET_IF_UNSET(CPACK_PACKAGE_VENDOR "MariaDB Foundation") +SET_IF_UNSET(CPACK_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY} + +It is GPL v2 licensed, which means you can use the it free of charge under the +conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/). + +MariaDB documentation can be found at https://mariadb.com/kb +MariaDB bug reports should be submitted through https://jira.mariadb.org + +") SET(CPACK_SOURCE_GENERATOR "TGZ") # Defintions for windows version resources