vim7.3をソースからインストール

私の知らない間に、vim7.3がリリースされていましたのでCentOSにインストールしました。

 
cd /usr/local/src/
wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2
tar jxvf vim-7.3.tar.bz2
./configure --enable-multibyte

ここでまさかのエラー・・・

checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
ncursesが必要なので、

yum install ncurses-devel
これで、再挑戦!!

./configure --enable-multibyte
make
今度はmakeでコケた・・
三分位悩んで、--disable-selinuxを追加したら通った!!!

./configure --enable-multibyte --disable-selinux
make
make install
これでインストール終了。

PostgreSQLの起動スクリプト

起動スクリプトを書いたことが無かったので、PostgreSQLの起動スクリプト書いてみた。



#!/bin/bash

start(){
su - postgres -c 'pg_ctl -w start'
echo starting postgresql
sleep 1
echo
}

stop(){
su - postgres -c 'pg_ctl stop'
echo postgresql stop
}

case "$1" in
start)
start
;;
stop)
stop
;;

*)

echo $"Usage:$0{start|stop}"
exit 1
esac

exit 0

ブログはじめました!

Linuxとかプログラム言語関連のことを書いていきます。
早速ですが、Fedora13にPostgrSQLをソースからインストールするシェルスクリプトを作成してみました。



#!/bin/bash

cd /usr/local/src/
wget ftp://ftp2.jp.postgresql.org/pub/postgresql/source/v8.4.4/postgresql-8.4.4.tar.gz
tar zvxf postgresql-8.4.4.tar.gz
cd ./postgresql-8.4.4
./configure --enable-multibyte=UTF8
gmake
gmake install
useradd postgres
mkdir /usr/local/pgsql/data
chown postgres:postgres -R /usr/local/pgsql
su - postgres -c 'echo export PATH="$PATH":/usr/local/pgsql/bin >> ~/.bashrc'
su - postgres -c 'echo export POSTGRES_HOME=/usr/local/pgsql >> ~/.bashrc'
su - postgres -c 'echo export PGLIB=$POSTGRES_HOME/lib >> ~/.bashrc'
su - postgres -c 'echo export PGDATA=$POSTGRES_HOME/data >> ~/.bashrc'
su - postgres -c 'echo export MANPATH="$MANPATH":$POSTGRES_HOME/man >> ~/.bashrc'
su - postgres -c 'echo export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"$PGLIB" >> ~/.bashrc'
su - postgres -c 'source ~/.bashrc'
su - postgres -c 'initdb --encoding=UTF8'
su - postgres -c 'pg_ctl -w start'

こんな感じですかね。