PROJECT_MOVED -> https://lab.nexedi.com/nexedi/slapos
[slapos.git] / component / xtrabackup / xtrabackup-1.6.2_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,11 @@
31  {
32      echo "Configuring the server"
33      cd $server_dir
34 -    BUILD/autorun.sh
35 +    aclocal -I $libtool_location/share/aclocal -I config/ac-macros || die "Can't execute aclocal"
36 +    autoheader || die "Can't execute autoheader"
37 +    libtoolize --automake --force --copy || die "Can't execute libtoolize"
38 +    automake --add-missing --force  --copy || die "Can't execute automake"
39 +    autoconf || die "Can't execute autoconf"
40      eval $configure_cmd
41  
42      echo "Building the server"
43 @@ -92,12 +99,13 @@
44      echo "Building XtraBackup"
45      mkdir $build_dir
46      cp $top_dir/Makefile $top_dir/xtrabackup.c $build_dir
47 +    cp $top_dir/innobackupex $build_dir/innobackupex-1.5.1
48  
49      # Read XTRABACKUP_VERSION from the VERSION file
50      . $top_dir/VERSION
51  
52      cd $build_dir
53 -    $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION
54 +    $MAKE_CMD $xtrabackup_target XTRABACKUP_VERSION=$XTRABACKUP_VERSION PREFIX=$1
55      cd $top_dir
56  }
57  
58 @@ -106,11 +114,36 @@
59      echo "Building tar4ibd"
60      unpack_and_patch libtar-1.2.11.tar.gz tar4ibd_libtar-1.2.11.patch
61      cd libtar-1.2.11
62 -    ./configure
63 +    ./configure --prefix=$1
64      $MAKE_CMD
65      cd $topdir
66  }
67  
68 +function install_server()
69 +{
70 +    echo "Installing the server"
71 +    cd $server_dir
72 +    $MAKE_CMD install
73 +    cd $top_dir
74 +}
75 +
76 +function install_xtrabackup()
77 +{
78 +    echo "Installing XtraBackup"
79 +    echo $build_dir
80 +    cd $build_dir
81 +    $MAKE_CMD PREFIX=$1 install
82 +    cd $top_dir
83 +}
84 +
85 +function install_tar4ibd()
86 +{
87 +    echo "Installing tar4ibd"
88 +    cd libtar-1.2.11
89 +    $MAKE_CMD install
90 +    cd $topdir
91 +}
92 +
93  ################################################################################
94  # Do all steps to build the server, xtrabackup and tar4ibd
95  # Expects the following variables to be set before calling:
96 @@ -141,9 +174,15 @@
97  
98      build_server
99  
100 -    build_xtrabackup
101 +    build_xtrabackup $1
102 +
103 +    build_tar4ibd $1
104 +
105 +    install_server
106 +
107 +    install_xtrabackup $1
108  
109 -    build_tar4ibd
110 +    install_tar4ibd
111  }
112  
113  if ! test -f xtrabackup.c
114 @@ -153,6 +192,15 @@
115  fi
116  
117  type=$1
118 +prefix=$2
119 +if [ "x$prefix" == "x" ] ; then
120 +  usage
121 +fi
122 +libtool_location=$3
123 +if [ "x$libtool_location" == "x" ] ; then
124 +  usage
125 +fi
126 +
127  top_dir=`pwd`
128  
129  case "$type" in
130 @@ -166,9 +214,10 @@
131             --with-plugins=innobase \
132             --with-zlib-dir=bundled \
133             --enable-shared \
134 -           --with-extra-charsets=all"
135 +           --with-extra-charsets=all \
136 +           --prefix=$2"
137  
138 -       build_all
139 +       build_all $2
140         ;;
141  
142  "innodb55" | "5.5")