| swb.8 |
swb - swpkg's software builder
swb -h
swb -V
swb swb_command [ command_options ] [ command_args ]
This manual page is a brief summary of the features of swb.
swb is essentially a simple shell wrapper intended to help
the user build software packages that are installed and
managed using swln. swb ensures that the build is fully
documented and therefore reproduceable with minimal effort
from the user. It also provides a lot of automation to
allow easily building the same software package on different
platforms, and to upgrade software packages.
In order to run swb, one must set the SWB_CONF environment
variable to be the path to the swb configuration file. The
configuration file is used to set a number of variables used
by swb, and follows the Perl syntax. The following vari-
ables must be set:
$use_pty
By default, swb will make use of IO::Pty if it is
installed in order to receive unbuffered output
from the processes it spawns. This variable can
be used to disable this feature.
$swbtmpdir
Path of the per-user directory used for state
files
$tarballs
Path of the shared directory where source tar
files are stored.
$swlibs
Path of the shared file recording which software
packages provide which libraries.
@buildenv
Array of environment variables set by swb prior to
running any command during the build process.
Note that this is the entire environment defined
by swb, any other variable is removed.
@syslibs
Array of directories where system libraries are
found. These must be included/used by the com-
piler.
$gdiff
Path to (preferrably GNU) diff.
$gpatch
Path to (preferrably GNU) patch.
$gtar
Path to (preferrably GNU) tar, along with the
flags needed to unpack an uncompressed tarball.
$swln
Path to swln.
The following is an example configuration file:
die "OGNAME is not defined!0 unless ( defined($ENV{'LOGNAME'}) );
$swbtmpdir = "/var/tmp/swb-$ENV{'LOGNAME'}";
mkdir $swbtmpdir unless ( -d $swbtmpdir );
$use_pty = 1;
$tarballs = '/home/src;
$swlibs = '/home/src/swb.libs';
@buildenv = ( 'PATH=%prefix%/bin:%prefix%/sbin:/bin:/usr/bin:/usr/sfw/bin:/sbin:/usr/sbin:/usr/sfw/sbin:/usr/ccs/bin',
'CPPFLAGS="-I%prefix%/include -I/usr/sfw/include"',
'CFLAGS="-L%prefix%/lib -L/usr/sfw/lib"',
'CXXFLAGS="-L%prefix%/lib -L/usr/sfw/lib"',
'LDFLAGS="-L%prefix%/lib -R%prefix%/lib -L/usr/sfw/lib -R/usr/sfw/lib"' );
@syslibs = ( '/lib', '/usr/lib', '/usr/sfw/lib' );
$gdiff = "/z/local/bin/diff";
$gpatch = "/z/local/bin/patch";
$gtar = "/usr/sfw/bin/gtar xf";
$swln = "/z/local/bin/swln";
swb init [ -L | -I | -l <session> ] [ -r ] [ -X ] [ -t tar-
name ] pkgname version
This command is used to initialize a new build session and
must be invoked in an empty directory. It looks for a
pkgname directory under the $tarballs directory. Under
there, it looks for a tar file named pkgname-version (or
tarname if the -t option was used) which it will unpack.
The -p option may be used to override the default target
directory where the package will ultimately be installed.
The -X option indicates that the target directory exists,
which is useful when adding to an already built package.
By default, swb will look for previous session logs for the
package you are about to install and use such logs to try to
automatically build the software. To prevent this, use the
-I option. Alternatively, if you want to force using a
specific session records for the new build, you may specify
it using -l.
swb analyze file
By default, swb will analyze a number of files after unpack-
ing a tar file, looking for various dependency clues. This
option allows one to scan any file that was not automati-
cally scanned.
swb check file
This command allows the user to record a file that needs to
be checked by swb during future builds of the package. If
the file has changed, then the script will abort.
swb edit file
Use this to launch an editor for the "script", "deps" or
"env" session file.
The "deps" file is used by swb to decide which other pack-
ages are depended upon and need to be linked (with swln)
under the target directory.
The "script" file is used by swb to automatically build the
package. swb will attempt to automatically generate the
"script" file if this command is invoked before any other
command.
The "env" file allows modifying the standard environment
defined in the $SWB_CONF file. Each line has three com-
ponents: action, variable name, value. The action is one of
"add" (to add a new environment variable), "prepend" (to
prepend to an existing environment variable), "append" (to
append to an existing environment variable) and "change" (to
replace an existing environment variable).
swb mods [ diff | apply ] file
Use this command to capture manual edits made to file. Such
edits can then be automatically applied in future sessions.
swb -c [ -v ] command
This will run the specified command using the sanitized
environment provided by swb.
swb run
Run the "script" file.
swb finish [ -l ]
Close the session. This command normally fails unless a
"script" file exists, but this behavious may be overriden by
using the -l option.
swb abort [ -r ]
Abort the session, optionally removing all logs and files if
-r is specified.
SWB_CONF
Path to the configuration file required by swb.
swchk(8), swinfo(8), swln(8), swreport(8).
The latest official release of swpkg is available on the
web. The home page is http://web.taranis.org/swpkg/
Christophe Kalt <swpkg@taranis.org>
© 2002-2008 - Christophe Kalt