学习 linux ,就不可避免要使用 man 帮助文档,但里面是英文,阅读起来很吃力,于是就想汉化一下,下载最新版 2021-10-27 v1.6.3.6.tar.gz/ 发现里面没有 configure;于是找教程,网上写的太敷衍,各种坑折腾了三个小时才装好。
目录
3.2、由 configure.ac 生成 configure
1、源文件下载
2021-10-27 最新版 man-pages-zh-CN
https://src.fedoraproject.org/repo/pkgs/man-pages-zh-CN/
[root@rhel8 ~]# wget https://src.fedoraproject.org/repo/pkgs/man-pages-zh-CN/v1.6.3.6.tar.gz
2、安装依赖
[root@rhel8 ~]# dnf install autoconf gcc gcc-c++ automake make git
2.1 安装 opencc
#下载代码
git clone https://github.com/BYVoid/OpenCC
# 安装文档生成 opencc使用
yum install doxygen
# 编译安装
cd OpenCC
make && make install
# 链接
ln -s /usr/lib/libopencc.so. /usr/lib64/libopencc.so.
ln -s /usr/lib/libopencc.so.1.1 /usr/lib64/libopencc.so.1.1
# 测试
[root@rhel8 ~]# opencc --version
Open Chinese Convert (OpenCC) Command Line Tool
Version: 1.1.4
2.2、安装 doxygen
dnf config-manager --set-enabled PowerTools
dnf -y install doxygen
3、编译安装 man
3.1、解压
[root@rhel8 ~]# tar xf v1.6.3.6.tar.gz
[root@rhel8 ~]# cd manpages-zh-1.6.3.6/
3.2、由 configure.ac 生成 configure
[root@rhel8 manpages-zh-1.6.3.6]# ls
AUTHORS configure.ac COPYRIGHT INSTALL NEWS README.md TODO utils
ChangeLog COPYING DOCS Makefile.am README src translation
[root@rhel8 manpages-zh-1.6.3.6]# aclocal
[root@rhel8 manpages-zh-1.6.3.6]# autoconf
[root@rhel8 manpages-zh-1.6.3.6]# autoheader
autoheader: error: AC_CONFIG_HEADERS not found in configure.ac # 忽略不管
[root@rhel8 manpages-zh-1.6.3.6]# ls
aclocal.m4 ChangeLog COPYING INSTALL README TODO
AUTHORS configure COPYRIGHT Makefile.am README.md translation
autom4te.cache configure.ac DOCS NEWS src utils
3.3、生成 Makefile.in
[root@rhel8 manpages-zh-1.6.3.6]# automake --add-missing
[root@rhel8 manpages-zh-1.6.3.6]# ls
aclocal.m4 ChangeLog COPYING INSTALL Makefile.in README TODO
AUTHORS configure COPYRIGHT install-sh missing README.md translation
autom4te.cache configure.ac DOCS Makefile.am NEWS src utils
3.4、编译安装
[root@rhel8 manpages-zh-1.6.3.6]# ./configure --disable-zhtw --prefix=/usr/local/zhman
[root@rhel8 manpages-zh-1.6.3.6]# make && make install
[root@rhel8 ~]# vim .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
alias cman='man -M /usr/local/zhman/share/man/zh_CN'
PATH=$PATH:$HOME/bin
export PATH
[root@rhel8 ~]# source .bash_profile //运行,更新bash_profile 使其生效