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