CMT Packages

From Daya Bay

Jump to: navigation, search

We organize our software into units called "packages" that are organized with CMT

Types of packages

We use several types of packages, including:

Software 
these hold source code to build applications and/or libraries.
Glue 
these hold CMT configuration to "glue" in external, 3rd party packages.
Policy 
these provide rules telling CMT how to build software or how to setup the environment for running the software

Anatomy of a package

The contents of a package are all held in a directory named after the package:

PackageName/

In this directory are one or more subdirectories. What subdirectories exist depends on what the package is supposed to be used for. A sample of required or optional subdirectories follows

cmt/

The only truly required subdirectory is

PackageName/cmt/

And this requires the file:

PackageName/cmt/requirements

The requirements file describes the package to CMT.

Because we do not used versioned subdirectories, you will also need a file:

PackageName/cmt/version.cmt

which holds the version of the package, for example "v0" or "v1r2p3".

Other files will be placed in cmt/ as CMT configures or builds the package.

src/

All source code (and private header) files your package may have go in

PackageName/src/

Creating a new package

First go to a directory where you want the package to sit. It is recommended that you organize your packages into one or more CMT Projects.

cd ~work/dayabay/projects/project1

New package by hand

mkdir -p PackageName/cmt
echo "v0" > PackageName/cmt/version.cmt
cat <<EOF > PackageName/cmt/requirements
package PackageName
version v0
branches cmt
EOF

This is minimal, see CMT requirements file for more information.

Personal tools