さくらの VPS に登録してみた(4) checkinstall, vim, zsh

CentOS 5.5 だと vim のバージョンが古いんですね。

$ vi --version
VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 19 2009 17:22:08)
Included patches: 1, 3-4, 7-9, 11, 13-17, 19-26, 29-31, 34-44, 47, 50-56, 58-64, 66-73, 75, 77-92, 94-107, 109, 202, 234-237
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path
+folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist
 +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu
+mksession +modify_fname +mouse -mouseshape +mouse_dec +mouse_gpm
-mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme
-netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile
+python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static
-tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2    -D_REENTRANT -D_GNU_SOURCE  -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm  -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE  -I/usr/include/python2.4 -pthread
Linking: gcc   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE   -L/usr/local/lib -o vim       -lncurses  -lselinux  -lacl -lgpm   -Wl,-E -Wl,-rpath,/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE  /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/auto/DynaLoader/DynaLoader.a -L/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE -lperl -lresolv -lutil -lc -L/usr/lib64/python2.4/config -lpython2.4 -lutil -lm -Xlinker -export-dynamic
  • バージョン 7.0 なので 7.1 以降を対象にしたプラグインが使えない
  • Features が -rubyruby サポートしていない

と、このまま使うのが無理な感じに微妙なのです。

なのでソースから入れることになるんですが、パッケージ管理は捨てたくないのでまず checkinstall を入れることにします。といっても checkinstallCentOSリポジトリに無いのでこちらもソースから。

ソースを落としてきて

$ cd /usr/local/src
$ sudo git clone http://checkinstall.izto.org/checkinstall.git
$ sudo chown -R mayu:mayu checkinstall
$ cd checkinstall

普通に make, make install

$ make
$ sudo make install

/usr/local/sbin に入るので、まずは checkinstall 自身を rpm 化。

$ sudo /usr/local/sbin/checkinstall

聞かれる通りに答えていくと rpm ファイルができ上がるので、rpm でインストール。

$ sudo rpm -ivh /usr/src/redhat/RPMS/x86_64/checkinstall-20100916-1.x86_64.rpm

ちゃんと入ったかな?

$ yum info checkinstall
Loaded plugins: fastestmirror
Installed Packages
Name       : checkinstall
Arch       : x86_64
Version    : 20100916
Release    : 1
Size       : 94 k
Repo       : installed
Summary    : CheckInstall installations tracker, version 1.6.2
License    : GPL
Description: CheckInstall installations tracker, version 1.6.2
           :
           : CheckInstall  keeps  track of all the files created  or
           : modified  by your installation  script  ("make install"
           : "make install_modules",  "setup",   etc),   builds    a
           : standard   binary   package and  installs  it  in  your
           : system giving you the ability to uninstall it with your
           : distribution's  standard package management  utilities.

はい、よくできました!

vim

まずソースを持ってきます。download : vim online によると Mercurial をオススメされているのかな?そのまま従います。

$ sudo yum install mercurial
$ cd /usr/local/src
$ sudo hg clone https://vim.googlecode.com/hg/ vim
$ sudo chown -R mayu:mayu vim

ruby を有効にして make, checkinstall

$ cd vim
$ ./configure --enable-multibyte --with-features=huge --enable-rubyinterp --disable-selinux
$ make
$ sudo /usr/local/sbin/checkinstall
$ sudo rpm -ivh /usr/src/redhat/RPMS/x86_64/vim-20100916-1.x86_64.rpm

ちゃんと入ったかな?

vim --version | grep ruby
-python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent

OK!

LANG

続いて .vimrc を編集しようとして日本語が通らないことに気づきました……。

$ echo $LANG
C

きゃーw /etc/sysconfig/i18n に書き込んでおきます。

sudo vi /etc/sysconfig/i18n
LANG=ja_JP.UTF-8

zsh

zsh も 4.2.6 と古いのでこちらもソースから。……そろそろ CentOS を使い続けるのに限界感じてきました。

$ sudo wget http://downloads.sourceforge.net/project/zsh/zsh-dev/4.3.10/zsh-4.3.10.tar.bz2
$ sudo tar jxf zsh-4.3.10.tar.bz2
$ sudo chown mayu:mayu zsh-4.3.10
$ cd zsh-4.3.10
$ ./configure
$ make
$ sudo /usr/local/sbin/checkinstall
$ sudo rpm -ivh /usr/src/redhat/RPMS/x86_64/zsh-4.3.10-1.x86_64.rpm

zshvim さえあればなんとかなりますね。これで大体いつもの作業環境が整ったので、今日はここまで(>_<)