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")
SET(CPACK_COMPONENT_MANPAGESCLIENT_GROUP "client")
SET(CPACK_COMPONENT_README_GROUP "server")
SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "shared")
SET(CPACK_COMPONENT_CASSANDRASELIBRARIES_GROUP "CassandraSE")
SET(CPACK_COMPONENT_COMMON_GROUP "common")
SET(CPACK_COMPONENT_COMPAT_GROUP "compat")
SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts
SupportFiles Development ManPagesDevelopment
ManPagesTest Readme ManPagesClient Test
Common Client SharedLibraries)
Common Client SharedLibraries CassandraSE)
SET(CPACK_RPM_PACKAGE_NAME "MariaDB")
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}
")
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_common_USER_FILELIST "%config(noreplace) /etc/my.cnf")
......
IF(NOT WITH_CASSANDRA_STORAGE_ENGINE)
SET(WITHOUT_CASSANDRA 1)
ENDIF(NOT WITH_CASSANDRA_STORAGE_ENGINE)
SET(cassandra_sources
ha_cassandra.cc
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)
#INCLUDE_DIRECTORIES(BEFORE ${Boost_INCLUDE_DIRS})
#INCLUDE_DIRECTORIES(AFTER /usr/local/include/thrift)
INCLUDE_DIRECTORIES(AFTER /home/buildbot/build/thrift-inst/include/thrift/)
#INCLUDE_DIRECTORIES(AFTER /home/psergey/cassandra/thrift/include/thrift/)
#
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
#LINK_DIRECTORIES(/home/psergey/cassandra/thrift/lib)
MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES thrift)
# was: STORAGE_ENGINE MANDATORY
# use the first path that has Thrift.h included, if found
FIND_PATH(Thrift_INCLUDE_DIRS Thrift.h PATHS
$ENV{THRIFT_INCLUDE} # environment variable to be used optionally
${Thrift_INCLUDE_DIR} # this may be set
/usr/local/include/thrift # list of additional directories to look from
/opt/local/include/thrift
/usr/include/thrift
/opt/include/thrift
)
# Verify that thrift linking library is found
FIND_LIBRARY(Thrift_LIBS NAMES thrift PATHS ${Thrift_LIB_PATHS} ${Thrift_LIB})
IF(EXISTS ${Thrift_LIBS})
GET_FILENAME_COMPONENT(LINK_DIR ${Thrift_LIBS} PATH ABSOLUTE)
ELSE()
RETURN()
ENDIF()
INCLUDE_DIRECTORIES(AFTER ${Thrift_INCLUDE_DIRS})
SET(CMAKE_REQUIRED_INCLUDES ${Thrift_INCLUDE_DIRS})
CHECK_CXX_SOURCE_COMPILES(
"
#include <Thrift.h>
int main() { return 0; }
" CASSANDRASE_OK)
IF(CASSANDRASE_OK)
SET(cassandra_sources
ha_cassandra.cc
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