{"id":19661,"date":"2024-03-26T15:42:16","date_gmt":"2024-03-26T07:42:16","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=19661"},"modified":"2024-03-26T15:42:16","modified_gmt":"2024-03-26T07:42:16","slug":"windowsrpm%e6%89%93%e5%8c%85%e5%b7%a5%e5%85%b7%e4%bd%9c%e7%94%a8%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/19661\/","title":{"rendered":"windowsrpm\u6253\u5305\u5de5\u5177\u4f5c\u7528\u4ecb\u7ecd"},"content":{"rendered":"

Windows RPM \u6253\u5305\u5de5\u5177\u662f\u4e00\u79cd\u7528\u4e8e\u6253\u5305 Windows \u8f6f\u4ef6\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5c06\u8f6f\u4ef6\u6253\u5305\u6210 RPM \u683c\u5f0f\uff0c\u65b9\u4fbf\u5728 Linux \u7cfb\u7edf\u4e0a\u8fdb\u884c\u5b89\u88c5\u548c\u7ba1\u7406\u3002\u672c\u6587\u5c06\u4ecb\u7ecd Windows RPM \u6253\u5305\u5de5\u5177\u7684\u539f\u7406\u548c\u8be6\u7ec6\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n

\u4e00\u3001\u539f\u7406<\/p>\n

RPM \u662f\u4e00\u79cd\u5728 Linux \u7cfb\u7edf\u4e0a\u7528\u4e8e\u8f6f\u4ef6\u5305\u7ba1\u7406\u7684\u6807\u51c6\u683c\u5f0f\uff0c\u5b83\u53ef\u4ee5\u5c06\u8f6f\u4ef6\u4ee5\u4e00\u79cd\u6807\u51c6\u5316\u7684\u65b9\u5f0f\u6253\u5305\uff0c\u65b9\u4fbf\u5728 Linux \u7cfb\u7edf\u4e0a\u8fdb\u884c\u5b89\u88c5\u548c\u7ba1\u7406\u3002\u800c Windows RPM \u6253\u5305\u5de5\u5177\u5219\u662f\u5c06\u8fd9\u79cd\u6807\u51c6\u5316\u7684\u6253\u5305\u65b9\u5f0f\u5f15\u5165\u5230\u4e86 Windows \u7cfb\u7edf\u4e2d\u3002<\/p>\n

\u5177\u4f53\u6765\u8bf4\uff0cWindows RPM \u6253\u5305\u5de5\u5177\u4f1a\u6309\u7167 RPM \u7684\u89c4\u8303\uff0c\u5c06\u8f6f\u4ef6\u6587\u4ef6\u548c\u76f8\u5173\u7684\u5143\u6570\u636e\u6253\u5305\u6210\u4e00\u4e2a RPM \u6587\u4ef6\u3002\u5176\u4e2d\uff0c\u5143\u6570\u636e\u5305\u62ec\u8f6f\u4ef6\u7684\u540d\u79f0\u3001\u7248\u672c\u3001\u4f9d\u8d56\u5173\u7cfb\u7b49\u4fe1\u606f\u3002\u5728\u6253\u5305\u5b8c\u6210\u540e\uff0c\u7528\u6237\u53ef\u4ee5\u5c06 RPM \u6587\u4ef6\u4e0a\u4f20\u5230 Linux \u7cfb\u7edf\u4e0a\uff0c\u4f7f\u7528 RPM \u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5\u548c\u7ba1\u7406\u3002<\/p>\n

\u4e8c\u3001\u4f7f\u7528\u65b9\u6cd5<\/p>\n

\u4e0b\u9762\u4ecb\u7ecd Windows RPM \u6253\u5305\u5de5\u5177\u7684\u8be6\u7ec6\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n

1. \u5b89\u88c5 Windows RPM \u6253\u5305\u5de5\u5177<\/p>\n

\u9996\u5148\u9700\u8981\u5728 Windows \u7cfb\u7edf\u4e0a\u5b89\u88c5 Windows RPM \u6253\u5305\u5de5\u5177\uff0c\u5e38\u7528\u7684\u5de5\u5177\u6709 Cygwin \u548c MinGW\u3002\u8fd9\u91cc\u4ee5 Cygwin \u4e3a\u4f8b\u8fdb\u884c\u4ecb\u7ecd\u3002<\/p>\n

\u5728 Cygwin \u7684\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u9009\u62e9\u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177\u548c\u7f16\u8bd1\u5668\uff0c\u4f8b\u5982 gcc\u3001make\u3001rpm \u7b49\u3002<\/p>\n

2. \u51c6\u5907\u6253\u5305\u6587\u4ef6<\/p>\n

\u5728\u8fdb\u884c\u6253\u5305\u524d\uff0c\u9700\u8981\u51c6\u5907\u597d\u9700\u8981\u6253\u5305\u7684\u6587\u4ef6\u548c\u76f8\u5173\u7684\u5143\u6570\u636e\u3002\u5176\u4e2d\uff0c\u5143\u6570\u636e\u5305\u62ec\u8f6f\u4ef6\u7684\u540d\u79f0\u3001\u7248\u672c\u3001\u4f9d\u8d56\u5173\u7cfb\u7b49\u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u4e00\u4e2a spec \u6587\u4ef6\u8fdb\u884c\u5b9a\u4e49\u3002<\/p>\n

spec \u6587\u4ef6\u662f RPM \u6253\u5305\u5de5\u5177\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5b83\u5305\u542b\u4e86\u8f6f\u4ef6\u7684\u5143\u6570\u636e\u548c\u76f8\u5173\u7684\u6253\u5305\u89c4\u5219\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684 spec \u6587\u4ef6\u793a\u4f8b\uff1a<\/p>\n

Name: myapp<\/p>\n

Version: 1.0<\/p>\n

Release: 1<\/p>\n

Summary: My Application<\/p>\n

License: GPL<\/p>\n

URL: http:\/\/www.example.com\/myapp\/<\/p>\n

Source0: myapp-1.0.tar.gz<\/p>\n

%description<\/p>\n

My Application is a simple application that does something.<\/p>\n

%prep<\/p>\n

%setup -q<\/p>\n

%build<\/p>\n

.\/configure<\/p>\n

make<\/p>\n

%install<\/p>\n

mak<\/p>\n

<\/figure>\n<\/p>\n

e install DESTDIR=%{buildroot}<\/p>\n

%clean<\/p>\n

rm -rf %{buildroot}<\/p>\n

%files<\/p>\n

%defattr(-,root,root)<\/p>\n

\/usr\/local\/bin\/myapp<\/p>\n

\u5728\u8fd9\u4e2a spec \u6587\u4ef6\u4e2d\uff0c\u5b9a\u4e49\u4e86\u8f6f\u4ef6\u7684\u540d\u79f0\u3001\u7248\u672c\u3001\u8bb8\u53ef\u8bc1\u3001\u4e0b\u8f7d\u5730\u5740\u7b49\u4fe1\u606f\uff0c\u4ee5\u53ca\u8f6f\u4ef6\u7684\u7f16\u8bd1\u548c\u5b89\u88c5\u89c4\u5219\u3002<\/p>\n

3. \u8fdb\u884c\u6253\u5305<\/p>\n

\u5728\u51c6\u5907\u597d\u8f6f\u4ef6\u6587\u4ef6\u548c spec \u6587\u4ef6\u540e\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528\u5f00\u53d1\u5e94\u7528\u548c\u5e94\u7528\u5f00\u53d1<\/a> rpmbuild \u5de5\u5177\u8fdb\u884c\u6253\u5305\u4e86\u3002\u5728 Cygwin \u7ec8\u7aef\u4e2d\uff0c\u8fdb\u5165\u5230\u8f6f\u4ef6\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u6253\u5305\uff1a<\/p>\n

rpmbuild -bb myapp.spec<\/p>\n

\u5176\u4e2d\uff0c-bb \u53c2\u6570\u8868\u793a\u8fdb\u884c\u4e8c\u8fdb\u5236\u6253\u5305\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 -bs \u8fdb\u884c\u6e90\u7801\u6253\u5305\u3002\u6253\u5305\u5b8c\u6210\u540e\uff0c\u4f1a\u5728 \/usr\/src\/redhat\/RPMS \u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a RPM \u6587\u4ef6\u3002<\/p>\n

4. \u5728 Linux \u7cfb\u7edf\u4e0a\u5b89\u88c5<\/p>\n

\u5c06\u751f\u6210\u7684 RPM \u6587\u4ef6\u4e0a\u4f20\u5230 html5\u5982\u4f55\u6253\u5305\u6210exe<\/a>Linux \u7cfb\u7edf\u4e0a\uff0c\u4f7f\u7528 RPM \u5305\u7ba1\u7406\u5668\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n

rpm -ivh myapp-1.0-1.i386.rpm<\/p>\n

\u5176\u4e2d\uff0c-i \u8868\u793a\u8fdb\u884c\u5b89\u88c5\uff0c-v \u8868\u793a\u663e\u793a\u8be6\u7ec6\u4fe1\u606f\uff0c-h \u8868\u793a\u663e\u793a\u5b89\u88c5\u8fdb\u5ea6\u3002<\/p>\n

5. \u5378\u8f7d\u8f6f\u4ef6<\/p>\n

\u5982\u679c\u9700\u8981\u5378\u8f7d\u8f6f\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

rpm -e myapp<\/p>\n

\u5176\u4e2d\uff0c-e \u8868\u793a\u8fdb\u884c\u5378\u8f7d\u3002<\/p>\n

\u603b\u7ed3<\/p>\n

Windows RPM \u6253\u5305\u5de5\u5177\u662f\u4e00\u79cd\u65b9\u4fbf\u5728 Linux \u7cfb\u7edf\u4e0a\u8fdb\u884c\u8f6f\u4ef6\u7ba1\u7406\u7684\u5de5\u5177\uff0c\u5b83\u5c06\u8f6f\u4ef6\u6253\u5305\u6210 RPM \u683c\u5f0f\uff0c\u5e76\u5305\u542b\u4e86\u8f6f\u4ef6\u7684\u5143\u6570\u636e\u548c\u76f8\u5173\u7684\u6253\u5305\u89c4\u5219\u3002\u901a\u8fc7\u4f7f\u7528 Windows RPM \u6253\u5305\u5de5\u5177\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u5728 Windows \u7cfb\u7edf\u4e0a\u8fdb\u884c\u8f6f\u4ef6\u6253\u5305\uff0c\u7136\u540e\u5728 Linux \u7cfb\u7edf\u4e0a\u8fdb\u884c\u5b89\u88c5\u548c\u7ba1\u7406\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Windows RPM \u6253\u5305\u5de5\u5177\u662f\u4e00\u79cd\u7528\u4e8e\u6253\u5305 Windows \u8f6f\u4ef6\u7684\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5c06\u8f6f\u4ef6\u6253\u5305\u6210 RPM \u683c\u5f0f\uff0c\u65b9\u4fbf\u5728 Linux \u7cfb\u7edf\u4e0a\u8fdb\u884c\u5b89\u88c5\u548c\u7ba1\u7406\u3002\u672c\u6587\u5c06\u4ecb\u7ecd Windows RPM \u6253\u5305\u5de5\u5177\u7684<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[52,16,3529,6557,135],"topic":[],"class_list":["post-19661","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-52","tag-16","tag-3529","tag-6557","tag-135"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=19661"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19661\/revisions"}],"predecessor-version":[{"id":19785,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/19661\/revisions\/19785"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=19661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=19661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=19661"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=19661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}