Datasheet
“main” (Installation and Administration) — 2004/6/25 — 13:29 — page 183 — #209
i
i
i
i
i
i
i
i
5
Updating the System and Package Management
5.3.6 Compiling RPM Packages with build
The danger with many packages is that unwanted files are added to the
running system during the build process. To prevent this, use build,
which creates a defined environment in which the package is built. To es-
tablish this chroot environment, the build script must be provided with a
complete package tree. This tree can be made available on the hard disk,
via NFS, or from DVD. The respective position is specified with build
--rpms <path>. Unlike rpm, the build command looks for the SPEC
file in the source directory. To build wget anew (like in the above example)
with the DVD mounted in the system under /media/dvd, use the follow-
ing commands as root:
cd /usr/src/packages/SOURCES/
mv ../SPECS/wget.spec .
build --rpms /media/dvd/suse/ wget.spec
Subsequently, a minimum environment will be established at /var/
tmp/build-root. The package will be built in this environment. Upon
completion, the resulting packages are located in /var/tmp/build-
root/usr/src/packages/RPMS.
The build script offers a number of additional options. For example, cause
the script to prefer your own RPMs, omit the initialization of the build
environment, or limit the rpm command to one of the above-mentioned
stages. Access additional information can be accessed with build --help
and man build.
5.3.7 Tools for RPM Archives and the RPM Database
Midnight Commander (mc) can display the contents of RPM archives and
copy parts of them. It represents archives as virtual file systems, offering all
usual menu options of Midnight Commander: the HEADER information can
be displayed with
F3 , the archive structure can be viewed with the cursor
keys and
Enter , and archive components can be copied with
F5 .
A front-end for rpm is also available for Emacs. KDE offers the kpackage
tool. GNOME offers gnorpm.
Using the Alien (alien) Perl script, it is possible to convert or install an
alien binary package. This tries to convert old TGZ archives to RPM before
installing. This way, the RPM database can keep track of such a package
after it has been installed. Beware: alien is still alpha software, according
to its author — even if it already has a high version number.
183SUSE LINUX Enterprise Server










