Commit 4e04b863 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

port some mysql_binary_distribution hacks to cmake

parent 166c3211
...@@ -133,8 +133,30 @@ ENDIF(UNIX) ...@@ -133,8 +133,30 @@ ENDIF(UNIX)
set(prefix "${CMAKE_INSTALL_PREFIX}") # Really ugly, one script, "mysql_install_db", needs prefix set to ".",
# i.e. makes access relative the current directory. This matches
# the documentation, so better not change this.
SET(prefix .)
SET(bindir ./bin)
SET(sbindir ./bin)
SET(scriptdir ./bin)
SET(libexecdir ./bin)
SET(pkgdatadir ./share)
SET(localstatedir ./data)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_install_db.sh
${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db ESCAPE_QUOTES @ONLY)
INSTALL(FILES
"${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db"
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE
OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
SET(prefix "${CMAKE_INSTALL_PREFIX}")
SET(sysconfdir ${prefix}) SET(sysconfdir ${prefix})
SET(bindir ${prefix}/bin) SET(bindir ${prefix}/bin)
SET(libexecdir ${prefix}/bin) SET(libexecdir ${prefix}/bin)
...@@ -253,7 +275,6 @@ ELSE() ...@@ -253,7 +275,6 @@ ELSE()
mysqld_multi mysqld_multi
mysqlaccess mysqlaccess
mysqlaccess.conf mysqlaccess.conf
mysql_install_db
) )
FOREACH(file ${BIN_SCRIPTS}) FOREACH(file ${BIN_SCRIPTS})
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
...@@ -288,7 +309,7 @@ ELSE() ...@@ -288,7 +309,7 @@ ELSE()
# For some reason, mysqld_safe needs to be also in scripts directory # For some reason, mysqld_safe needs to be also in scripts directory
INSTALL(FILES INSTALL(FILES
"${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db" "${CMAKE_CURRENT_BINARY_DIR}/mysqld_safe"
DESTINATION scripts DESTINATION scripts
PERMISSIONS OWNER_READ OWNER_WRITE PERMISSIONS OWNER_READ OWNER_WRITE
OWNER_EXECUTE GROUP_READ GROUP_EXECUTE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
......
...@@ -26,8 +26,8 @@ ELSE() ...@@ -26,8 +26,8 @@ ELSE()
SET(datadir "/usr/local/mysql/data") SET(datadir "/usr/local/mysql/data")
SET(CC ${CMAKE_C_COMPILER}) SET(CC ${CMAKE_C_COMPILER})
SET(CXX ${CMAKE_CXX_COMPILER}) SET(CXX ${CMAKE_CXX_COMPILER})
SET(CFLAGS ${CMAKE_C_COMPILE_FLAGS}) SET(CFLAGS ${CMAKE_C_FLAGS})
SET(CXXFLAGS ${CMAKE_COMPILE_CXX_FLAGS}) SET(CXXFLAGS ${CMAKE_CXX_FLAGS})
SET(MYSQLD_USER "mysql") SET(MYSQLD_USER "mysql")
SET(install_destination "support-files") SET(install_destination "support-files")
SET(ini_file_extension "cnf") SET(ini_file_extension "cnf")
...@@ -44,7 +44,7 @@ IF(UNIX) ...@@ -44,7 +44,7 @@ IF(UNIX)
FILE(GLOB ndb_ini_files ${CMAKE_CURRENT_SOURCE_DIR}/*.ini) FILE(GLOB ndb_ini_files ${CMAKE_CURRENT_SOURCE_DIR}/*.ini)
INSTALL(FILES ${ndb_ini_files} DESTINATION ${install_destination}) INSTALL(FILES ${ndb_ini_files} DESTINATION ${install_destination})
FOREACH(script mysql.server mysqld_multi.server mysql-log-rotate) FOREACH(script mysqld_multi.server mysql-log-rotate)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${script}.sh
${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY ) ${CMAKE_CURRENT_BINARY_DIR}/${script} @ONLY )
...@@ -57,5 +57,17 @@ IF(UNIX) ...@@ -57,5 +57,17 @@ IF(UNIX)
CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY) CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY)
CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @ONLY) CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @ONLY)
CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY) CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
# mysql.server needs another set variables
SET(bindir ./bin)
SET(sbindir ./bin)
SET(scriptdir ./bin)
SET(libexecdir ./bin)
SET(pkgdatadir "${CMAKE_INSTALL_PREFIX}/data")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql.server.sh
${CMAKE_CURRENT_BINARY_DIR}/mysql.server @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysql.server
DESTINATION support-files
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF() ENDIF()
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