rpm简单制作
我对linux一窍不通,可前段时间由于客户需要,要求给他们一个RPM版本,本人咬牙切齿鼓捣了两天,终于应付过去(这不是本人一贯作风,以后有机会仔细研究一下linux的基本操作)。RPM打包是使用的linux的rpm build工具,如果命令行中提示“rpmbuild : command not found”,那是因为系统没有安装rpm build工具,这个工具一般在安装光盘中。
下面对整个实现过程简单描述一下:
[*]资源放置:usr/src/redhat/build 下面有多个文件
tar.gz包放到resources下,spec文件放到specs下
[*]然后执行打包程序
使用到的linux命令有:
[*]rpm打包: rpmbuild -ba *.spec
[*]rpm安装tar.gz文件:rpm -ivh *.tar.gz
[*]rpm卸载tar.gz文件:rpm -e * 注意:一定不要带发版号和后缀,如ISStudio-6.0.0-1.i386.rpm,要使用rpm -e ISStudio-6.0.0
[*]移除文件: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 <<EOFEncoding=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
页:
[1]