Commit 17f6d6a3 authored by Rich Prohaska's avatar Rich Prohaska

DB-792 build tokudb backup plugin

parent 7629f479
......@@ -131,11 +131,20 @@ function parse_mysqlbuild() {
tokudb_version=${BASH_REMATCH[6]}
target_system=${BASH_REMATCH[7]}
target_arch=${BASH_REMATCH[8]}
# verify targets
if [ $target_system != $system ] ; then exitcode=1; fi
if [ $target_arch != $arch ] ; then exitcode=1; fi
# split the version string into major.minor.patch
if [[ $mysql_version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+.*) ]] ; then
mysql_version_major=${BASH_REMATCH[1]}
mysql_version_minor=${BASH_REMATCH[2]}
mysql_version_patch=${BASH_REMATCH[3]}
fi
local temp_tokudb_version=$tokudb_version
# decode enterprise
if [[ $temp_tokudb_version =~ (.*)-e$ ]] ; then
build_type=enterprise
......@@ -143,6 +152,7 @@ function parse_mysqlbuild() {
else
build_type=community
fi
# decode debug
if [[ $temp_tokudb_version =~ (.*)-debug$ ]] ; then
build_debug=1
......@@ -151,6 +161,7 @@ function parse_mysqlbuild() {
else
build_debug=0
fi
# set tag or HEAD
if [[ $temp_tokudb_version =~ ^([0-9]+)\\.([0-9]+)\\.([0-9]+) ]] ; then
git_tag=tokudb-$temp_tokudb_version
......@@ -160,6 +171,8 @@ function parse_mysqlbuild() {
if [ -z $mysql_tree ] ; then mysql_tree=$mysql_distro-$mysql_version; fi
if [ -z $jemalloc_tree ] ; then jemalloc_tree=$jemalloc_version; fi
fi
# set repository
mysql_repo=$mysql_distro
if [[ $mysql_version =~ ^([0-9]+\.[0-9]+) ]] ; then mysql_repo=$mysql_distro-${BASH_REMATCH[1]}; else exitcode=1; fi
else
......@@ -174,6 +187,15 @@ function parse_mysql() {
if [[ $mysql =~ ^(mysql|mariadb)-(.*)$ ]] ; then
mysql_distro=${BASH_REMATCH[1]}
mysql_version=${BASH_REMATCH[2]}
# split the version string into major.minor.patch
if [[ $mysql_version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+.*) ]] ; then
mysql_version_major=${BASH_REMATCH[1]}
mysql_version_minor=${BASH_REMATCH[2]}
mysql_version_patch=${BASH_REMATCH[3]}
fi
# set repository
mysql_repo=$mysql_distro
if [[ $mysql_version =~ ^([0-9]+\.[0-9]+) ]] ; then mysql_repo=$mysql_distro-${BASH_REMATCH[1]}; else exitcode=1; fi
exitcode=0
......
......@@ -103,10 +103,22 @@ fi
cd $mysql_distro-$mysql_version
if [ $? != 0 ] ; then exit 1; fi
# extract mysql version patch number only
if [[ $mysql_version_patch =~ ^([0-9]+) ]] ; then p=${BASH_REMATCH[1]}; else p=$mysql_version_patch; fi
# install the backup source
if [ ! -d toku_backup ] ; then
tokudb_backup=
if [ $mysql_version_major -eq 5 -a $mysql_version_minor -eq 5 -a $p -le 40 ] ; then
tokudb_backup=patch
github_download Tokutek/backup-$build_type $(git_tree $git_tag $backup_tree) backup-$build_type
cp -r backup-$build_type/backup toku_backup
elif [ $build_type = enterprise ] ; then
tokudb_backup=plugin
github_download Tokutek/tokudb-backup-plugin $(git_tree $git_tag $backup_tree) tokudb-backup-plugin
mv tokudb-backup-plugin plugin
github_download Tokutek/backup-enterprise $(git_tree $git_tag $backup_tree) backup-enterprise
mv backup-enterprise/backup plugin/tokudb-backup-plugin
rm -rf backup-enterprise
fi
if [ ! -d tokudb-engine ] ; then
......@@ -123,6 +135,11 @@ if [ ! -d tokudb-engine ] ; then
# install the tokudb scripts
cp -r tokudb-engine/scripts/* scripts/
# link hot backup into mysqld
if [ "$tokudb_backup" != "patch" ] ; then
sed -i -e's/${JEMALLOC_LIBRARY}/${HOT_BACKUP_LIBS} ${JEMALLOC_LIBRARY}/' sql/CMakeLists.txt
fi
fi
if [ ! -d storage/tokudb/ft-index ] ; then
......@@ -153,6 +170,7 @@ function generate_cmake_cmd () {
echo -n CC=$cc CXX=$cxx cmake \
-D BUILD_CONFIG=mysql_release \
-D MYSQL_MAINTAINER_MODE=OFF \
-D CMAKE_BUILD_TYPE=$cmake_build_type \
-D CMAKE_TOKUDB_REVISION=$ft_revision \
-D TOKUDB_VERSION=tokudb-${tokudb_version} \
......
......@@ -55,7 +55,7 @@ function github_clone() {
git_tag=
mysql=mysql-5.5
mysql_tree=mysql-5.5.35
mysql_tree=mysql-5.5.41
jemalloc=jemalloc
jemalloc_tree=3.6.0
tokudbengine=tokudb-engine
......@@ -148,13 +148,15 @@ fi
pushd $build_dir
if [ $? != 0 ] ; then exit 1; fi
extra_cmake_options="-DCMAKE_LINK_DEPENDS_NO_SHARED=ON"
extra_cmake_options+=" -DBUILD_TESTING=OFF"
extra_cmake_options+=" -DMYSQL_MAINTAINER_MODE=OFF"
if (( $cmake_valgrind )) ; then
extra_cmake_options+=" -DUSE_VALGRIND=ON"
fi
if (( $cmake_debug_paranoid )) ; then
extra_cmake_options+=" -DTOKU_DEBUG_PARANOID=ON"
fi
CC=$cc CXX=$cxx cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$install_dir -DBUILD_TESTING=OFF $extra_cmake_options ../$mysql_tree
CC=$cc CXX=$cxx cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$install_dir $extra_cmake_options ../$mysql_tree
if [ $? != 0 ] ; then exit 1; fi
make -j4 install
if [ $? != 0 ] ; then exit 1; fi
......
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