{"id":221,"date":"2018-02-28T17:32:40","date_gmt":"2018-02-28T09:32:40","guid":{"rendered":"https:\/\/blog.espnlol.com\/?p=221"},"modified":"2019-03-21T22:16:39","modified_gmt":"2019-03-21T14:16:39","slug":"rpm%e5%8c%85%e5%88%b6%e4%bd%9c%e7%a5%9e%e5%99%a8fpm%e5%b7%a5%e5%85%b7%e5%8f%8arpm%e5%b7%a5%e5%85%b7%e7%ae%80%e4%bb%8b","status":"publish","type":"post","link":"https:\/\/blog.espnlol.com\/?p=221","title":{"rendered":"rpm\u5305\u5236\u4f5c\u795e\u5668FPM\u5de5\u5177\u53carpm\u5de5\u5177\u7b80\u4ecb"},"content":{"rendered":"<p>FPM\u6253\u5305\u5de5\u5177<br \/>\nFPM\u7684\u4f5c\u8005\u662fjordansissel<br \/>\nFPM\u7684github\uff1ahttps:\/\/github.com\/jordansissel\/fpm<br \/>\nFPM\u529f\u80fd\u7b80\u5355\u8bf4\u5c31\u662f\u5c06\u4e00\u79cd\u7c7b\u578b\u7684\u5305\u8f6c\u6362\u6210\u53e6\u4e00\u79cd\u7c7b\u578b\u3002<\/p>\n<p>FPM\u5b89\u88c5<br \/>\nfpm\u662fruby\u5199\u7684\uff0c\u56e0\u6b64\u7cfb\u7edf\u73af\u5883\u9700\u8981ruby\uff0c\u4e14ruby\u7248\u672c\u53f7\u5927\u4e8e1.8.5\u3002<\/p>\n<h1 id=\"\u5b89\u88c5\u524d\u7684\u51c6\u5907\">\u5b89\u88c5ruby<\/h1>\n<p>yum install curl git rpm-build\u00a0rpm-build-libs<\/p>\n<p>curl -L get.rvm.io | bash -s stable<\/p>\n<p>source \/etc\/profile.d\/rvm.sh<\/p>\n<p>rvm list known<\/p>\n<p>rvm install 2.6<\/p>\n<p># \u67e5\u770b\u5f53\u524d\u4f7f\u7528\u7684rubygems\u4ed3\u5e93<br \/>\ngem sources list<br \/>\n# \u6dfb\u52a0\u6dd8\u5b9d\u7684Rubygems\u4ed3\u5e93\uff0c\u5916\u56fd\u7684\u6e90\u6162\uff0c\u79fb\u9664\u539f\u751f\u7684Ruby\u4ed3\u5e93<br \/>\ngem sources &#8211;add https:\/\/ruby.taobao.org\/ &#8211;remove http:\/\/rubygems.org\/<br \/>\n# \u5b89\u88c5fpm\uff0cgem\u4ecerubygem\u4ed3\u5e93\u5b89\u88c5\u8f6f\u4ef6\u7c7b\u4f3cyum\u4eceyum\u4ed3\u5e93\u5b89\u88c5\u8f6f\u4ef6\u3002\u9996\u5148\u5b89\u88c5\u4f4e\u7248\u672c\u7684json\uff0c\u9ad8\u7248\u672c\u7684json\u9700\u8981ruby2.0\u4ee5\u4e0a\uff0c\u7136\u540e\u5b89\u88c5\u4f4e\u7248\u672c\u7684fpm\uff0c\u591f\u7528\u3002<br \/>\ngem install json -v 1.8.3<br \/>\ngem install fpm -v 1.3.3<br \/>\n# \u4e0a\u9762\u76842\u6b65\u5b89\u88c5\u4ec5\u9002\u5408CentOS6\u7cfb\u7edf\uff0cCentOS7\u7cfb\u7edf\u4e00\u6b65\u641e\u5b9a\uff0c\u5373gem install fpm<\/p>\n<p>FPM\u53c2\u6570<br \/>\n-s \u6307\u5b9a\u6e90\u7c7b\u578b<br \/>\n-t \u6307\u5b9a\u76ee\u6807\u7c7b\u578b\uff0c\u5373\u60f3\u8981\u5236\u4f5c\u4e3a\u4ec0\u4e48\u5305<br \/>\n-n \u6307\u5b9a\u5305\u7684\u540d\u5b57<br \/>\n-v \u6307\u5b9a\u5305\u7684\u7248\u672c\u53f7<br \/>\n-C \u6307\u5b9a\u6253\u5305\u7684\u76f8\u5bf9\u8def\u5f84 Change directory to here before searching forfiles<br \/>\n-d \u6307\u5b9a\u4f9d\u8d56\u4e8e\u54ea\u4e9b\u5305<br \/>\n-f \u7b2c\u4e8c\u6b21\u6253\u5305\u65f6\u76ee\u5f55\u4e0b\u5982\u679c\u6709\u540c\u540d\u5b89\u88c5\u5305\u5b58\u5728\uff0c\u5219\u8986\u76d6\u5b83<br \/>\n-p \u8f93\u51fa\u7684\u5b89\u88c5\u5305\u7684\u76ee\u5f55\uff0c\u4e0d\u60f3\u653e\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u5c31\u9700\u8981\u6307\u5b9a<br \/>\n&#8211;post-install \u8f6f\u4ef6\u5305\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\u6240\u8981\u8fd0\u884c\u7684\u811a\u672c\uff1b\u540c&#8211;after-install<br \/>\n&#8211;pre-install \u8f6f\u4ef6\u5305\u5b89\u88c5\u5b8c\u6210\u4e4b\u524d\u6240\u8981\u8fd0\u884c\u7684\u811a\u672c\uff1b\u540c&#8211;before-install<br \/>\n&#8211;post-uninstall \u8f6f\u4ef6\u5305\u5378\u8f7d\u5b8c\u6210\u4e4b\u540e\u6240\u8981\u8fd0\u884c\u7684\u811a\u672c\uff1b\u540c&#8211;after-remove<br \/>\n&#8211;pre-uninstall \u8f6f\u4ef6\u5305\u5378\u8f7d\u5b8c\u6210\u4e4b\u524d\u6240\u8981\u8fd0\u884c\u7684\u811a\u672c\uff1b\u540c&#8211;before-remove<br \/>\n#\u6253\u5305\u8303\u4f8b<br \/>\nfpm -f -s dir -t rpm -n midas-php -v &#8216;7.2.2&#8217; -d &#8216;libmcrypt-devel,libxml2-devel,bzip2-devel,curl-devel,libjpeg-devel,libpng-devel,libxslt-devel,midas-imagemaick&#8217; &#8211;iteration 1.el7 -f \/home\/dhph\/servers\/php-7.2.2\/<\/p>\n<p>\u9ed8\u8ba4\u5b89\u88c5\u5728\/home\/dhph\/servers\/php-7.2.2\/<\/p>\n<p>rpm\u5de5\u5177\u7b80\u4ecb<br \/>\n1\u3001\u67e5\u8be2\u7cfb\u7edf\u5df2\u5b89\u88c5\u7684rpm\u5305<br \/>\n#rpm -qa<\/p>\n<p>\u793a\u4f8b\uff1a<br \/>\nNTP-slave:\/etc\/zypp # rpm -qa | grep zypp<br \/>\nzypper-log-1.6.307-0.7.12<br \/>\nzypper-1.6.307-0.7.12<br \/>\nlibzypp-9.34.0-0.7.15<\/p>\n<p>2\u3001\u67e5\u8be2\u7cfb\u7edf\u4e2d\u4e00\u4e2a\u5df2\u77e5\u7684\u6587\u4ef6\u5c5e\u4e8e\u54ea\u4e2arpm\u5305<br \/>\n# rpm -qf \/\u7edd\u5bf9\u8def\u5f84\/file_name<\/p>\n<p>\u793a\u4f8b\uff1a<br \/>\nNTP-slave:\/etc\/zypp # rpm -qf \/etc\/zypp\/zypp.conf<br \/>\nlibzypp-9.34.0-0.7.15<\/p>\n<p>3\u3001 \u67e5\u8be2\u5df2\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u7684\u76f8\u5173\u6587\u4ef6\u7684\u5b89\u88c5\u8def\u5f84<br \/>\n# rpm -ql \u8f6f\u4ef6\u540d<\/p>\n<p>\u793a\u4f8b\uff1a<br \/>\nNTP-slave:\/etc\/zypp # rpm -ql libzypp-9.34.0-0.7.15<br \/>\n\/etc\/logrotate.d\/zypp-history.lr<br \/>\n\/etc\/zypp<br \/>\n\/etc\/zypp\/repos.d<br \/>\n\/etc\/zypp\/services.d<br \/>\n\/etc\/zypp\/systemCheck<br \/>\n\/etc\/zypp\/zypp.conf<br \/>\n\/usr\/bin\/package-manager<br \/>\n\/usr\/bin\/package-manager-su<br \/>\n&#8230;\u7701\u7565&#8230;<\/p>\n<p>4\u3001\u67e5\u8be2\u4e00\u4e2a\u5df2\u5b89\u88c5\u8f6f\u4ef6\u5305\u7684\u4fe1\u606f<br \/>\n#rpm -qi \u8f6f\u4ef6\u540d<\/p>\n<p>\u793a\u4f8b\uff1a<br \/>\nNTP-slave:\/etc\/zypp # rpm -qi libzypp-9.34.0-0.7.15<br \/>\nName : libzypp Relocations: (not relocatable)<br \/>\nVersion : 9.34.0 Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany<br \/>\nRelease : 0.7.15 Build Date: Wed May 29 23:20:00 2013<br \/>\nInstall Date: Mon Dec 19 20:00:23 2016 Build Host: crick2<br \/>\n&#8230;\u7701\u7565&#8230;<br \/>\nNTP-slave:\/etc\/zypp # rpm -qc libzypp-9.34.0-0.7.15<br \/>\n\/etc\/logrotate.d\/zypp-history.lr<br \/>\n\/etc\/zypp\/systemCheck<br \/>\n\/etc\/zypp\/zypp.conf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FPM\u6253\u5305\u5de5\u5177 FPM\u7684\u4f5c\u8005\u662fjordansissel FPM\u7684github\uff1ah &hellip; <a href=\"https:\/\/blog.espnlol.com\/?p=221\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-221","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=\/wp\/v2\/posts\/221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=221"}],"version-history":[{"count":4,"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=\/wp\/v2\/posts\/221\/revisions"}],"predecessor-version":[{"id":342,"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=\/wp\/v2\/posts\/221\/revisions\/342"}],"wp:attachment":[{"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.espnlol.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}