From Fedora Project Wiki

Line 8: Line 8:
<pre>
<pre>
system-config-display/
system-config-display/
|-- F-7
|  |-- Makefile
|  |-- branch
|  |-- sources
|  <code>-- system-config-display.spec
|-- Makefile
|-- common
|-- common
|  |-- Makefile
|  |-- Makefile
|  |-- Makefile.common
|  |-- Makefile.common
|  |-- branches
|  |-- branches
<code>-- cvs-import.sh
|-- cvs-import.sh
|-- devel
|-- devel
|  |-- Makefile
|  |-- Makefile
|  |-- sources
|  |-- sources
<code>-- system-config-display.spec
|-- system-config-display.spec
<code>-- import.log
|  |-- 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
</pre>
</pre>


For example, the CVS repository on the F-7 branch for a small package might contain:
For example, the CVS repository on the F-9 branch for a small package might contain:
<pre>
<pre>
Makefile foo.spec branch sources
Makefile foo.spec branch sources
</pre>
</pre>
The <code>./sources</code> file lists of the sources that are stored in the lookaside cache; in this case, it would just consist of:
The <code>sources</code> file lists the sources that are stored in the lookaside cache; in this case, it would just consist of:
<pre>
<pre>
3da5afb85bcdce51113d4b32bd79093f foo-1.2.3.tar.gz
3da5afb85bcdce51113d4b32bd79093f foo-1.2.3.tar.gz
</pre>
</pre>
The look-aside repository will contain a directory named foo (after the name of the package module) and a copy of the <code>foo-1.2.3.tar.gz</code> file referenced from the sources file.
The look-aside repository will contain a directory named foo (after the name of the package module) and a copy of the <code>foo-1.2.3.tar.gz</code> file referenced from the sources file. To check out the sources stored in the lookaside cache, you can simply do a
To check out the sources stored in the lookaside cache, you can simply do a
<code>make sources</code> in the package checkout. <code>make sources</code> is also the default Makefile target, so a simple make will also have the same effect.
<pre>
 
make sources
The <code>branch</code> file contains the name of the branch the build system will use.  It relates to the Fedora version.
</pre>
 
in the package checkout. <code>make sources</code> is also the default Makefile target, so a simple make will also have the same effect.
The <code>.spec</code> 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.

Revision as of 18:41, 28 May 2008

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

The sources file lists the sources that are stored in the lookaside cache; in this case, it would just consist of:

3da5afb85bcdce51113d4b32bd79093f foo-1.2.3.tar.gz

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.

The branch file contains the name of the branch the build system will use. It relates to the Fedora version.

The .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.