Skip to content

Instantly share code, notes, and snippets.

@xaicron
Created May 6, 2013 11:09
Show Gist options
  • Save xaicron/5524548 to your computer and use it in GitHub Desktop.
Save xaicron/5524548 to your computer and use it in GitHub Desktop.
#!/usr/bin/env zsh
set -e
MYSQL_VERSION=5.1.69
MYSQL_BASEDIR=$HOME/.mysqlenv/mysqls/${MYSQL_VERSION}
MYSQL_SRCDIR=$HOME/.mysqlenv/mysql-build/build/mysql-${MYSQL_VERSION}
Q4M_VERSION=0.9.9
if [ ! -d ~/tmp ]; then
mkdir ~/tmp
fi
### Q4M
echo -e "\e[1;32mStarting Q4M installation.\e[m"
cd ~/tmp
curl -O http://q4m.kazuhooku.com/dist/q4m-${Q4M_VERSION}.tar.gz
tar zxfv q4m-${Q4M_VERSION}.tar.gz
cd q4m-${Q4M_VERSION}
./configure --with-mysql=${MYSQL_SRCDIR} --prefix=${MYSQL_BASEDIR}
make && make install
mysql -u root < support-files/install.sql
mysql -u root -e 'show plugins'
### HS
echo -e "\e[1;32mStarting HandlerSocket installation.\e[m"
cd ~/tmp
if [ ! -d "HandlerSocket-Plugin-for-MySQL" ]; then
git clone git://github.com/DeNA/HandlerSocket-Plugin-for-MySQL.git
fi
cd HandlerSocket-Plugin-for-MySQL
git pull origin master
./autogen.sh
./configure --with-mysql-source=${MYSQL_SRCDIR} --with-mysql-bindir=${MYSQL_BASEDIR}/bin
make && make install
mysql -u root -e "install plugin handlersocket soname 'handlersocket.so'"
cd perl-Net-HandlerSocket
curl -fsSL http://xrl.us/cpanm | perl - .
### finish
mysql -uroot -e 'show plugins'
echo -e "\e[1;32mdone.\e[m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment