星期五, 十一月 24, 2006

text web browser: w3m

text web browsers 有 lynx, links, elinks 和 w3m 等,但 lynx 比较晦涩,links 和 elinks 对中文的支持都不太好,所以使用 w3m。
首先要安装 gc(A garbage collector for C and C++)。以下是 userpack 的安装配置文件(profile):
# cat /usr/src/gc/.config
pkgname = "gc";
version = "6.8";
group = "gc";
user = "gc";
archive = "gc6.8.tar.gz";
command = "tar xfz gc6.8.tar.gz";
command = "cd gc6.8";
command = "./configure --prefix=/usr";
command = "make";
command = "make install";
command = "cd ..";
command = "rm -rf gc6.8";
time = "20061124 19:54:26 Fri";
这里使用 --prefix=/usr 可以避免装入 /usr/local/lib,否则下面安装 w3m 时,configure 会有问题。

然后安装 w3m。相关 profile 如下:
# cat /usr/src/w3m/.config
pkgname = "w3m";
version = "0.5.1";
group = "w3m";
user = "w3m";
archive = "w3m-0.5.1.tar.gz";
command = "tar xfz w3m-0.5.1.tar.gz";
command = "cd w3m-0.5.1";
command = "./configure --prefix=/usr --libexecdir=/usr/lib --sysconfdir=/etc";
command = "sed -i '/MAN1_JA/d' Makefile";
command = "make";
command = "make install";
command = "install -v -D -m 644 doc/keymap.default /etc/w3m/keymap";
command = "install -v -D -m 644 doc/menu.default /etc/w3m/menu";
command = "install -v -d -m 755 /usr/share/doc/w3m-0.5.1/html";
command = "install -v -m 644 doc/{HISTORY,README*,keymap.*,menu.*} /usr/share/doc/w3m-0.5.1";
command = "install -v -m 644 doc/*.html /usr/share/doc/w3m-0.5.1/html";
command = "cd ..";
command = "rm -rf w3m-0.5.1";
time = "20061125 06:15:34 Sat";
如果 gc 没有安装到 /usr,则 make 可以使用参数 LDFLAGS=/usr/local/lib。

sed -i '/MAN1_JA/d' Makefile
当使用 userpack 进行安装时,用上面这个命令阻止 w3m 安装日文的 man 手册,因为我没有将 /usr/man/$locale 加入到 /etc/userpack.dirs。如果要加入,应该使用这个命令:
# find /usr/man -type d -maxdepth 2 >>/etc/userpack.dirs

没有评论: