0、CentOS8 汉化 man,由 configure.ac 生成 configure

        学习 linux ,就不可避免要使用 man 帮助文档,但里面是英文,阅读起来很吃力,于是就想汉化一下,下载最新版 2021-10-27 v1.6.3.6.tar.gz/ 发现里面没有 configure;于是找教程,网上写的太敷衍,各种坑折腾了三个小时才装好。

目录

1、源文件下载

2、安装依赖

2.1 安装 opencc

2.2、安装 doxygen

3、编译安装 man

3.1、解压

3.2、由 configure.ac 生成 configure

3.3、生成 Makefile.in

3.4、编译安装


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 使其生效

 

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

t281531576

你的鼓励是我创作的动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值