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

📄 0161-0162.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:


<HTML>

<HEAD>

<TITLE>Maximum RPM (RPM):rpm -b Command Reference:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311054 //-->

<!-- TITLE=Maximum RPM (RPM)//-->

<!-- AUTHOR=Edward Bailey//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=12 //-->

<!-- PAGES=0139-0162 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0158-0160.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch13/0163-0166.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-161"><P>Page 161</P></A>







<P>The --recompile option is normally used when a previously installed package needs to

be recompiled. --recompile comes in handy when software needs to be compiled against a

new version of the kernel.

</P>



<P>Here's what RPM displays during a --recompile:

</P>

<!-- CODE //-->

<PRE>

# rpm --recompile cdplayer-1.0-1.src.rpm

Installing cdplayer-1.0-1.src.rpm

* Package: cdplayer

Executing: %prep

...

+ exit 0

Executing: %build

...

+ exit 0

Executing: %install

...

+ exit 0

Executing: special doc

...

+ exit 0

Executing: sweep

...

+ exit 0

#

</PRE>

<!-- END CODE //-->



<P>The very first line shows RPM installing the source package. After that are ordinary

executions of the %prep, %build, and %install sections of the spec file. Finally, the cleanup of the

software's build directory takes place, just as if the

--clean option had been specified.

</P>



<P>Since rpm -i and rpm -U are not being used to install the software, the RPM database is

not updated during a --recompile. This means that doing a

--recompile on an already-installed package may result in problems down the road, when RPM is used to upgrade or verify

the package.

</P>



<H4><A NAME="ch12_ 15">

12.2.2. rpm --rebuild: What Does It Do?

</A></H4>



<P>Package builders, particularly those who create packages for multiple architectures, often

need to build their packages starting from the original

sources. The --rebuild option does this, starting from a source package file. Here is the list of steps it performs:

</P>



<OL>

<LI>          Install the specified source package file.

<LI>          Unpack the original sources.

<LI>          Build the software.

<LI>          Install the software.

<LI>          Create a binary package file.

<LI>          Remove the software's build directory tree.

</OL>



<A NAME="PAGENUM-162"><P>Page 162</P></A>











<P>Like the --recompile option, --rebuild cleans up after itself. The only difference between

the two commands is that --rebuild also creates a binary package file. The only remnants of a --rebuild are the original source package, the newly installed software, and a new binary

package file.

</P>



<P>Package builders find this command especially handy because it allows them to create new

binary packages using one command, with no additional cleanups required. There are two

times when --rebuild is normally used:

</P>



<UL>

<LI>          When the build environment (for example, compilers, libraries) has changed.

<LI>          When binary packages for a different architecture are to be built.

</UL>



<P>Here's an example of the --rebuild option in action:

</P>

<!-- CODE //-->

<PRE>

# rpm --rebuild cdplayer-1.0-1.src.rpm

Installing cdplayer-1.0-1.src.rpm

* Package: cdplayer

Executing: %prep

...

+ exit 0

Executing: %build

...

+ exit 0

Executing: %install

...

+ exit 0

Executing: special doc

...

+ exit 0

Binary Packaging: cdplayer-1.0-1

...

Executing: %clean

...

+ exit 0

Executing: sweep

...

+ exit 0

#

</PRE>

<!-- END CODE //-->



<P>The very first line shows RPM installing the source package. The lines after that are

ordinary executions of the %prep, %build, and

%install sections of the spec file. Next, a binary

package file is created. Finally, the spec file's

%clean section (if one exists) is executed. The cleanup

of the software's build directory takes place, just as if the

--clean option had been specified.

</P>



<H3><A NAME="ch12_ 16">

12.3. Summary

</A></H3>



<P>That completes our overview of the commands used to build packages with RPM. In

Chapter 13, &quot;Inside the Spec File,&quot; we'll look at the various macros that are available and how they

can make life easier for the package builder.

</P>

<BR><BR>

<P><CENTER>

<a href="0158-0160.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch13/0163-0166.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

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