mac os安裝shell man中文幫助工具(manpages-zh),即man命令顯示中文幫助文檔


一、從官網http://pkgs.fedoraproject.org/repo/pkgs/man-pages-zh-CN)下載安裝包;或者從開源代碼(https://github.com/man-pages-zh/manpages-zh)網址下載

二、解壓安裝包,發現configure.ac,需要安裝autoconf和autoconf;

三、安裝autoconf和automake

  1、安裝brew:如果已經安裝brew,跳過此步驟。

    從brew官網https://brew.sh)復制安裝命令,粘貼在終端中執行:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2、安裝autoconf、automake、python3、opencc四個依賴
    brew install autoconf

    brew install automake 

    brew install python3

    brew install opencc

 

四、(1)生成manpages-zh安裝程序,並安裝

  autoscan .  //在當前文件夾中搜索  

  vi configure.ac //編輯文件  

  1.     編輯configure.ac,加入下面一行:  
  2.     AM_INIT_AUTOMAKE(hello,1.0)      //automake所必備的宏,必須添加  

  aclocal     //執行aclocal生成aclocal.m4文件  

  autoconf   //執行autoconf生成configure文件  

  autoheader  

  automake --add-missing  

  touch NEWS; touch README; touch AUTHORS; touch ChangeLog    //創建NEWS等文件,如果沒有自動生成,手工創建  

  automake --add-missing //再運行一次  

  ./configure    //配置,生成Makefile文件  

  make     //執行make命令  

  sudo make install

  ./configure --prefix=/usr/local/zhman --disable-zhtw   //最后執行./configure加上一些參數,確保設置簡體中文成功

 

四、(2)

官網https://github.com/man-pages-zh/manpages-zh)安裝方法(我未試過)

  一、構建依賴包括: 

    autotools (autoconf, automake)

    python3

    opencc 1.x

  二、“編譯”安裝

  autoreconf --install --force   ./configure   make   sudo make install # 需要超級用戶權限

 

五、修改/etc/man.conf,將幾處/usr/local/share/man全部改為/usr/local/share/man/zh_CN

 

六、解決亂碼

  brew install groff

  打開/etc/man.conf,在文件最后加上如下代碼: 

  NROFF preconv -e UTF8 | /usr/local/bin/nroff -Tutf8 -mandoc -c

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM