RHEL6.2手動封裝rpm源碼包安裝星際譯王

星際譯王(StarDict)是利用GTK(GIMP TOOLKIT)開發的國際化的、跨平臺的自由的桌面字典軟件。自身並不包含字典,須自行下載配合使用。它可以運行於多種不同的平臺,如 Linux、Windows、FreeBSD及Solaris等,並使用GPL授權。
 
在RHEL6.2 64位系統,通過源碼包安裝,編譯時disable各種選項好不容易通過後,始終無法make成功,google後初步判斷應該是gcc4.4的bug,打了補丁也無效。最後通過編譯rpm源碼包成功安裝。
  • 下載地址:(包含rpm包和rpm源碼包,不喜歡編譯的可選擇rpm binary安裝包直接安裝)
  1. [root@rhel6 ~]# rpm -ivh stardict-3.0.1-22.puias6.src.rpm    
  2. warning: stardict-3.0.1-22.puias6.src.rpm: Header V3 RSA/SHA256 Signature, key ID 41a40948: NOKEY   
  3.    1:stardict               warning: user mockbuild does not exist - using root   
  4. warning: group mockbuild does not exist - using root   
  5. warning: user mockbuild does not exist - using root   
  6. warning: group mockbuild does not exist - using root   
  7. warning: user mockbuild does not exist - using root   
  8. warning: group mockbuild does not exist - using root   
  9. warning: user mockbuild does not exist - using root   
  10. warning: group mockbuild does not exist - using root   
  11. warning: user mockbuild does not exist - using root   
  12. warning: group mockbuild does not exist - using root   
  13. warning: user mockbuild does not exist - using root   
  14. warning: group mockbuild does not exist - using root   
  15. warning: user mockbuild does not exist - using root   
  16. warning: group mockbuild does not exist - using root   
  17. ########################################### [100%]   
  18. warning: user mockbuild does not exist - using root   
  19. warning: group mockbuild does not exist - using root   
  20. warning: user mockbuild does not exist - using root   
  21. warning: group mockbuild does not exist - using root   
  22. [root@rhel6 ~]# cd rpmbuild/SPECS  
  23.  
  24. [root@rhel6 SPECS]# cat stardict.spec | grep -v "#" | grep Requires: 
  25. Requires: enchantespeakgucharmap >= 2.22.1, libbonobo >= 2.2.0, libgnome >= 2.2.0, libgnomeui >= 2.2.0, libsigc++20 >= 2.0.17 
  26. BuildRequires: autoconf, automake, libtool 
  27. BuildRequires: desktop-file-utils, enchant-devel, gettext,  intltool, libgnomeui-devel >= 2.2.0, libsigc++20-devel, libtool, perl-XML-Parser, scrollkeeper 
  28. BuildRequires: gucharmap-devel >= 2.22.1 
  29. //從stardict.spec文件可以發現編譯過程需要以上的依賴包,所以必須先安裝好依賴包再進行編譯,其中的一些非系統自帶的依賴包在以下地址下載: 
  30. http://down.51cto.com/data/766011 
  31. [root@rhel6 SPECS]# rpm -ba stardict.spec 
  32. //若編譯時出現以上錯誤,則通過導入PGK_CONFIG的環境變量解決 
  33. [root@rhel6 SPECS]# export PGK_CONFIG=/usr/bin/pkg-config  
  34. [root@rhel6 SPECS]# rpm -ba stardict.spec  
  35. [root@rhel6 SPECS]# cd ../RPMS/x86_64/  
  36. [root@rhel6 x86_64]# ls  
  37. stardict-3.0.1-22.el6.x86_64.rpm  stardict-debuginfo-3.0.1-22.el6.x86_64.rpm  
  38. [root@rhel6 x86_64]# rpm -ivh stardict-3.0.1-22.el6.x86_64.rpm   
這時候在附件裏面已經可以啓動星際譯王了。不過現在只能聯網才能使用,以下開始添加字典:
字典可以在http://abloz.com/huzheng/stardict-dic/zh_CN/這個網站上下載你想要的其他中英詞庫或者其他你想要的詞庫。下載解壓後將其解壓在 /usr/share/stardict/dic/下即可使用
[root@rhel6 ~]# ls /usr/share/stardict/dic/
stardict-hanyuchengyucidian-2.4.2  stardict-kdic-computer-gb-2.4.2  stardict-ncce-ce-2.4.2
stardict-hycihai-2.4.2             stardict-langdao-ec-gb-2.4.2     stardict-ncce-ec-2.4.2

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章