This directory contains a top level PI script and various common installation
scripts for the various open source packages found in OpenServer 5 and 6.
Once all builds have been done, the scripts in this directory should be run
to actually productize the builds. These scripts can create both custom and
pkgadd installable archives, for OSR5, OSR6 and UW7. This is accomplished
by using the MetaPKG tool. The presense of that tool is a pre-requisite for
running any of these scripts.

Doing a fully automated (to the degree possible) nightly build has some
infrastructural requirements that are more complicated than the normal
nightly build. Mostly, this is complicated by the fact that many of these
tools can not be built in a "cross environment" like the OS can.  That may
be possible to a degree, but it is an aweful lot of work, and frankly not
justified. Thus, to do a full build of all of these packages, the build
system must have a suitable build supplement installed that contains modern
versions of the packages that are being built. If significant updates are
made, for example, to GWXLIBS, then a bootstrap process of manually building
the new version, and then creating a new build supplement with that version
will need to be done.  Only then can the nightly builds work correctly.

Therefore, the currently supported build environments are:

For SCO OpenServer 5 builds:
  o  SCO OpenServer 5.0.7 with MP5 installed
  o  Build Supplement 5.0.7O or later

For SCO OpenServer 6 builds:
  o  SCO OpenServer 6.0.0 with MP2 installed
  o  Build Supplement 6.0.0E or later

For UnixWare 7 builds:
  o  SCO UnixWare 7.1.4 with MP3 installed
  o  Build Supplement 7.1.4a or later

(Please note: the UW7 build supplement above is a forward-looking requirement.
 At the time of this writing it does not yet exist, but should. However, all
 UnixWare builds can be done on OpenServer 6).

These scripts mandate a certain layout. There is a root directory in which
all PI work is done. Lets call this $PIROOT. Under this directory, you
must create a dist directory, and then dist/osr5 and dist/uw7. The name
uw7 is hisorical, and is where you put OSR6 archives as well.

After building each tree, you place an archive of the install tree in
$PIRROOT/dist/osr5 or $PIROOT/dist/uw7.  Each package's archive must be
a specific name in that directory:

  GWXLIBS                      $PIROOT/dist/OS/gwxlibs.cpio
  X.Org                        $PIROOT/dist/OS/xorg.cpio
  ViM                          $PIROOT/dist/OS/vim.cpio
  Squid                        $PIROOT/dist/OS/squid.cpio
  Apache                       $PIROOT/dist/OS/apache.cpio
  Perl                         $PIROOT/dist/OS/perl.cpio
  Extended Shells              $PIROOT/dist/OS/extshells.cpio
  Python                       $PIROOT/dist/OS/python.cpio
  OpenSSH                      $PIROOT/dist/OS/openssh.cpio
  GNU Development Tools        $PIROOT/dist/OS/gnutools.cpio

Each of those archives *must* have as their top level directory the name of
the archive itself. For example, extracting gwxlibs.cpio should result in
a directroy gwxlibs being created, under which are the installation directories
for that package. If you follow all of the build procedures then this will all
be set up correctly.

Setting up of $PIROOT/dist is part of the actual build process. It will
require co-operating between two build machines (one where the OSR5 build
happens and one where the OSR6/UW7 build happens). It is highly recommended
that the final PI phase takes place on an OSR6 machine, as that is where
the CDMT tools work best.

Once $PIROOT/dist has been correctly populated, you are ready to start the
actual PI process. The first step in this process is to populate the rest
of $PIROOT with scripts from the source directories and from this directory.
This is accomplished using the `piprep' script found in this directory. You
must pass this script two arguments: the location of $PIROOT, and the location
of the opensrc source directory (in other words, the parent directory of where
this file is).  For example:

  ./piprep /pi/opensrc /u/opensrc

This will copy all of the packaging scripts to $PIROOT/data, which is where
the various MetaPKG control scripts expect to find them.  Note that this
process will copy all packaging files, even if you will be packaging a
given product of not. You can select which packages to productize later.

Also note that the source directory must be laid out in a specific manner.
The source code for all of the products (whether you are packaging them
and rebuilding them or not) should be in this directory, and each subdirectory
should be the same name as the archives as mentioned above (for example, the
source for GWXLIBS must be in /u/opensrc/gwxlibs). Note that the one special
exception to this is that the GWXLIBS source directory, as of GWXLIBS 3,
contains the X.org server. However, all of the packaging scripts are still
in the old xorg direcotry, which is all that that source archive contains.

Once this prep work has been done, you are ready to do the actual final
PI phase, which creates a lot of data. Please ensure you are attempting
this on a filesystem which has at least 20GB of free space.

The mkopensrc script
====================

NOTE: THIS SCRIPT MUST BE INVOKED FROM $PIROOT!

This script is what drives the entire PI process. This is where you select
which of the open source products to package, and for which operating
systems. To understand how to use this script you should first understand
the different ways in which these packages are used. There are two main
ways in which these packages are used: either a part of a larger bundle,
such as a maintenance pack or full OS release, or as stand-alone packages
meant to upgrade older releases (or to be deployed on the not-current
revision of each OS). The two mechanisms are called bundled and standalone,
respectively. If you are building a standalone version, and the same revision
of the package is also destined for inclusion in a maintenance pack, then
you must tell the script this. This is so that pre-install scripts can be
put in place that will tell you that the software is bundled in an MP and
that you should install it from within the MP.  For example, GWXLIBS 2.1.0Ce
is being bundled in OSR507MP5, and in OSR600MP2. When producing the standalone
version of the GWXLIBS package (for installation on 506, for example), you
want to ensure that if a user attempts to install it on 507 that they are
told to install MP5 rather than the stand-alone version (or MP2 if they
try to install it on OSR6).

So, the first choice you need to make is what type of packages you will
be producing: bundled, standalone or both. Yo do this using the -type
command line option and set it to (you guessed it), bundled, standalone or
both:

   ./mkopensrc -type=both
   ./mkopensrc -type=bundled
   ./mkopensrc -type=standalone

If you do not specify a type, 'both' is assumed.

Next, if you are creating a standalone package, you need to tell the script
which maintenance pack each product appears in, if any. Each product's
control script usually knows this, so you only need to specify this if you
want to over-ride the default set in the packaging files. This is highly
discouraged, however. The better approach is to modify the control script
in each packages PACKAGING/metapkg.* file and set the correct MP there.
However, if for some reason you do wish to override the defaults at the
time you call this script, here's how you do it.  For each package name
you wish to override, you need to use the -osr5mp, -osr6mp or -uw7mp
command line argument, for specifying the respective MP numbers for each
OS.  This option takes the name of a package, followed by a colon and the
MP number.  The name of the package is the same as its CPIO archive name
(so, gwxlibs for GWXLIBS, openssh for OpenSSH etc).  Examples:

  ./mkopensrc -osr5mp=gwxlibs:5 -osr5mp=openssh:5
  ./mkopensrc -osr6mp=xorg:2 -osr5mp=xorg:0

NOTE: If you specify an MP of 0, it means that this package is not included
in any maintenance pack.  If you want to specify the MP for all packages,
by special dispensation you can use the package name 'all':

  ./mkopensrc -osr5mp=all:5 -osr6mp=all:2 -uw7mp=all:3

Next step is to tell the control scripts what the minumum maintenance pack
required for a standalone install is.  This obviously only has meaning if
you have not specified that this is included in a maintenance pack already
(using the arguments just discussed above). This uses the same argument
format as described above, except that the actual arguments are
-needosr5mp, -needosr6mp and -needuw7mp for the three OS types respectively.
If you specify both -osr5mp and -needosr5mp (thus telling this script that
the package both in a specified MP and requires a specific minumum MP, then
the package will behave as if no minimum MP argument was supplied, and
assume that the package is installed in the MP specified).

Next, you must decide which packages you wish to productize. The list of
valid packages this script knows how to deal with is given above where
the archive names are specified. If you want to produce an authorotative
list, you can run mkopensrc with the single word 'list' as its sole arguement
and it will list the valid package names. Use the -pi=LIST argument to
specify the products to package, where LIST is a comma separated list of
valid product names.  You can negate products by prefixing its name with
a '-'.  You can use the keyword 'all' to specify all products, which you
must do if you want to negate just one or two products. For example:

  ./mkopensrc -pi=all,-gnutools
  ./mkopensrc -pi=vim,apache,squid
  ./mkopensrc -pi=all,-gwxlibs,-xorg

Last, but not least, you must decide which operating systems to create
packages for. You do this using the -os command line option, and this can
be a comma separated list consisting of osr5, osr6 or uw7. If not specified,
the default is all.

In order to package for all OSes, you need to have all of the distribution
archives in place.  If you are packaging only for OSR5, then you obviously
only need the dist/osr5 archives in place, and if you are packaging only
for UW7 then you onlt need the dist/uw7 archives in place. OSR6 requires
both (as certain packages like Xorg, GWXLIBS and Perl require pieces from
both builds).

If you do not specify any arugments to the script at all, it will create
archives for all three OSes, both bundled and standalone, as well as
"PI handoff" archives for bundled packages. A "PI archive" is a specially
named CPIO archive (based on the date and package name) that contains all
of the raw CDMT fodder necessary for integration with an OS release or
maintenance pack.

Output
======

If all goes well, the process will create a directory called 'output'
that has the following structure:

  output/OS/bundled
  output/OS/standalone
  output/OS/archives

The 'bundled' and 'standalone' directories will contain cpio archives
of the CDMT tree, and the 'archives' directory will contain the VOL
images or *.pkg files for the standalone installation.

Good luck!

Please send me (jkj@sco.com) any comments, questions or suggestions.
