xtrabackup_build.patch 3.76 KB
Newer Older
1 2 3 4
diff -ur xtrabackup-1.6.2.orig/Makefile xtrabackup-1.6.2/Makefile
--- xtrabackup-1.6.2.orig/Makefile	2011-07-19 05:16:22.000000000 +0900
+++ xtrabackup-1.6.2/Makefile	2011-07-27 17:58:38.108925111 +0900
@@ -137,5 +137,5 @@
5 6 7 8 9 10
 clean:
 	rm -f *.o xtrabackup_* 
 install:
-	install -m 755 innobackupex-1.5.1 $(BIN_DIR)
+	install -m 755 innobackupex-1.5.1 $(BIN_DIR)/innobackupex
 	install -m 755 xtrabackup_*  $(BIN_DIR)
11 12 13 14
diff -ur xtrabackup-1.6.2.orig/utils/build.sh xtrabackup-1.6.2/utils/build.sh
--- xtrabackup-1.6.2.orig/utils/build.sh	2011-07-19 05:16:22.000000000 +0900
+++ xtrabackup-1.6.2/utils/build.sh	2011-07-27 18:01:53.809212142 +0900
@@ -21,12 +21,14 @@
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
 {
     echo "Build an xtrabackup binary against the specified InnoDB flavor."
     echo
-    echo "Usage: `basename $0` CODEBASE"
+    echo "Usage: `basename $0` CODEBASE PREFIX LIBTOOL_LOCATION"
     echo "where CODEBASE can be one of the following values or aliases:"
     echo "  innodb51_builtin | 5.1	build against built-in InnoDB in MySQL 5.1"
     echo "  innodb55         | 5.5	build against InnoDB in MySQL 5.5"
     echo "  xtradb51         | xtradb   build against Percona Server with XtraDB 5.1"
     echo "  xtradb55         | xtradb55 build against Percona Server with XtraDB 5.5"
+    echo "where PREFIX is abolute path for install location"
+    echo "where LIBTOOL_LOCATION is abolute path of libtool"
     exit -1
 }
 
30
@@ -79,7 +81,12 @@
31 32 33 34 35 36 37 38 39 40 41 42 43
 {
     echo "Configuring the server"
     cd $server_dir
-    BUILD/autorun.sh
+    libtoolize -c -f
+    aclocal -I $libtool_location/share/aclocal -I config/ac-macros
+    autoheader
+    automake -c -a -f
+    autoconf
+    touch sql/sql_yacc.yy
     eval $configure_cmd
 
     echo "Building the server"
44
@@ -92,12 +99,13 @@
45 46 47 48 49
     echo "Building XtraBackup"
     mkdir $build_dir
     cp $top_dir/Makefile $top_dir/xtrabackup.c $build_dir
+    cp $top_dir/innobackupex $build_dir/innobackupex-1.5.1
 
50 51 52
     # Read XTRABACKUP_VERSION from the VERSION file
     . $top_dir/VERSION
 
53
     cd $build_dir
54 55
-    $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION
+    $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION PREFIX=$1
56 57 58
     cd $top_dir
 }
 
59
@@ -106,11 +114,36 @@
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
     echo "Building tar4ibd"
     unpack_and_patch libtar-1.2.11.tar.gz tar4ibd_libtar-1.2.11.patch
     cd libtar-1.2.11
-    ./configure
+    ./configure --prefix=$1
     $MAKE_CMD
     cd $topdir
 }
 
+function install_server()
+{
+    echo "Installing the server"
+    cd $server_dir
+    $MAKE_CMD install
+    cd $top_dir
+}
+
+function install_xtrabackup()
+{
+    echo "Installing XtraBackup"
+    echo $build_dir
+    cd $build_dir
+    $MAKE_CMD PREFIX=$1 install
+    cd $top_dir
+}
+
+function install_tar4ibd()
+{
+    echo "Installing tar4ibd"
+    cd libtar-1.2.11
+    $MAKE_CMD install
+    cd $topdir
+}
+
 ################################################################################
 # Do all steps to build the server, xtrabackup and tar4ibd
 # Expects the following variables to be set before calling:
97
@@ -141,9 +174,15 @@
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
 
     build_server
 
-    build_xtrabackup
+    build_xtrabackup $1
+
+    build_tar4ibd $1
+
+    install_server
+
+    install_xtrabackup $1
 
-    build_tar4ibd
+    install_tar4ibd
 }
 
 if ! test -f xtrabackup.c
115
@@ -153,6 +192,15 @@
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
 fi
 
 type=$1
+prefix=$2
+if [ "x$prefix" == "x" ] ; then
+  usage
+fi
+libtool_location=$3
+if [ "x$libtool_location" == "x" ] ; then
+  usage
+fi
+
 top_dir=`pwd`
 
 case "$type" in
131
@@ -166,9 +214,10 @@
132 133 134
 	    --with-plugins=innobase \
 	    --with-zlib-dir=bundled \
 	    --enable-shared \
135 136 137
-	    --with-extra-charsets=all"
+	    --with-extra-charsets=all \
+	    --prefix=$2"
138 139 140 141 142 143
 
-	build_all
+	build_all $2
 	;;
 
 "innodb55" | "5.5")
144
@@ -230,7 +279,7 @@
145 146 147 148 149 150 151 152
 
 	build_server
 
-	build_xtrabackup
+	build_xtrabackup 
 
 	build_tar4ibd
 	;;