centos 6.5下安裝fpm打包工具

來源:互聯網
上載者:User

標籤:fpm

FPM功能簡單說就是將一種類型的包轉換成另一種類型。

FPM的github:https://github.com/jordansissel/fpm 

1.支援的源類型包:

 dir: 將目錄打包成所需要的類型,可以用於源碼編譯安裝的軟體包

 rpm: 對rpm進行轉換

 gem: 對rubygem包進行轉換

 python: 將Python模組打包成相應的類型


2.安裝ruby環境和gem命令: 這裡我會提前把開發封裝好

fpm 是 ruby寫的,因此系統內容需要ruby,且版本必須大於1.8.5

yum -y install ruby rubygems ruby-devel

[[email protected]遊戲測試 ~]# rpm -qa | grep rubyruby-1.8.7.374-4.el6_6.x86_64ruby-rdoc-1.8.7.374-4.el6_6.x86_64ruby-devel-1.8.7.374-4.el6_6.x86_64ruby-libs-1.8.7.374-4.el6_6.x86_64ruby-irb-1.8.7.374-4.el6_6.x86_64rubygems-1.3.7-5.el6.noarch

3.查看當前ruby源:

[[email protected]遊戲測試 ~]#*** CURRENT SOURCES ***http://rubygems.org/

添加國內源:

[[email protected]遊戲測試 ~]# gem sources -a http://mirrors.aliyun.com/rubygems/


移除國外源:

[[email protected]遊戲測試 ~]#gem sources --remove http://rubygems.org/


4.安裝FPM工具:

[[email protected]遊戲測試 ~]#gem install fpm


遇到的錯誤

[[email protected]遊戲測試 ~]#gem install fpmBuilding native extensions.  This could take a while...Building native extensions.  This could take a while...ERROR:  Error installing fpm:ruby-xz requires Ruby version >= 1.9.3.


解決方案

1.更新ruby這個方法我試過了。因為更新ruby的坑比較大。所以不建議用這個方法2.安裝舊版本的fpm[[email protected]遊戲測試 ~]# gem install fpm -v 1.4.0Successfully installed clamp-0.6.5Successfully installed fpm-1.4.02 gems installedInstalling ri documentation for clamp-0.6.5...Installing ri documentation for fpm-1.4.0...Installing RDoc documentation for clamp-0.6.5...Installing RDoc documentation for fpm-1.4.0...
[[email protected]遊戲測試 ~]# gem -v1.3.7


5.FPM常用參數:

-s:指定源類型-t:指定目標類型,即想要製作為什麼包-n:指定包的名字-v:指定包的版本號碼-C:指定打包的相對路徑-d:指定依賴於哪些包-f:第二次包時目錄下如果有同名安裝包存在,則覆蓋它-p:輸出的安裝包的目錄,不想放在目前的目錄下就需要指定--post-install:軟體包安裝完成之後所要啟動並執行指令碼;同--offer-install--pre-install:軟體包安裝完成之前所要啟動並執行指令碼;同--before-install--post-uninstall:軟體包卸載完成之後所要啟動並執行指令碼;同--offer-remove--pre-uninstall:軟體包卸載完成之前所要啟動並執行指令碼;同—before-remove




本文出自 “不拋棄!不放棄” 部落格,請務必保留此出處http://thedream.blog.51cto.com/6427769/1834192

centos 6.5下安裝fpm打包工具

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.