0290-0293.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 358 行

HTML
358
字号




<HTML>

<HEAD>

<TITLE>Maximum RPM (RPM):Real-World Package Building: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=20 //-->

<!-- PAGES=0275-0304 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->









<P><CENTER>

<a href="0286-0289.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0294-0297.html">Next</A>

</CENTER></P>



<!-- END CODE //--><A NAME="PAGENUM-290"><P>Page 290</P></A><!-- CODE //-->

<PRE>





Finding dependencies...

Requires (1): dump

1 block

Generating signature: 0

Wrote:           /usr/src/redhat/RPMS/i386/amanda-client-2.3.0-1.i386.rpm

Binary Packaging: amanda-server-2.3.0-1

Finding dependencies...

1 block

Generating signature: 0

Wrote:            /usr/src/redhat/RPMS/i386/amanda-server-2.3.0-1.i386.rpm

+ umask 022

+ echo Executing: %clean

Executing: %clean

+ cd /usr/src/redhat/BUILD

+ cd amanda-2.3.0

+ exit 0

Source Packaging: amanda-2.3.0-1

amanda-2.3.0.spec

amanda-2.3.0-linux.patch

amanda-2.3.0.tar.gz

374 blocks

Generating signature: 0

Wrote:             /usr/src/redhat/SRPMS/amanda-2.3.0-1.src.rpm

#

</PRE>

<!-- END CODE //-->



<P>Great! Let's take a look at our handiwork:

</P>

<!-- CODE //-->

<PRE>

#   cd     /usr/src/redhat/RPMS/i386/

# ls -l

total 2

-rw-r--r-- 1 root root 1246 Nov 20 21:19 amanda-client-2.3.0-1.i386.rpm

-rw-r--r-- 1 root root 1308 Nov 20 21:19 amanda-server-2.3.0-1.i386.rpm

#

rpm-first-look

</PRE>

<!-- END CODE //-->



<P>Hmmm, those binary packages look sort of small. We'd better see what's in there:

</P>

<!-- CODE //-->

<PRE>

# rpm -qilp amanda-*-1.i386.rpm

Name : amanda-client                 Distribution: (none)

Version : 2.3.0                            Vendor: (none)

Release : 1                            Build Date: Wed Nov 20 21:19:44 1996

Install date: (none)                   Build Host: moocow.rpm.org

Group : System/Backup                    Source RPM: amanda-2.3.0-1.src.rpm

Size : 0

Summary : Client-side Amanda package

Description :

The Amanda Network Backup system contains software necessary to

automatically perform backups across a network. Amanda consists of

two packages -- a client (this package), and a server:



The client package enable a network-capable system to have its

filesystems backed up by a system running the Amanda server.

</PRE>

<!-- END CODE //-->



<TABLE BGCOLOR=#FFFF99><TR><TD>NOTE:</TD></TR><TR><TD>

<!-- CODE SNIP //-->

<PRE>

In order for a system to perform backups of itself, install both

the client and server packages!

(contains no files)

</PRE>

<!-- END CODE SNIP //-->

</TD></TR></TABLE>



<A NAME="PAGENUM-291"><P>Page 291</P></A><!-- CODE //-->

<PRE>





Name : amanda-server                  Distribution: (none)

Version : 2.3.0                             Vendor: (none)

Release : 1                             Build Date: Wed Nov 20 21:19:44 1996

Install date: (none)                    Build Host: moocow.rpm.org

Group : System/Backup                    Source RPM: amanda-2.3.0-1.src.rpm

Size : 0

Summary : Server-side Amanda package

Description :

The Amanda Network Backup system contains software necessary to

automatically perform backups across a network. Amanda consists of

two package -- a client, and a server (this package):



The server package enables a network-capable system to control one

or more Amanda client systems performing backups. The server system

will direct all backups to a locally attached tape drive. Therefore,

the server system requires a tape drive.

</PRE>

<!-- END CODE //-->



<TABLE BGCOLOR=#FFFF99><TR><TD>NOTE:</TD></TR><TR><TD>

<!-- CODE SNIP //-->

<PRE>

 In order for a system to perform backups of itself, install both

the client and server packages!

(contains no files)

#

</PRE>

<!-- END CODE SNIP //-->

</TD></TR></TABLE>



<P>What do they mean, (contains no files)? The spec file has perfectly good

%files lists&#133;.

</P>



<P>Oops.

</P>



<H4><A NAME="ch20_ 20">

20.4.1. Creating the %files List

</A></H4>



<P>Everything was going so smoothly, we forgot that the

%files lists were going to need files. No problem; we just need to put the filenames in there, and we'll be all set. But is it really

that easy?

</P>



<H4><A NAME="ch20_ 21">

20.4.1.1. How to Find the Installed Files

</A></H4>



<P>Luckily, it's not too bad. Since we saved the output from our first

make install, we can see the filenames as they're installed. Of course, it's important to make sure the install output is

valid. Fortunately for us, amanda didn't require much fiddling by the time we got it built and

tested. If it had, we would have had to get more recent output from the installation phase.

</P>



<P>It's time for more decisions. We have one list of installed files and two

%files lists. It would be silly to put all the files in both

%files lists, so we have to decide which file goes where.

</P>



<P>This is where experience with the software really pays off, because the wrong decision

made here can result in awkward, ill-featured packages. Here's the

%files list we came up with for the client subpackage:

</P>



<!-- CODE //-->

<PRE>

%files  client

/usr/lib/amanda/amandad

/usr/lib/amanda/sendsize

/usr/lib/amanda/calcsize

/usr/lib/amanda/sendbackup-dump

/usr/lib/amanda/selfcheck





</PRE>

<!-- END CODE //--><A NAME="PAGENUM-292"><P>Page 292</P></A><!-- CODE //-->

<PRE>



/usr/lib/amanda/sendbackup-gnutar

/usr/lib/amanda/runtar

README

COPYRIGHT

docs/INSTALL

docs/SYSTEM.NOTES

docs/WHATS.NEW

</PRE>

<!-- END CODE //-->



<P>The files in /usr/lib/amanda are all the client-side

amanda programs, so that part was easy. The remaining files

are part of the original source archive. Amanda doesn't install them,

but they contain information that users should see.

</P>



<P>Realizing that RPM can't package these files specified as they are, let's leave the client

%files list for a moment and check out the list for the

server subpackage:

</P>



<!-- CODE //-->

<PRE>

%files server

/usr/sbin/amadmin

/usr/sbin/amcheck

/usr/sbin/amcleanup

/usr/sbin/amdump

/usr/sbin/amflush

/usr/sbin/amlabel

/usr/sbin/amrestore

/usr/sbin/amtape

/usr/lib/amanda/taper

/usr/lib/amanda/dumper

/usr/lib/amanda/driver

/usr/lib/amanda/planner

/usr/lib/amanda/reporter

/usr/lib/amanda/getconf

/usr/lib/amanda/chg-generic

/usr/man/man8/amanda.8

/usr/man/man8/amadmin.8

/usr/man/man8/amcheck.8

/usr/man/man8/amcleanup.8

/usr/man/man8/amdump.8

/usr/man/man8/amflush.8

/usr/man/man8/amlabel.8

/usr/man/man8/amrestore.8

/usr/man/man8/amtape.8

README

COPYRIGHT

docs/INSTALL

docs/KERBEROS

docs/SUNOS4.BUG

docs/SYSTEM.NOTES

docs/TAPE.CHANGERS

docs/WHATS.NEW

docs/MULTITAPE

example

</PRE>

<!-- END CODE //-->



<P>The files in /usr/sbin are programs that will be run by the amanda administrator in order

to perform backups and restores. The files in

/usr/lib/amanda are the server-side programs that do the actual work during backups. Following that are a number of man pages: one for

each program to be run by the amanda administrator, and one with an overview of amanda.

</P>



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







<P>Bringing up the rear are a number of files that are not installed, but would be handy for

the amanda administrator to have available. There is some overlap with the files that will be part

of the client subpackage, but the additional files here discuss features that would interest

only amanda administrators. Included here is the

example subdirectory, which contains a few sample configuration files for the amanda server.

</P>



<P>As in the client %files list, these last files can't be packaged by RPM as we've listed them.

We need to use a few more of RPM's tricks to get them packaged.

</P>



<H4><A NAME="ch20_ 22">

20.4.1.2. Applying Directives

</A></H4>



<P>Since we'd like the client subpackage to include those files that are not normally installed,

and since the files are documentation, let's use the

%doc directive on them. That will accomplish two things:

</P>



<UL>

<LI>          When the client

subpackage is installed, it will direct RPM to place them in a

package-specific directory in /usr/doc.

<LI>          It will tag the files as being documentation,

making it possible for users to easily track down the documentation with a simple

rpm -qd command.

</UL>



<P>In the course of looking over the %files lists, it becomes apparent that the directory

/usr/lib/amanda will contain only files from the two amanda subpackages. If the subpackages

are erased, the directory will remain, which won't hurt anything, but it isn't as neat as it could be. But

if we add the directory to the list, RPM will automatically package every file in the

directory. Because the files in that directory are part of both the client and the server subpackages,

we'll need to use the %dir directive to instruct RPM to package only the directory.

</P>



<P>After these changes, here's what the client

%files list looks like now:

</P>



<!-- CODE //-->

<PRE>

%files  client

%dir    /usr/lib/amanda/

/usr/lib/amanda/amandad

/usr/lib/amanda/sendsize

/usr/lib/amanda/calcsize

/usr/lib/amanda/sendbackup-dump

/usr/lib/amanda/selfcheck

/usr/lib/amanda/sendbackup-gnutar

/usr/lib/amanda/runtar

%doc README

%doc COPYRIGHT

%doc docs/INSTALL

%doc docs/SYSTEM.NOTES

%doc docs/WHATS.NEW

</PRE>

<!-- END CODE //-->



<P>We've also applied the same directives to the server

%files list:

</P>



<!-- CODE SNIP //-->

<PRE>

%files  server

/usr/sbin/amadmin

/usr/sbin/amcheck

/usr/sbin/amcleanup

/usr/sbin/amdump



</PRE>

<P><CENTER>

<a href="0286-0289.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0294-0297.html">Next</A>

</CENTER></P>











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

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

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