CentOS5.3でGOの開発環境構築メモ

rootユーザで

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
yum -y install bison gcc libc6-dev ed python-devel mercurial
useradd gouser

su - gouser
hg clone -r release https://go.googlecode.com/hg/ $GOROOT

cat >> ~/.bashrc <<EOF
export GOROOT=$HOME/hg
export GOOS=linux
export GOARCH=386
export GOBIN=$HOME/hg/bin
PATH=$PATH:$GOBIN
EOF
source ~/.bashrc
mkdir $GOBIN
cd $GOROOT/src/
./all.bash
mkdir -p $HOME/.vim/syntax
cp $GOROOT/misc/vim/go.vim $HOME/.vim/syntax/
cat >> $HOME/.vim/filetype.vim << EOF
au BufRead,BufNewFile *.go set filetype=go
EOF