电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

RPM打包stepbystepVIP免费

RPM打包stepbystep_第1页
1/14
RPM打包stepbystep_第2页
2/14
RPM打包stepbystep_第3页
3/14
最近学习rpm打包,参考ibm文档库里rpm打包的文章,结合自己的实践,总结如下,一来备忘,二来和大家交流。 和deb打包不同,rpm打包需要特定的目录及结构。查看 rpm打包目录,以下为在 CentOS5.5下的输出结果: $ rpm --showrc|grep _topdir -14: _builddir %{_topdir}/BUILD -14: _rpmdir %{_topdir}/RPMS -14: _sourcedir %{_topdir}/SOURCES -14: _specdir %{_topdir}/SPECS -14: _srcrpmdir %{_topdir}/SRPMS -14: _topdir %{_usrsrc}/redhat $ rpm --showrc|grep _usrsrc -14: _topdir %{_usrsrc}/redhat -14: _usrsrc %{_usr}/src $ rpm --showrc|grep _usr -14: _defaultdocdir %{_usr}/share/doc -14: _topdir %{_usrsrc}/redhat -14: _usr /usr -14: _usrsrc %{_usr}/src 经过层层寻找,最终发现打包目录在/usr/src/redhat目录下,看看目录结构: $ tree /usr/src/redhat /usr/src/redhat |-- BUILD |-- RPMS | |-- athlon | |-- geode | |-- i386 | |-- i486 | |-- i586 | |-- i686 | `-- noarch |-- SOURCES |-- SPECS `-- SRPMS 其中BUILD存放编译生成的临时文件,RPMS存放根据各种构架生成的rpm包,SOURCES存放源码包,SPECS存放spec文件,SRPMS存放生成的SRPM包。 最简单例子 下面以 hello world为例,构建一个最小化打包过程。 首先需要写一个 SPEC文件hello.spce: Summary: hello world rpm package Name: hello Version: 0.1 Release: 1 Source: hello-0.1.tar.gz License: GPL Packager: amoblin Group: Application URL: http://www.ossxp.com %description This is a software for making your life more beautiful! %prep %setup -q %build gcc -o hello hello.c %install install -m 755 hello /usr/local/bin/hello %files /usr/local/bin/hello 放到上述SPECS目录下。 然后一个源程序 hello.c: #include int main() { printf("Hello, World! \n"); return 0; } 存放在hello-0.1目录,然后打包放到SOURCES目录: $ tar zcvf hello-0.1.tar.gz hello-0.1 hello-0.1/ hello-0.1/hello.c $ sudo mv hello-0.1.tar.gz /usr/src/redhat/SOURCES 在SPECS目录下使用rpmbuild进行打包: $ cd /usr/src/redhat $ sudo rpmbuild -ba...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

RPM打包stepbystep

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部