To understand this document

This document assumes you standard UNIX™ shell, sh(1), have an understanding of the UNIX process model, exit codes, and may have used find(1). It also assumes you have a general working knowledge of ksb's 5 layer model of configuration management.

It also assumes that you can read the manual page for any other example command.

What is level2s?

Level2s builds an index file by searching the local master source repository for all the layer 2 packages. It locates those packages by the existence of the file ITO.spec in each directory. The directory is a layer 3 package if the file Makefile.meta exists, in the same directory as the RPM specification file, otherwise it is a layer 2 product. To manage layer 3 packages see the level3s HTML document.

Product packages support a few common operations. The level2s application is an automated interface to those operations. The operations generally supported are

build - build requested packages, missing or not
Use rcsvg to fetch the sources to the product, build a tar file of those sources names for the product directory and the release number. Local policy is to compress the output file with gzip, but your policy may be different.
help - output a list of subcommands
Output only a standard help text.
list - list the generated table of level2 products
After gathering the list of directories that contain ITO.spec files, just output a table of the
absolute-path:key-file:symbolic-name:package
An example line for the Tee product might look like:
/usr/msrc/usr/local/bin/Tee:Tee.m:Two:Tee
missing - list all the level2 tar files missing from our current working directory
This is used by automation to look for missing or out-of-date product archives.
msync - output msync status for every product source directory
Likewise, this reports on master source directories that are presently not completely committed. This is vary helpful as we approach a mandatory synchronization point. Like a major production upgrade.
rpm - extract ITO.spec and build RPMs from local tar files
Convert the cached source tar file to RPM format. This creates both a source and binary package for each product. The level2s also reads the environment variable $RPM_ADD for extra options to rpm.
cpan2rpm - build a .spec file and RPMs from CPAN tar files
Try to convert a perl module to an RPM, as above. This only works for some modules. Also reads $RPM_ADD.
restore - put the msrc directory back from the tar files
Undo the build operation, restoring the master source from the tar archive. This is the unpack operation that produces the HTML copy on the npcguild.org web-site.
sane - run some sanity checks on each level2 product
Compares some msrc recipe macros to the existing directory. May note a bad INTO, missing RCS cache (local site policy), ITO.spec or key file.

Meta-markup in ITO.spec

To specify the few parameters level2s needs to do its job, we supply some clues in the ITO.spec file as mk markup.
Level2

This outputs the name of the product. A name of dot (.) fails all requests, as does any non-zero exit code. The default markup prevents any accidents:

$Level2: ${false:-false}
Level3

As above, but allows a package level build of the directory. See level3s.

KeyFile

Output the name of the file whose revision represents the release number for this package. If none is specified the revision of ITO.spec is assumed, with:

$KeyFile: ${echo:-echo} ITO.spec

The default markup is kept in the level2s script itself, in comments in the first 99 lines of the file. If your local site policy has other requirements for default actions, then put in local overrides by editing the script before installation.

See also

The level3s HTML page, and the rcsvg HTML page.
$Id: level2s.html,v 4.2 2012/09/10 20:50:40 ksb Exp $