⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0530srpm.htm

📁 鸟哥LINUX 学习课本
💻 HTM
📖 第 1 页 / 共 3 页
字号:
pppoe-3.5.tar.gz进行解压缩啦!</li><li>然后就开始%setup的工作;</li><li>再来开始%build及%install的设定与编译!</li><li>最后将完成打包的档案给他放置到该放置的地方去,如果你的规定的硬件是在i386的系统,那么最后编译成功的*.i386.rpm档案就会被放置在/usr/src/RPM/RPMS/i386里面啰!如果是i586那么自然就是/usr/src/redhat/RPMS/i586目录下啰!</li></ol>整个步骤大概就是这样子!最后的结果数据会放置在RPMS那个目录底下就对啦!</blockquote><hr width="100%"><a name="owner"></a><font size="+1" color="#000099">打包自己的套件:</font><blockquote>这个就有趣了!我们自己来编辑一下自己制作的RPM怎么样?会很难吗?完全不会!这里简单的以一个小例子来说明喔!请注意,这个真的只是一个小例子,所以不要觉得奇怪喔!其中,比较需要注意的,由于在上面的步骤说明中,我们知道在将SRPM编译成为RPM的时候,会以tar这支程式来将档案解开,因此,<b><font color="#000099">我们在进行来源档案的建立时,就必需要将他打包成为一个tar.gz的tarball的档案才行</font></b>!</blockquote><blockquote>假设我们编辑了一支script,内容是这样:<br> <table bgcolor="#000000" border="1" cols="1" width="500"><tbody><tr><td><font size="-1" face="SimSun"><font color="#ffffff">[root @testroot]# </font><font color="#ffff00">cd /usr/src/redhat/SOURCES</font></font><br><font size="-1" face="SimSun"><font color="#ffffff">[root @testSOURCES]# </font><font color="#ffff00">vi showvbird.sh</font></font><br><font size="-1" color="#ffffff" face="SimSun">#!/bin/bash</font><br><font size="-1" color="#ffffff" face="SimSun"># This fileis just used to demo the RPM packaging.</font><br><font size="-1" color="#ffffff" face="SimSun"># the onlything is showing the hostname.</font><br><font size="-1" color="#ffffff" face="SimSun">HOST=`/bin/hostname`</font><br><font size="-1" color="#ffffff" face="SimSun">/bin/echo $HOST</font><p><font size="-1" face="SimSun"><font color="#ffffff">[root @testSOURCES]# </font><font color="#ffff00">chmod 755 showvbird.sh</font></font><br><font size="-1" face="SimSun"><font color="#ffffff">[root @testSOURCES]# </font><font color="#ffff00">tar –zcvf showvbird.tar.gz showvbird.sh</font></font><br><font size="-1" color="#ffffcc" face="SimSun">注意了,我们必需要将他打包才行!</font></p></td></tr></tbody></table> <br>上面的动作中,我们编辑了一个shellscript档案,档名为showvbird.sh,并且将他打包成为具有gzip压缩的tarball档案,也就是showvbird.tar.gz这样的档案才行!请注意,这个showvbird.tar.gz档案『必需』放置在SOURCES目录之下!</blockquote><blockquote>再来则是要编辑那个很重要的*.spec档案啰!你可以这样简单的编写一下:<br> <table bgcolor="#000000" border="1" cols="1" width="500"><tbody><tr><td><font size="-1" face="SimSun"><font color="#ffffff">[root @testroot]# </font><font color="#ffff00">cd /usr/src/redhat/SPECS</font></font><br><font size="-1" face="SimSun"><font color="#ffffff">[root @testSPECS]# </font><font color="#ffff00">vi showvbird.spec</font></font><br><font size="-1" color="#ffffff" face="SimSun">Summary:&#160;&#160;This is a demo RPM package.</font><br><font size="-1" color="#ffffff" face="SimSun">Name:&#160;&#160;&#160;&#160;&#160;showvbird</font><br><font size="-1" color="#ffffff" face="SimSun">Version:&#160;&#160;1.0</font><br><font size="-1" color="#ffffff" face="SimSun">Release:&#160;&#160;1</font><br><font size="-1" color="#ffffff" face="SimSun">Copyright:GPL</font><br><font size="-1" color="#ffffff" face="SimSun">Group:&#160;&#160;&#160;&#160;VBird's Home</font><br><font size="-1" face="SimSun"><font color="#ffffff">Source:&#160;&#160;&#160;showvbird.tar.gz&#160;&#160; </font><font color="#ffffcc">&lt;==这个就是刚刚建立起来的arball档案!</font></font><br><font size="-1" color="#ffffff" face="SimSun">Url:&#160;&#160;&#160;&#160;&#160;&#160;http://linux.vbird.org</font><br><font size="-1" color="#ffffff" face="SimSun">Packager:&#160;VBird</font><p><font size="-1" color="#ffffff" face="SimSun">%description</font><br><font size="-1" color="#ffffff" face="SimSun">This packageis just a demo RPM.</font></p><p><font size="-1" color="#ffffff" face="SimSun">%prep</font><br><font size="-1" color="#ffffff" face="SimSun">%setup –c</font><br><font size="-1" color="#ffffff" face="SimSun">%install</font><br><font size="-1" color="#ffffff" face="SimSun">install -m755 showvbird.sh /usr/local/bin/showvbird.sh</font></p><p><font size="-1" color="#ffffff" face="SimSun">%files</font><br><font size="-1" color="#ffffff" face="SimSun">/usr/local/bin/showvbird.sh</font></p></td></tr></tbody></table> <br>好了!开始给他编译并打包成为RPM档案啦!<br> <table bgcolor="#000000" border="1" cols="1" width="500"><tbody><tr><td><font size="-1" face="SimSun"><font color="#ffffff">[root @testSPECS]# </font><font color="#ffff00">rpm -bb showvbird.spec</font></font><br><font size="-1" color="#ffffff" face="SimSun">….(略)</font><br><font size="-1" color="#ffffff" face="SimSun">Wrote: /usr/src/redhat/RPMS/i586/showvbird-1.0-1.i586.rpm</font></td></tr></tbody></table> <br>最后这个被打包成功的档案就被放置在/usr/src/redhat/RPMS/i586/showvbird-1.0-1.i586.rpm啰!然后给他安装一下:<br> <table bgcolor="#000000" border="1" cols="1" width="700"><tbody><tr><td><font size="-1" face="SimSun"><font color="#ffffff">[root @testSPECS]# </font><font color="#ffff00">rpm –ivh /usr/src/RPM/RPMS/i586/showvbird-1.0-1.i586.rpm</font></font><br><font size="-1" color="#ffffff" face="SimSun">Preparing...&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;########################################### [100%]</font><br><font size="-1" color="#ffffff" face="SimSun">&#160;&#160;1:showvbird&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;########################################### [100%]</font><p><font size="-1" face="SimSun"><font color="#ffffff">[root @testSPECS]# </font><font color="#ffff00">rpm –qi showvbird</font></font><br><font size="-1" color="#ffffff" face="SimSun">Name&#160;&#160;&#160;&#160;&#160;&#160;&#160;: showvbird&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Relocations: (not relocateable)</font><br><font size="-1" color="#ffffff" face="SimSun">Version&#160;&#160;&#160;&#160;: 1.0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Vendor: (none)</font><br><font size="-1" color="#ffffff" face="SimSun">Release&#160;&#160;&#160;&#160;: 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Build Date: Wed 06 Nov 2002 11:27:17 PM CST</font><br><font size="-1" color="#ffffff" face="SimSun">Install date:Wed 06 Nov 2002 11:27:42 PM CST&#160;&#160;&#160;&#160;&#160; Build Host:test.linux.org</font><br><font size="-1" color="#ffffff" face="SimSun">Group&#160;&#160;&#160;&#160;&#160;&#160;: VBird's Home&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Source RPM: showvbird-1.0-1.src.rpm</font><br><font size="-1" color="#ffffff" face="SimSun">Size&#160;&#160;&#160;&#160;&#160;&#160;&#160;: 143&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;License: GPL</font><br><font size="-1" color="#ffffff" face="SimSun">Packager&#160;&#160;&#160;: VBird</font><br><font size="-1" color="#ffffff" face="SimSun">URL&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;: http://linux.vbird.org</font><br><font size="-1" color="#ffffff" face="SimSun">Summary&#160;&#160;&#160;&#160;: This is a demo RPM package.</font><br><font size="-1" color="#ffffff" face="SimSun">Description:</font><br><font size="-1" color="#ffffff" face="SimSun">This packageis just a demo RPM.</font></p><p><font size="-1" face="SimSun"><font color="#ffffff">[root @testSPECS]# </font><font color="#ffff00">showvbird.sh</font></font><br><font size="-1" color="#ffffff" face="SimSun">test.linux.org</font><br><font size="-1" face="SimSun"><font color="#ffffff">[root @testSPECS]# </font><font color="#ffff00">rpm –ql showvbird</font></font><br><font size="-1" face="SimSun"><font color="#ffffff">/usr/local/bin/showvbird.sh&#160;&#160;&#160;&#160;&#160;&#160;</font><font color="#ffffcc">&lt;==嘿嘿!已经记录起来了!自己的软件耶!</font></font></p></td></tr></tbody></table> <br>用很简单的方式,就可以将自己的软件或者程序给他修改与设定妥当!很不错吧!以后您就可以自行设定你的RPM啰!当然,也可以手动修改您的SRPM的来源档内容啰!</blockquote><hr width="100%"><a name="FAQ"></a><font size="+1" color="#000099">本章习题练习( 要看答案请将鼠标移动到『答:』底下的空白处,按下左键圈选空白处即可察看)</font><br><hr width="100%"><font size="-1" color="#000066" face="SimSun">2002/12/04:第一次完成</font><br><font size="-1" color="#000066" face="SimSun">2003/02/11:重新编排与加入FAQ</font><br><font size="-1" color="#000066" face="SimSun">2004/04/19:本网页已不再继续维护更新,请参考:<a href="http://linux.vbird.org//linux_basic/0520rpm_and_srpm.php">RPM与 SRPM 套件管理员</a></font><br><hr width="100%"><hr width="100%"><center><a href="http://linux.vbird.org/" target="_top"><img src="0530srpm_files/VBirdTitle2.jpg" nosave="" border="0" height="25" width="90"></a><a href="http://linux.vbird.org/linux_basic"><img src="0530srpm_files/icon_system.gif" nosave="" border="0" height="25" width="90"></a><a href="http://linux.vbird.org/linux_server"><img src="0530srpm_files/icon_server.gif" nosave="" border="0" height="25" width="90"></a><a href="http://linux.vbird.org/linux_security"><img src="0530srpm_files/icon_security.jpg" nosave="" border="0" height="25" width="90"></a><a href="http://phorum.vbird.org/" target="_blank"><img src="0530srpm_files/icon_forums.gif" nosave="" border="0" height="25" width="90"></a><a href="http://linux.vbird.org/adsl"><img src="0530srpm_files/icon_adsl.gif" nosave="" border="0" height="25" width="90"></a><br><font size="-1" color="#000066">Designed by <a href="mailto:vbird@tsai.adsldns.org">VBird</a>during 2001-2004.&#160; Aerosol Lab.</font></center></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -