+ cd /home/chris/rpm/tmp

+ LANG=C

...(Lines snipped)...

Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/chris/rpm/tmp/CriticalMass-root

error: Installed (but unpackaged) file(s) found:

/usr/bin/Packer

/usr/bin/critter

/usr/share/Critical_Mass/lg-criti.xm

/usr/share/Critical_Mass/resource.dat

/usr/share/man/man6/critter.6.gz

RPM build errors:

Installed (but unpackaged) file(s) found:

/usr/bin/Packer

/usr/bin/critter

/usr/share/Critical_Mass/lg-criti.xm

/usr/share/Critical_Mass/resource.dat

/usr/share/man/man6/critter.6.gz  

If your build fails because you need additional software, you must find that software and add it to a BuildRequires line in the spec file.

The -bi argument to rpmbuild instructs it to build up to the end of the %install stage. You can see that rpmbuild has detected files in BuildRoot that are not included in the package. To see the actual contents of the BuildRoot , you can change to the ~/rpm/CriticalMass directory and look around:

$ cd ~/rpm/tmp/ CriticalMass -root

$ find

.

./usr

./usr/bin

./usr/bin/Packer

./usr/bin/critter

./usr/lib

./usr/lib/debug

./usr/lib/debug/usr

./usr/lib/debug/usr/bin

./usr/lib/debug/usr/bin/critter.debug

./usr/lib/debug/usr/bin/Packer.debug

./usr/share

./usr/share/man

./usr/share/man/man6

./usr/share/man/man6/critter.6.gz

./usr/share/Critical_Mass

./usr/share/Critical_Mass/resource.dat

./usr/share/Critical_Mass/lg-criti.xm

./usr/src

./usr/src/debug

The find command recursively lists all of the files found in the current directory.

From this list of files, you can build the %files section of the spec file. You can safely ignore the files in /usr/lib/debug and /usr/src since the RPM system will package these up into a separate debug RPM package automatically.

Among these files, there are some binaries:

./usr/bin/Packer

./usr/bin/critter

There is also a manpage:

./usr/share/man/man6/critter.6.gz

plus a data directory and some datafiles:

./usr/share/Critical_Mass

./usr/share/Critical_Mass/resource.dat

./usr/share/Critical_Mass/lg-criti.xm

The /usr/share/CriticalMass directory belongs to the package and should be removed when the package is removed. To configure this, you must list only the directory in the %files section of the spec file; the contents of the directory will automatically be included.

Other directories, such as /usr/bin and /usr/share/man/man6 , also contain files belonging to other packages, so those directories must not be included in the %files list; only the individual files in those directories should be included.

Because the RPM package is being built by a regular useryou or meand our accounts may not exist on the target machine, you must reassign the ownership (and possibly the permissions) of the files using the %defattr directive. %defattr accepts four arguments: the default permission for files, the owner, the group, and the default permission for directories. Use a hyphen for permissions to signify that the existing file permissions should be left untouched:

%defattr(-, root, root, -)

To set specific attributes for a specific file, use %attr with three arguments (permission, user, group):

%defattr(0511, root, nogroup) foofile  

In addition to files in the BuildRoot , you should also identify files in the top-level directory of the tarball that should be included in the file as documentation; this is done using the %doc directive. When the package is installed, these files will be placed in /usr/share/doc/ <packagename-version> . Good candidates for documentation files include README , TODO , BUGS , INSTALL , COPYING , and any other notes the program author has provided. In the case of the CriticalMass software, only the files COPYING and TODO fit into this category:

%doc COPYING TODO

In a similar way, the %config directive specifies configuration files that are included in the RPM:

%config /etc/master.conf

%config(noreplace) /etc/master.conf

Вы читаете Fedora Linux
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату