Moved CMake modules to a separate directory and disabled local installs of system files when building packages.
The building of packages with CMake now requires the -DPACKAGE=Y flag to be set when configuring CMake.
This commit is contained in:
@ -9,7 +9,7 @@ set_maxscale_version()
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/local/skysql/maxscale" CACHE PATH "Prefix prepended to install directories.")
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/")
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
|
||||
|
||||
project(MaxScale)
|
||||
|
||||
@ -26,11 +26,9 @@ set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib:${CMA
|
||||
|
||||
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/server/include)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/server/include/version.h.in ${CMAKE_BINARY_DIR}/server/include/version.h)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf.prep @ONLY)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/etc/init.d/maxscale.prep @ONLY)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/ubuntu/init.d/maxscale.in ${CMAKE_BINARY_DIR}/etc/ubuntu/init.d/maxscale.prep @ONLY)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/server/test/maxscale_test.h.in ${CMAKE_BINARY_DIR}/server/include/maxscale_test.h)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/postinstall.sh.in ${CMAKE_BINARY_DIR}/postinst)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/postinst.in ${CMAKE_BINARY_DIR}/postinst)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/postrm.in ${CMAKE_BINARY_DIR}/postrm)
|
||||
|
||||
set(CMAKE_C_FLAGS "-Wall -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "-Wall -fPIC")
|
||||
@ -107,19 +105,6 @@ if(BUILD_RABBITMQ)
|
||||
add_subdirectory(rabbitmq_consumer)
|
||||
endif()
|
||||
|
||||
# Install startup scripts and ldconfig files
|
||||
if( NOT ( (DEFINED INSTALL_SYSTEM_FILES) AND ( NOT ( INSTALL_SYSTEM_FILES ) ) ) )
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/maxscale.conf.prep RENAME maxscale.conf DESTINATION .)
|
||||
if(DEB_BASED)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/etc/ubuntu/init.d/maxscale.prep RENAME maxscale DESTINATION .)
|
||||
else()
|
||||
install(FILES ${CMAKE_BINARY_DIR}/etc/init.d/maxscale.prep RENAME maxscale DESTINATION .)
|
||||
endif()
|
||||
message(STATUS "Installing maxscale.conf to: /etc/ld.so.conf.d")
|
||||
message(STATUS "Installing startup scripts to: /etc/init.d")
|
||||
endif()
|
||||
|
||||
file(GLOB DOCS Documentation/*.pdf)
|
||||
message(STATUS "Installing MaxScale to: ${CMAKE_INSTALL_PREFIX}/")
|
||||
|
||||
@ -132,6 +117,25 @@ install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION .)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/SETUP DESTINATION .)
|
||||
install(DIRECTORY DESTINATION log)
|
||||
|
||||
# Install startup scripts and ldconfig files
|
||||
if( NOT ( (DEFINED INSTALL_SYSTEM_FILES) AND ( NOT ( INSTALL_SYSTEM_FILES ) ) ) )
|
||||
configure_file(${CMAKE_SOURCE_DIR}/maxscale.conf.in ${CMAKE_BINARY_DIR}/maxscale.conf @ONLY)
|
||||
if(DEB_BASED)
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/ubuntu/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
||||
else()
|
||||
configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_BINARY_DIR}/maxscale @ONLY)
|
||||
endif()
|
||||
if(NOT PACKAGE)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/maxscale DESTINATION /etc/init.d
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/maxscale.conf DESTINATION /etc/ld.so.conf.d
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
message(STATUS "Installing maxscale.conf to: /etc/ld.so.conf.d")
|
||||
message(STATUS "Installing startup scripts to: /etc/init.d")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(PACKAGE)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 2.8.12)
|
||||
message(WARNING "CMake version is ${CMAKE_VERSION}. Building of packages requires version 2.8.12 or greater.")
|
||||
else()
|
||||
@ -160,11 +164,11 @@ else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "maxscale-${MAXSCALE_VERSION}")
|
||||
set(CPACK_PACKAGE_NAME "maxscale")
|
||||
set(CPACK_PACKAGE_VENDOR "MariaDB Corporation Ab")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/README)
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_SOURCE_DIR}/etc/DESCRIPTION)
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/postinst;{CMAKE_BINARY_DIR}/postrm")
|
||||
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${CMAKE_BINARY_DIR}/postinst)
|
||||
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/postrm)
|
||||
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_BINARY_DIR}/postrm)
|
||||
set(CPACK_RPM_PACKAGE_NAME "maxscale")
|
||||
set(CPACK_RPM_PACKAGE_VENDOR "MariaDB Corporation Ab")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
|
||||
@ -175,7 +179,7 @@ else()
|
||||
set(CPACK_RPM_USER_FILELIST "%ignore /etc")
|
||||
include(CPack)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
add_custom_target(buildtests
|
||||
COMMAND ${CMAKE_COMMAND} -DDEPS_OK=Y -DBUILD_TESTS=Y -DBUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} -DINSTALL_SYSTEM_FILES=N ${CMAKE_SOURCE_DIR}
|
||||
@ -193,7 +197,7 @@ add_custom_target(testall
|
||||
# uninstall target
|
||||
# see http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
|
9
etc/DESCRIPTION
Normal file
9
etc/DESCRIPTION
Normal file
@ -0,0 +1,9 @@
|
||||
The MariaDB Corporation MaxScale is an intelligent proxy that allows forwarding of
|
||||
database statements to one or more database servers using complex rules,
|
||||
a semantic understanding of the database statements and the roles of
|
||||
the various servers within the backend cluster of databases.
|
||||
|
||||
MaxScale is designed to provide load balancing and high availability
|
||||
functionality transparently to the applications. In addition it provides
|
||||
a highly scalable and flexibile architecture, with plugin components to
|
||||
support different protocols and routing decissions.
|
@ -59,6 +59,9 @@ macro(set_variables)
|
||||
# Build tests
|
||||
set(BUILD_TESTS FALSE CACHE BOOL "Build tests")
|
||||
|
||||
# Build packages
|
||||
set(PACKAGE FALSE CACHE BOOL "Enable package building (this disables local installation of system files)")
|
||||
|
||||
endmacro()
|
||||
|
||||
macro(check_deps)
|
||||
|
Reference in New Issue
Block a user