/opt/ast is a good PACKAGEROOT for ast package building and installation. An /opt/ast installation is FHS compliant, except that the probe(1) command generates and installs its information files under /opt/ast/lib/probe. probe will be changed to generate these files under the compliant /var/opt/ast/lib/probe in a future release.

The following instructions will build and install ast source packages under /opt/ast.

First make sure there is an /opt/ast/bin directory and export it in PATH:

mkdir -p /opt/ast/bin
export PATH
This is how ast commands locate related files and plugins. For example, the ast file(1) command locates its magic file by searching for ../lib/file/magic on $PATH.

If there is no /opt/ast/bin/package command then grab the latest:

if	test ! -x /opt/ast/bin/package
	(curl -L $url || wget -O - $url || hurl $url) > /opt/ast/bin/package
	chmod +x /opt/ast/bin/package

To build for the first time:

cd /opt/ast
package authorize "name" password "password" setup flat \
	source http://www.research.att.com/sw/download package ...
package make
package test # run optional regression tests
where package is ast-open, ast-base, ast-ksh or some other package name posted at the download URL. After the first time the update-read-build cycle for all previously loaded packages from the most recent url is:
package setup flat
package make
package test
New packages can be downloaded by specifying them as a package setup command argument:
package setup source package

To install binary packages change the source operand to binary:

package setup flat binary package
To use just export /opt/ast/bin in PATH.

If you plan to have multiple architectures under /opt/ast (e.g., cygwin.i386 and linux.i386), then you can build and install binary commands in /opt/ast/arch/$(package)/bin instead of /opt/ast/bin by dropping the flat operand from the package command line. Then to access the foo.bar binaries export /opt/ast/arch/foo.bar/bin in PATH.

If you prefer to build and test packages in a separate PACKAGEROOT before installing in /opt/ast, then run this from the alternate INSTALLROOT (PACKAGEROOT/arch/HOSTTYPE) to install in /opt/ast:

cp -pr bin fun include lib man /opt/ast

June 29, 2012