Commit 09665bfd authored by Jani Tolonen's avatar Jani Tolonen

MDEV-3931 Cassandra SE packaging

Added autodetection for thrift library and includes
Added Cassandra Storage Engine rpm
parent 2b0f4bdf
...@@ -20,12 +20,13 @@ SET(CPACK_COMPONENT_CLIENT_GROUP "client") ...@@ -20,12 +20,13 @@ SET(CPACK_COMPONENT_CLIENT_GROUP "client")
SET(CPACK_COMPONENT_MANPAGESCLIENT_GROUP "client") SET(CPACK_COMPONENT_MANPAGESCLIENT_GROUP "client")
SET(CPACK_COMPONENT_README_GROUP "server") SET(CPACK_COMPONENT_README_GROUP "server")
SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "shared") SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "shared")
SET(CPACK_COMPONENT_CASSANDRASELIBRARIES_GROUP "CassandraSE")
SET(CPACK_COMPONENT_COMMON_GROUP "common") SET(CPACK_COMPONENT_COMMON_GROUP "common")
SET(CPACK_COMPONENT_COMPAT_GROUP "compat") SET(CPACK_COMPONENT_COMPAT_GROUP "compat")
SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts
SupportFiles Development ManPagesDevelopment SupportFiles Development ManPagesDevelopment
ManPagesTest Readme ManPagesClient Test ManPagesTest Readme ManPagesClient Test
Common Client SharedLibraries) Common Client SharedLibraries CassandraSE)
SET(CPACK_RPM_PACKAGE_NAME "MariaDB") SET(CPACK_RPM_PACKAGE_NAME "MariaDB")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}") SET(CPACK_PACKAGE_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${VERSION}-${RPM}-${CMAKE_SYSTEM_PROCESSOR}")
...@@ -63,6 +64,7 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE} ...@@ -63,6 +64,7 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}
") ")
SET(CPACK_RPM_PACKAGE_REQUIRES "MariaDB-common") SET(CPACK_RPM_PACKAGE_REQUIRES "MariaDB-common")
SET(CPACK_RPM_CassandraSE_PACKAGE_REQUIRES "MariaDB-server")
SET(CPACK_RPM_server_USER_FILELIST "%ignore /etc" "%ignore /etc/init.d" "%config(noreplace) /etc/my.cnf.d/*") SET(CPACK_RPM_server_USER_FILELIST "%ignore /etc" "%ignore /etc/init.d" "%config(noreplace) /etc/my.cnf.d/*")
SET(CPACK_RPM_common_USER_FILELIST "%config(noreplace) /etc/my.cnf") SET(CPACK_RPM_common_USER_FILELIST "%config(noreplace) /etc/my.cnf")
......
# use the first path that has Thrift.h included, if found
IF(NOT WITH_CASSANDRA_STORAGE_ENGINE) FIND_PATH(Thrift_INCLUDE_DIRS Thrift.h PATHS
SET(WITHOUT_CASSANDRA 1) $ENV{THRIFT_INCLUDE} # environment variable to be used optionally
ENDIF(NOT WITH_CASSANDRA_STORAGE_ENGINE) ${Thrift_INCLUDE_DIR} # this may be set
/usr/local/include/thrift # list of additional directories to look from
/opt/local/include/thrift
SET(cassandra_sources /usr/include/thrift
ha_cassandra.cc /opt/include/thrift
ha_cassandra.h )
cassandra_se.h
cassandra_se.cc # Verify that thrift linking library is found
gen-cpp/Cassandra.cpp FIND_LIBRARY(Thrift_LIBS NAMES thrift PATHS ${Thrift_LIB_PATHS} ${Thrift_LIB})
gen-cpp/cassandra_types.h IF(EXISTS ${Thrift_LIBS})
gen-cpp/cassandra_types.cpp GET_FILENAME_COMPONENT(LINK_DIR ${Thrift_LIBS} PATH ABSOLUTE)
gen-cpp/cassandra_constants.h ELSE()
gen-cpp/cassandra_constants.cpp RETURN()
gen-cpp/Cassandra.h) ENDIF()
#INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(AFTER ${Thrift_INCLUDE_DIRS})
SET(CMAKE_REQUIRED_INCLUDES ${Thrift_INCLUDE_DIRS})
#INCLUDE_DIRECTORIES(AFTER /usr/local/include/thrift)
INCLUDE_DIRECTORIES(AFTER /home/buildbot/build/thrift-inst/include/thrift/) CHECK_CXX_SOURCE_COMPILES(
#INCLUDE_DIRECTORIES(AFTER /home/psergey/cassandra/thrift/include/thrift/) "
#include <Thrift.h>
# int main() { return 0; }
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) " CASSANDRASE_OK)
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
#LINK_DIRECTORIES(/home/psergey/cassandra/thrift/lib) IF(CASSANDRASE_OK)
SET(cassandra_sources
MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES thrift) ha_cassandra.cc
# was: STORAGE_ENGINE MANDATORY ha_cassandra.h
cassandra_se.h
cassandra_se.cc
gen-cpp/Cassandra.cpp
gen-cpp/cassandra_types.h
gen-cpp/cassandra_types.cpp
gen-cpp/cassandra_constants.h
gen-cpp/cassandra_constants.cpp
gen-cpp/Cassandra.h)
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
LINK_DIRECTORIES(${LINK_DIR})
MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES thrift COMPONENT CassandraSE)
INSTALL(FILES cassandra.cnf DESTINATION ${INSTALL_SYSCONFDIR}/my.cnf.d
COMPONENT CassandraSE)
ENDIF(CASSANDRASE_OK)
[mariadb]
plugin-load-add=ha_cassandra.so
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