rpm简单制作

编程技术  /  houtizong 发布于 3年前   61

我对linux一窍不通,可前段时间由于客户需要,要求给他们一个RPM版本,本人咬牙切齿鼓捣了两天,终于应付过去(这不是本人一贯作风,以后有机会仔细研究一下linux的基本操作)。

 

RPM打包是使用的linux的rpm build工具,如果命令行中提示“rpmbuild : command not found”,那是因为系统没有安装rpm build工具,这个工具一般在安装光盘中。

下面对整个实现过程简单描述一下:

  1. 资源放置:usr/src/redhat/build 下面有多个文件
    tar.gz包放到resources下,spec文件放到specs下
  2. 然后执行打包程序

使用到的linux命令有:

  1. rpm打包: rpmbuild -ba *.spec
  2. rpm安装tar.gz文件:rpm -ivh *.tar.gz
  3. rpm卸载tar.gz文件:rpm -e * 注意:一定不要带发版号和后缀,如ISStudio-6.0.0-1.i386.rpm,要使用rpm -e ISStudio-6.0.0
  4. 移除文件:rm -rf 文件名

spec文件示例:

Summary:   The Install Package for InforSuite Studio on LinuxName:      ISStudioVersion:   6.0.0Release:   1License:   CommercialGroup:     Applications/EditorsSource:    inforsuite-studio.tar.gzBuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-rootUrl:       http://www.inforbus.comPackager:  CVICSEPrefix:    %{_prefix}Prefix:    %{_sysconfdir}%define    userpath /home/CVICSE%descriptionInforSuite Studio is one of the CVICSE's Products锛宨t provides a development environment for support CVICSE's midllewares: inforflow & inforsib, and so on.Beside, we also provide some excellet tool for JEE develop, for example, the Develop Platform supports UML,MDA,Struts,Hibernate,Spring developing. %prep%setup -c%installinstall -d $RPM_BUILD_ROOT%{userpath}#cp -a %{name}* $RPM_BUILD_ROOT%{userpath}cp -a * $RPM_BUILD_ROOT%{userpath}%cleanrm -rf $RPM_BUILD_ROOTrm -rf $RPM_BUILD_DIR/%{name}-%{version}%files%defattr(-,root,root)%{userpath}%postcat > ~/Desktop/ISStudio.desktop <<EOF[Desktop Entry]Encoding=UTF-8Name=ISStudioExec=%{userpath}/eclipse/eclipseIcon=%{userpath}/ISStudio/resources/eclipse.pngCategories=Application;Development;Version=6.0.0StartupNotify=trueType=ApplicationTerminal=falseEOFcp -a ~/Desktop/ISStudio.desktop /usr/share/applications%postunrm ~/Desktop/ISStudio.desktoprm /usr/share/applications/ISStudio.desktop%changelog* Wed Mar 12 2008 zhu_qhua  - InforSuite Studio project to RPM build spec-file

 

参考: http://blog.csdn.net/yueyinggufan/archive/2009/08/21/4469000.aspx

http://wiki.netbeans.org/VestaBuild

 

 

 

 

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!

留言需要登陆哦

技术博客集 - 网站简介:
前后端技术:
后端基于Hyperf2.1框架开发,前端使用Bootstrap可视化布局系统生成

网站主要作用:
1.编程技术分享及讨论交流,内置聊天系统;
2.测试交流框架问题,比如:Hyperf、Laravel、TP、beego;
3.本站数据是基于大数据采集等爬虫技术为基础助力分享知识,如有侵权请发邮件到站长邮箱,站长会尽快处理;
4.站长邮箱:[email protected];

      订阅博客周刊 去订阅

文章归档

文章标签

友情链接

Auther ·HouTiZong
侯体宗的博客
© 2020 zongscan.com
版权所有ICP证 : 粤ICP备20027696号
PHP交流群 也可以扫右边的二维码
侯体宗的博客