All source packages carry a
.src.rpm extension (source RPM).
![]() | Tip |
|---|---|
Source packages can be copied from the installation medium to the hard disk
and unpacked with YaST. They are not, however, marked as installed
( | |
The following directories must be available for rpm
and rpmbuild in /usr/src/packages
(unless you specified custom settings in a file like
/etc/rpmrc):
SOURCES
for the original sources (.tar.bz2 or
.tar.gz files, etc.) and for distribution-specific
adjustments (mostly .diff or .patch
files)
SPECSfor the .spec files, similar to a meta Makefile, which control the build process
BUILDall the sources are unpacked, patched, and compiled in this directory
RPMSwhere the completed binary packages are stored
SRPMShere are the source RPMs
When you install a source package with YaST, all the necessary components
are installed in /usr/src/packages: the sources and the
adjustments in SOURCES and the
relevant .spec file in SPECS.
![]() | Warning |
|---|---|
Do not experiment with system components ( | |
The following example uses the wget.src.rpm
package. After installing the package with YaST, you should have
files similar to the following listing:
/usr/src/packages/SOURCES/nops_doc.diff /usr/src/packages/SOURCES/toplev_destdir.diff /usr/src/packages/SOURCES/wget-1.9.1+ipvmisc.patch /usr/src/packages/SOURCES/wget-1.9.1-brokentime.patch /usr/src/packages/SOURCES/wget-1.9.1-passive_ftp.diff /usr/src/packages/SOURCES/wget-LFS-20040909.tar.bz2 /usr/src/packages/SOURCES/wget-wrong_charset.patch /usr/src/packages/SPECS/wget.spec
rpmbuild -b X
/usr/src/packages/SPECS/wget.spec starts the compilation.
X is a wild card for various stages of the build
process (see the output of --help or the RPM documentation
for details). The following is merely a brief explanation:
-bpPrepare sources in /usr/src/packages/BUILD:
unpack and patch.
-bcDo the same as -bp, but with additional
compilation.
-biDo the same as -bp, but with additional
installation of the built software. Caution: if the package does not
support the BuildRoot feature, you might overwrite configuration
files.
-bbDo the same as -bi, but with the additional
creation of the binary package. If the compile was successful, the binary
should be in /usr/src/packages/RPMS.
-baDo the same as -bb, but with the additional
creation of the source RPM. If the compilation was successful, the binary
should be in /usr/src/packages/SRPMS.
--short-circuitSkip some steps.
The binary RPM created can now be installed with rpm
-i or, preferably, with rpm
-U. Installation with rpm makes
it appear in the RPM database.