Skip to content

Commit

Permalink
mysqlビルドできるようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
hfm committed Mar 1, 2014
1 parent 214c2b5 commit 06626db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions packer/centos-4.8-i386.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts/vagrant.sh",
"scripts/virtualbox.sh",
"scripts/package4.sh",
"scripts/mysql-build-cent4.sh",
"scripts/cleanup.sh"
],
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S bash '{{.Path}}'"
Expand Down
4 changes: 2 additions & 2 deletions packer/centos-4.8-x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"scripts/vagrant.sh",
"scripts/virtualbox.sh",
"scripts/package4.sh",
"scripts/mysql-build.sh",
"scripts/mysql-build-cent4.sh",
"scripts/cleanup.sh"
],
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E bash '{{.Path}}'"
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -S bash '{{.Path}}'"
}
],
"post-processors": [
Expand Down
16 changes: 9 additions & 7 deletions scripts/mysql-build-cent4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

set -e

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:$PATH
PATH=/usr/local/bin:/usr/bin:/sbin:/usr/sbin:$PATH

BUILD_PATH=/home/vagrant/mysql-build
MYSQL_PATH=/home/vagrant/mysql

if [ -d $BUILD_PATH ]; then
wget https://github.com/kamipo/mysql-build/archive/master.zip
unzip master.zip $BUILD_PATH
fi
echo "Use newer git"
curl -OLk "https://git-core.googlecode.com/files/git-1.9.0.tar.gz"
tar zxfv git-1.9.0.tar.gz
cd git-1.9.0
./configure && make && make install

[ -d $BUILD_PATH ] || git clone https://github.com/kamipo/mysql-build.git $BUILD_PATH
[ -d $MYSQL_PATH ] || mkdir $MYSQL_PATH

VERS=(
Expand All @@ -31,7 +34,6 @@ done
VERSs=(
5.5.36
5.6.16
5.7.3-m13
)

for ver in ${VERSs[@]}; do
Expand All @@ -42,5 +44,5 @@ for ver in ${VERSs[@]}; do
./scripts/mysql_install_db
done

rm -rf $BUILD_PATH
rm -rf $BUILD_PATH /home/vagrant/git-1.9.0 /home/vagrant/git-1.9.0.tar.gz
chown -R vagrant:vagrant $MYSQL_PATH
8 changes: 6 additions & 2 deletions scripts/package4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:$PATH

osarch=`uname -i`

# epel
curl -o /usr/share/ssl/certs/ca-bundle.crt -kL "https://www.digicert.com/testroot/DigiCertHighAssuranceEVRootCA.crt"

rpm -Uvh "http://www.sudo.ws/sudo/dist/packages/Centos/4/sudo-1.8.9-6.el4.${osarch}.rpm"

cat <<'EOT' > /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
Expand Down Expand Up @@ -53,14 +56,15 @@ rpm -ivh "http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/4/${osarch}/epel-release-
PACKAGE=(
bison
byacc
curl-devel
make
cmake
gcc-c++
git
ncurses-devel
puppet
)
yum install -y ${PACKAGE[@]}

yum update -y

yum clean all

0 comments on commit 06626db

Please sign in to comment.