Archive:Anatomy of a package checkout
Revision as of 21:42, 22 February 2009
The anatomy of a package checkout
There are two all-important modules that are of concern to developers:
- The common module contains the Makefile rules for downloading, unpacking, building, testing and packaging your rpm as well as various scripts used in the management of a package module. In the common module, Makefile.common is the workhorse of each rpm build. This file is meant to be included from each module's own Makefile and provides a host of make targets that are explained in detail later in this document.
- The rpms module is the main container for all the package modules. The structure of a package module is explained below.
General Structure of a checked-out package
All non-tarball/non-large components of a source package will be kept in CVS. All tarball and large components (think: pristine upstream sources) will be kept in the look-aside repository, and an md5sum of their contents will be kept in CVS in the sources file.
system-config-display/ |-- common | |-- Makefile | |-- Makefile.common | |-- branches | |-- cvs-import.sh |-- devel | |-- Makefile | |-- sources | |-- system-config-display.spec | |-- fix-somthing.patch |-- F-8 | |-- Makefile | |-- branch | |-- sources | |-- system-config-display.spec | |-- fix-something.patch |-- F-9 | |-- Makefile | |-- branch | |-- sources | |-- system-config-display.spec | |-- fix-something.patch
For example, the CVS repository on the F-9 branch for a small package might contain:
Makefile foo.spec branch sources
sources file lists the sources that are stored in the lookaside cache; in this case, it would just consist of:
The look-aside repository will contain a directory named foo (after the name of the package module) and a copy of the
foo-1.2.3.tar.gz file referenced from the sources file. To check out the sources stored in the lookaside cache, you can simply do a
make sources in the package checkout.
make sources is also the default Makefile target, so a simple make will also have the same effect.
branch file contains the name of the branch the build system will use. It relates to the Fedora version.
.spec file is the RPM build instructions for the package.
Any other small files, such as Fedora-specific init scripts or patches, will also be included here.
Within each of the distro subdirectories, the Makefile provides a range of functionality. Type make help to see all of the available options. For example, you can use 'make local' to initiate a local build of your package.