Mew が MH の代わりに利用している IM(Internet Message)は Perl で書かれています。
IM を実行するには、バージョン 5.004_04 以降の Perl が必要です。それ以前の
バージョンを利用している場合には、新しいバージョンに入れ換えてください。
現在、システムにインストールされている Perl のバージョンを確認するには、
コマンドラインオプションとして -v を指定して実行します。
% perl -v
This is perl, version 5.005_02 built for i386-freebsd
Copyright 1987-1998, Larry Wall
Japanization patch 4 by Yasushi Saito, 1996
Modified by Hirofumi Watanabe, 1996-1998
jperl5.005_02-981225
EUC version
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
FreeBSD の場合はデフォルトで Perl はインストールされています。
FreeBSD-3.x の場合は Perl のバージョンは 5.x ですが、FreeBSD-2.2.x の場合は
Perl のバージョンは 4.x なのでバージョンアップする必要があります。また、
FreeBSD では、環境変数 LANG を ja_JP.EUC にしていると、以下のような
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LC_ALL = "ja_JP.EUC",
LC_MESSAGES = "ja_JP.EUC",
LANG = "ja_JP.EUC"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale に関する警告が出る場合、環境変数 PERL_BADLANG を 0 に設定します。
FreeBSD や Linux にはバイナリパッケージが用意されているので、そちらを使うと
便利ですが、自分でコンパイルする場合は以下のようにします。
まず、Perl のソースプログラムを例えば、以下のURL
http://language.perl.com/CPAN/src/
からダウンロードし、$SRC に置きます。
次に、ダウンロードしたファイルを解凍・展開し、ディレクトリを移動します。
% cd $SRC
% tar xvfz perl5.004_04.tar.gz
% cd perl5.004_04
次に、Configure を実行します。何もオプションを付けずに実行すると、
インストールを対話的に進めることができます。
% ./Configure
RPOPを利用するには、以下の質問に y と答えます。
Do you want to do setuid/setgid emulation? [n] y
FreeBSD で locale に対する警告を出さないようにするために、libxpg4 をリンク
するには、以下の質問についてデフォルトで表示されているライブラリに
-lxpg4 を追加したものを入力して下さい。追加するには -lxpg4 を -lc より前に
指定します。
Any addition libraries? [-lgdbm -lm -lc -lcrypt] -lgdbm -lm -lxpg4 -lc -lcrypt
また、Configure に -d オプションを付けることで、Configure による質問に対して
システム構成を推測して値を自動的に入力してくれます。
% ./Configure -d
この場合、最後に
Press return or use a shell escape to edit config.sh:
と表示されて入力待ちになります。そこで、config.sh を編集する必要がある場合には
Press return or use a shell escape to edit config.sh: !vi config.sh
と入力します。
RPOPを利用する場合には suidperl が必要になります。config.sh の中に d_dosuid
で始まる行があるので、これが undef になっている場合には
d_dosuid='define'
と書き換えます。
FreeBSD で locale に関する警告を出さないようにするために libxpg4 をリンクする
場合には、config.sh の中に libs= で始まる行に -lxpg4 を追加します。
追加するには -lxpg4 を -lc より前に指定します。
libs='-lgdbm -lm -lxpg4 -lc -lcrypt'
Now you must run a make と表示されたら、
% make
% make test
% su
Password:
# make install
を実行します。以上で Perl のインストールは終了です。
IMの設定をするために、以下のようにして imsetup というコマンドを実行します。
% imsetup
Where is your home directory? [/home/sakai]
Where is your Mail directory? [/home/sakai/Mail]
/home/sakai/Mail does not exist. Create it? [yes]
Creating /home/sakai/Mail directory.
Directory /home/sakai/Mail created.
Where is your News directory? [/home/sakai/News]
/home/sakai/News does not exist. Create it? [yes]
Creating /home/sakai/News directory.
Directory /home/sakai/News created.
What is your E-mail address(es)? [sakai@eg.t.kanazawa-u.ac.jp] sakai@oak.eg.t.kanazawa-u.ac.jp
Do you want to use value of Content-Length header for delimitation for local
mail? (Answer yes if your OS supports Content-Length header like Solaris 2.x,
otherwise answer no.) [no]
Does your system can detect write errors without fsync(2)? (You can answer yes,
if your home directory is on local file system, otherwise answer no.) [no]
Directory /home/sakai/.im created.
Setup /home/sakai/.im/Config.
imsetup により、ホームディレクトリに .im というディレクトリが作成され、
~/.im/Config という IM の設定ファイルが作成されます。
次に、この ~/.im/Config ファイルを編集します。実際に編集したファイルを
ここに置いておきます。
以下に主なチェック項目を述べます。
より詳細な設定方法については、
http://www.mew.org/
にある Mew FAQ を御覧ください。
Mew のソースファイルを置いたディレクトリを $SRC とすると、
$SRC/mew-1.93/mew.dot.emacs を参考にして ~/.emacs ファイルを編集します。
ここでは、以下のような記述を追加しました。
(autoload 'mew "mew" nil t)
(autoload 'mew-read "mew" nil t)
(autoload 'mew-send "mew" nil t)
(setq load-path (cons "ELISPDIR" load-path)) # ELISPDIR は Mew の EmacsLispをインストールしたディレクトリ
(setq mew-icon-directory "ICONDIR") # ICONDIR は Mew のアイコンをインストールしたディレクトリ
(setq mew-mail-domain-list '("eg.t.kanazawa-u.ac.jp"))
(setq mew-mail-address "sakai@oak.eg.t.kanazawa-u.ac.jp")
(setq mew-use-overlay-keymap nil)
(setq mew-cc nil)
また、仮名漢字変換サーバに Canna を使用している場合、Mew の Subject: で
日本語入力が出来なくなるので、以下の記述を追加します。
(setq load-path (cons "/data/elisp/mew" load-path))
~/.emacs の記述の仕方には他にもいろいろあります。詳しくは、
http://www.mew.org/
にある Mew FAQ を御覧ください。