#!/bin/bash
# by chuantong.huang@gmail.com 2012-08-21
mkdir tfs-2.0-build
cd tfs-2.0-build
yum install zlib -y
yum install readline-devel.x86_64 -y
#yum install ncurses-devel.x86_64 -y
#yum install pam-devel.x86_64 -y
yum install e4fsprogs-devel.x86_64 -y
if [! -f "gtest-1.5.0.zip"]; then
wget http://googletest.googlecode.com/files/gtest-1.5.0.zip
unzip gtest-1.5.0.zip
cd gtest-1.5.0
./configure
make -j 4
make install
cd ..
fi
if [! -d "tb-common-utils"]; then
svn export http://code.taobao.org/svn/tb-common-utils/trunk/ tb-common-utils
cd tb-common-utils
export TBLIB_ROOT=/usr/local/tfs-common-utils
sh build.sh
cd ..
if
#if [! -f "util-linux-2.22-rc1.tar.gz"]; then
# wget http://www.kernel.org/pub/linux/utils/util-linux/v2.22/util-linux-2.22-rc1.tar.gz
# tar -xvf util-linux-2.22-rc1.tar.gz
# cd util-linux-2.22-rc1
# ./configure
# make -j 4 && make install
# cd ..
#fi
if [! -f "mysql-5.1.65.tar.gz"]; then
wget http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.65.tar.gz
tar -xvf mysql-5.1.65.tar.gz
./configure --without-server
make -j 4 && make install
cd ..
fi
if[!-d "/usr/local/tfs-2.0"]; then
svn export http://code.taobao.org/svn/tfs/branches/stable-2.0 tfs-statble-2.0
cd tfs-statble-2.0/
sh build.sh init
./configure --prefix=/usr/local/tfs-2.0 \
--includedir=/usr/local/tfs-common-utils/include/tbsys \
--libdir=/usr/local/tfs-common-utils/lib --enable-shared \
--includedir=/usr/local/tfs-common-utils/include/tbnet \
--libdir=/usr/lib64
make -j 4 && make install
fi