Stupid thing doesn't automatically distribute manpages.
[sw-tools] / sw.1
CommitLineData
3315e8b3 1.\" -*-nroff-*-
2.\"
91f52355 3.\" $Id: sw.1,v 1.2 1999/06/04 13:56:09 mdw Exp $
3315e8b3 4.\"
5.\" Manual page for `sw'
6.\"
7.\" (c) 1999 EBI
8.\"
9.\"----- Licensing notice ---------------------------------------------------
10.\"
11.\" This file is part of sw-tools.
12.\"
13.\" sw-tools is free software; you can redistribute it and/or modify
14.\" it under the terms of the GNU General Public License as published by
15.\" the Free Software Foundation; either version 2 of the License, or
16.\" (at your option) any later version.
17.\"
18.\" sw-tools is distributed in the hope that it will be useful,
19.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
20.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21.\" GNU General Public License for more details.
22.\"
23.\" You should have received a copy of the GNU General Public License
24.\" along with sw-tools; if not, write to the Free Software Foundation,
25.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26.\"
27.\"----- Revision history ---------------------------------------------------
28.\"
29.\" $Log: sw.1,v $
91f52355 30.\" Revision 1.2 1999/06/04 13:56:09 mdw
31.\" Changes, extensions, polishings, spelling fixes...
32.\"
33.\" Revision 1.1.1.1 1999/06/02 16:53:33 mdw
34.\" Initial import.
3315e8b3 35.\"
36.\"
37.\" --- Useful macro definitions ---
38.\"
91f52355 39.de VS \" Start a sort-of verbatim block
3315e8b3 40.sp 1
41.in +5n
42.nf
43.ft B
44..
91f52355 45.de VE \" Stop a sort-of verbatim block
3315e8b3 46.ft R
47.fi
48.in -5n
49.sp 1
50..
91f52355 51.de HP \" Start an indented paragraph with a bold right-aligned label
52.IP
53\fB\h'-\w'\\$1\ 'u'\\$1\ \fP\c
54..
3315e8b3 55.\"
91f52355 56.\" --- Style hacking ---
3315e8b3 57.\"
58.ie \n(.g \{\
59. fam P
91f52355 60. ds mw \fR[\f(BImdw\fR]
3315e8b3 61.\}
91f52355 62.el .ds mw \fR[\fBmdw\fR]
63.ie t .ds o \(bu
64.el .ds o o
65.ds sw \fBsw\fP
3315e8b3 66.\"
67.\" --- Main manual text ---
68.\"
69.TH sw 1 "25 May 1999" "EBI tools"
70.PD 1
71.\"
72.SH NAME
73sw \- tool for convenient software installation
74.\"
75.SH SYNOPSIS
76.nf
91f52355 77\fBsw \-\-help
78\fBsw \-\-help-full
79\fBsw \-\-version
80\fBsw \-\-archname
81\fBsw \-\-remote \fIcommand
3315e8b3 82
91f52355 83\fBsw all\-arch
3315e8b3 84\fBsw arch
91f52355 85\fBsw commit
86\fBsw \fR[\fB\-fbi\fR] [\fB\-a \fIarch\fB,\fIarch\fR...] [\fB\-o \fIstyle\fR] \fBconfigure \fR[\fIconfigure-arg\fR...]
3315e8b3 87\fBsw host \fIarch
88\fBsw \fR[\fB\-f\fR] [\fB\-a \fIarch\fB,\fIarch\fR...] \fBlinktree
89\fBsw listarch
90\fBsw \fR[\fB\-fbi\fR] [\fB\-a \fIarch\fB,\fIarch\fR...] [\fB\-o \fIstyle\fR] \fBmake \fR[\fImake-arg\fR...]
91f52355 91\fBsw only\-arch \fIarch \fR[\fIarch\fR...]
3315e8b3 92\fBsw reset
93\fBsw rsh \fIhost\fR|\fIarch \fR[\fIcommand \fR[\fIargument\fR...]]
94\fBsw \fR[\fB\-fbi\fR] [\fB\-a \fIarch\fB,\fIarch\fR...] [\fB\-o \fIstyle\fR] \fBrun \fIcommand \fR[\fIargument\fR...]
95\fBsw setup \fIpackage version \fR[\fImaintainer\fR]
96\fBsw \fR[\fB\-f\fR] [\fB\-a \fIarch\fB,\fIarch\fR...] \fBsnaplink \fIfile \fR[\fIfile\fR...]
97\fBsw status
98.ft R
99.fi
100.\"
101.\"
102.SH "INTRODUCTION"
91f52355 103The \*(sw tool attempts to take a lot of the work out of building and
104installing source packages across multiple architectures. This section
105will describe how to use \*(sw's features to best advantage in a number
106of common situations.
3315e8b3 107.PP
108To keep things concrete, I'll describe how things are done at the EBI,
91f52355 109although there's nothing EBI-specific about the \*(sw program itself.
110For details about how we handle software at EBI, see the
3315e8b3 111.B Local quirks
112section below.
113.PP
114By the way, this is quite a large manual. I recommend that you print a
115copy onto paper and peruse it in a leisurely fashion, rather than
116squinting at a monitor.
117.\"
118.\"
119.SH "SUMMARY OF BUILDING PACKAGES"
120First, the
91f52355 121.B Autoconf
3315e8b3 122case:
123.VS
124.BI "sw setup " "package version"
125.B "sw only \c"
126.IR "arch " [ arch ...]
127.ft B
128sw configure
129sw make
130sw \-i make install
131sw commit
132.VE
133Secondly, the
91f52355 134.RB non- Autoconf
3315e8b3 135case:
136.VS
137.BI "sw setup " "package version"
138.B "sw only \c"
139.IR "arch " [ arch ...]
140.B "sw linktree"
141.BI "sw snaplink \c"
142.IR "file " [ file ...]
143.I [edit the appropriate files]
144.ft B
145sw make
146sw \-i make install
147sw commit
148.VE
149.\"
150.\"
151.SH "8 STEPS TO INSTALLING A PACKAGE"
152The following steps will guide you through your first (and maybe second)
153package installations. In the description, I'll use
154.RI ` package '
155to refer to the package's name, and
156.RI ` version '
157to refer to its version number.
158.PP
159Not all the important features and options are described in this part of
91f52355 160the manual. View it more as a taster for the sorts of things \*(sw can
161do, and a suggestion
3315e8b3 162.SS "1. Download the source distribution"
163Download the package's source distribution. This will normally be in an
164archive called something like
165.IB package - version .tar.gz\c
166\&. At EBI, we put source archive files in
167.BR /sw/common/tr .
168.SS "2. Unpack the source tree"
169Unpack the source tree into the standard source directory. Each source
170tree should have its own directory. Most well-packaged source
171distributions unpack themselves into a neat directory, but less
172fastidious programmers make archives which scatter files all over the
173current directory.
174.PP
175At EBI, we put the source trees in
176.BR /sw/common/src ,
177so unpacking a well-formed source distribution looks like:
178.VS
179cd /sw/common/src
180.BI "gzip \-dc ../tr/" package \- version ".tar.gz | tar xfv \-"
181.VE
182Ill-formed source distributions involve making the directory for the
183package first, changing into it, and then unpacking into the current
184directory:
185.VS
186cd /sw/common/src
187.BI "mkdir " package \- version
188.BI "cd " package \- version
189.BI "gzip \-dc ../../tr/" package - version ".tar.gz | tar xfv \-"
190.VE
191When you've finished unpacking, make sure that your current directory is
192the top level directory of the source tree you unpacked.
91f52355 193.SS "3. Tell \\*(sw what you're up to"
194Now you need to tell \*(sw what you're working on. It will keep track of
195this and other bits of information in a little file and refer to it
196every now and then. It will also whinge at you and refuse to cooperate
197if it can't find its little file, so it's as well to oblige.
3315e8b3 198.PP
91f52355 199To tell \*(sw to create this little file and initialize it with sensible
200values, you just need to say
3315e8b3 201.VS
202.BI "sw setup " "package version"
203.VE
204What could be easier?
205.SS "4. Restrict the build to particular architectures"
206Some packages don't work on all architectures, either because the author
207wasn't sufficiently good at writing portable software, or because the
208program's doing inherently nonportable things.
209.PP
91f52355 210If that's the case, then you need to tell \*(sw to only build on the
211architectures that really work. Do this with the
3315e8b3 212.RB ` "sw only" '
213command. For example, if your package only works on Linux and Solaris,
214say:
215.VS
216sw only i386-linux sparc-solaris
217.VE
91f52355 218You can get a list of the architecture names that \*(sw understands by
219typing
3315e8b3 220.VS
221sw listarch
222.VE
223With a little bit of luck, these names ought to be self-explanatory.
224.PP
225If your package is properly portable and works everywhere then you don't
226need to do anything for this step. Skip on to the next one.
227.SS "5. Configure the package"
228Now it gets complicated. If the package you're building uses
91f52355 229.B Autoconf
3315e8b3 230to configure itself for its current environment then you're in luck.
231You can tell an
91f52355 232.B Autoconf
3315e8b3 233package because there's a script called
234.B configure
235in the top source directory, and a file called
236.BR Makefile.in .
237If it
238.I does
239use
91f52355 240.B Autoconf
3315e8b3 241then run
242.VS
243sw configure
244.VE
245to configure the package on all the platforms it's meant to be built
246for. When you've done that, move onto the next step.
247.PP
248If the package
249.I doesn't
250use
91f52355 251.B Autoconf
3315e8b3 252then all is not lost (although it may be worthwhile complaining at the
253package's author or maintainers). You need to make a collection of
254.IR "link trees" ,
255one for each architecture. These link trees are little replicas of the
256main source tree but with symbolic links instead of the real source
257files. To make the link trees, run
258.VS
259sw linktree
260.VE
261Now, that's not actually quite what you wanted. It's made a link for
262.I every
263file in the source tree. Unfortunately, there are some files you'll
264(probably) have to modify for each architecture in order to configure
265the package to build properly. You can turn links in the link trees
266into real independently editable files by
267.I snapping
268the links. Say for example that
269.B Makefile
270and
271.B config.h
272need to be modified for each architecture. Running the command
273.VS
274sw snaplink Makefile config.h
275.VE
276is sufficient to do the right thing.
277.PP
278Now you must edit the snapped files to configure the package. Make sure
279that the install directories are correctly set. At EBI, all the
280software should be configured so that architecture neutral files end up
281under
282.B /sw/common
283and architecture-specific files end up under
284.BI /sw/common/arch/ arch\c
285\&.
286.SS "6. Build the package"
287Now you've laid the groundwork, everything ought to be easy. Making the
288program ought to involve simply typing
289.VS
290sw make
291.VE
292and waiting for a while. If you had the
293.B curses
91f52355 294library available when \*(sw was built, then your terminal will split
295itself into little independently scrolling windows showing you the
296progress for each architecture. If you're not privileged enough to have
3315e8b3 297.B curses
298then you get the output appropriately tagged with architecture names,
299which is unfortunately fairly hard to read.
300.SS "7. Install the package"
301Most source packages (and almost certainly all
91f52355 302.B Autoconf
3315e8b3 303ones) have a
304.B make
305target
306.RB ` install '
91f52355 307which installs the program correctly. You can run this from \*(sw by
308saying
3315e8b3 309.VS
310sw \-i make install
311.VE
312The little
313.RB ` \-i '
91f52355 314option there tells \*(sw that this is the
3315e8b3 315.IR "install step" .
316When an architecture completes this step correctly, it's marked as being
91f52355 317properly installed, and \*(sw doesn't bother thinking about it again.
3315e8b3 318.PP
319If you
320.I don't
321have an
322.RB ` install '
323makefile target, then you have to install things manually. That's not
324much fun, so moan at the package's author. When you've finished
325fiddling with installation, run
326.VS
327sw -i run true
328.VE
91f52355 329just to tell \*(sw that you've installed everything OK. (This is a bit
330of a kludge.)
3315e8b3 331.SS "8. Update the index"
332Now that everything's built and installed, there's just one more command
333to type:
334.VS
335sw commit
336.VE
91f52355 337This makes \*(sw update its main index of installed packages, telling it
338which architectures packages are installed on, and who did it.
3315e8b3 339.\"
340.\"
341.SH "REFERENCE INTRODUCTION"
342That was a gentle introduction. This section contains the complete
343reference to
344.BR sw :
345far more detail that you probably want. If that's really the case, try
346running
347.VS
348sw \-\-help\-full
349.VE
350to read the available help text. There's quite a lot of it, and it
351ought to keep you occupied for a while.
352.PP
91f52355 353The basic \*(sw command line looks a bit like:
3315e8b3 354.sp 1
91f52355 355.RS 5
356.B sw
3315e8b3 357.RI [ options ]
358.RI [ command
359.RI [ argument ...]]
360.RE
361.sp 1
362If you just say
363.VS
364sw
365.VE
91f52355 366at the shell prompt, \*(sw gives you an extremely terse usage summary
367and quits. You have to tell it to do
3315e8b3 368.IR something .
91f52355 369Most of the time you do this by giving \*(sw a
3315e8b3 370.IR command ,
371like
372.RB ` setup '
373or
374.RB ` make '
375so that it knows what to do. There are some strange command line
91f52355 376options which cause \*(sw to do more exotic things, though.
3315e8b3 377.\"
378.\"
379.SH "IMPLEMENTATION ODDITIES"
91f52355 380The \*(sw program that users use is really a small architecture-neutral
381shell script, which works out the current architecture and executes the
3315e8b3 382appropriate architecture-specific main program. It's done this way so
91f52355 383that \*(sw knows that it can use the shell script to start itself up on
384a remote host with a different architecture, something which it does
385quite a lot. The only feature provided by the front-end shell script is
386the
3315e8b3 387.B \-\-archname
91f52355 388command line option, which shouldn't be used by anyone except \*(sw's build procedure anyway.
3315e8b3 389.\"
390.\"
391.SH "COMMAND LINE OPTION REFERENCE"
91f52355 392Any \*(sw command line options can be put in the
3315e8b3 393.B SW
91f52355 394environment variable. The \*(sw program will read space-separated
395options from this variable before it reads the command line itself.
3315e8b3 396.PP
91f52355 397The \*(sw program usually understands two different names for each
398option: a traditional Unix single-character name, and a long GNU-style
399name. The short options behave in the normal Unix way: you can join
400them together into single words with a
3315e8b3 401.RB ` \- '
402at the front, for example. The long names are always preceded by a
403double dash. You can abbreviate long names as much as you like, as long
404as the resulting abbreviation is unambiguous. In the descriptions
405below, both the short and long names of the options are shown, but for
406reasons of brevity required arguments are only shown for the long form.
407.PP
91f52355 408There are conceptually two types of \*(sw command line options: those
409which, usually for reasons of consistency with other programs, cause
410\*(sw to do something immediately; and those which store some settings
411for particular commands. The latter type are generally more useful.
412It's worth bearing in mind, though, that the options are only used by a
413few commands. The command reference describes exactly which commands
414use which options.
3315e8b3 415.PP
416The complete list of command line options understood by the current
91f52355 417version of \*(sw is as follows:
3315e8b3 418.TP
419.B "\-h, \-\-help"
91f52355 420Writes a fairly brief summary of \*(sw's command line options and a usage line for each of \*(sw's commands to standard output, and exits successfully.
3315e8b3 421.TP
422.B "\-H, \-\-help\-full"
91f52355 423Writes a summary of \*(sw's command line options and a full paragraph of description for each of \*(sw's commands to standard output, and exits successfully. There's a lot of
3315e8b3 424text generated by this option. I recommend you pipe it through a pager
425so that you can actually read it.
426.TP
427.B "\-v, \-\-version"
91f52355 428Writes \*(sw's version number to standard output and exits successfully. This is handy
429when trying to decide whether your version of \*(sw has a particular feature, for example.
3315e8b3 430.TP
431.B "\-u, \-\-usage"
432Writes a usage message so terse as to be nearly useless to standard
433output and exits successfully. This is different from just running
434.RB ` sw '
91f52355 435because although both print the same useless message, running \*(sw without any arguments is considered an error, so the message is sent to
436standard error and \*(sw will exit unsuccessfully.
3315e8b3 437.TP
438.BI "\-a, \-\-arch " arch , arch\fR...
439For commands which affect multiple architectures: only affect the
440architectures specified. The architecture names may be separated by
441commas, spaces or both, although clearly commas are most convenient on
91f52355 442the command line. Architecture names may be abbreviated as long as the
443abbreviation is not ambiguous.
444.IP
445This option overrides any other decisions that \*(sw might make about which architectures to process based on the
446.B only\-arch
3315e8b3 447list and the list of correctly built architectures for the current
448package.
449.TP
450.B "\-f, \-\-force"
451For commands which affect multiple architectures: affect even
452architectures that have been successfully built. This has no effect if
453there's a
454.RB ` \-a '
455option in force.
456.TP
457.B "\-i, \-\-install"
458For build commands: this is the final install step, so label architectures
459which successfully complete it as having been completely built. It's
460normal to specify this option on the
461.RB ` "make install" '
462build command.
463.TP
464.BI "\-o, \-\-output " style
465For build commands: select a style for the build output to be displayed
466in. See the section
467.B "Build commands"
468for more details on output styles.
469.TP
470.B "\-b, \-\-beep"
471For build commands: make a beep noise when the build finishes. This
472provides a handy reminder if you're getting on with something else while
473waiting for a long build.
474.PP
475The remaining options aren't really intended for users. They're helpful
91f52355 476for \*(sw's own purposes, though, and described here for completeness' sake. They
3315e8b3 477don't have standard Unix short name equivalents, because they're not
478usually useful for users.
479.TP
480.B "\-\-archname"
91f52355 481Writes the \*(sw architecture name of the current host to standard output. This is used
482by \*(sw's configuration script to determine the current architecture name. This
3315e8b3 483option is actually handled by a small shell script rather than by being
484passed on to the main program. You shouldn't use this option yourself:
485use the
486.RB ` arch '
487command instead. Because this option is handled by the shell script,
488and the script isn't very clever, you can't abbreviate
489.B \-\-archname
490on the command line, and it doesn't conflict with the similarly named
491but completely different
492.B \-\-arch
493option, which you can still abbreviate all the way down to just
494.RB ` \-\-a '.
495.TP
496.BI "\-\-me " name
91f52355 497Sets \*(sw's idea of its program name to
3315e8b3 498.IR name .
91f52355 499This is intended for use by \*(sw's front-end shell script, but isn't
500actually needed at the moment. I can't see why you'd want to play with
501this option, but it shouldn't do any harm.
3315e8b3 502.TP
503.BI "\-\-remote " remote-command
91f52355 504Used by \*(sw when running commands on remote hosts. Don't use this yourself: it puts \*(sw into a very unfriendly mode and requires that you communicate with it
3315e8b3 505using a bizarre binary packet protocol. If you really must know more
506about this, see the source code: it's quite well documented, really.
507.\"
508.\"
91f52355 509.SH TERMINOLOGY
3315e8b3 510The descriptions below make use of some technical terms:
511.TP
512.B "architecture restriction"
513A state created by the
514.B only\-arch
515command, restricting the
516.I "default build architectures"
517to those listed as arguments to the command. An architecture
518restriction may be cleared by
519.B all\-arch
520command.
521.TP
522.B "build architectures"
523The architectures which a
524.I "build command"
525will process. If the
526.RB ` \-a '
527option is specified on the command line, then its argument specifies the
528build architectures for this command; otherwise, the
529.I "default build architectures"
530are used.
531.TP
532.B "build command"
533A command which executes a process on multiple hosts simultaneously and
534reports the results. The processes executed usually perform some part
535of the building of a package. Currently, the build commands are
536.B run
537and its derivatives
538.B configure
539and
540.BR make .
541.TP
542.B "default build architectures"
543The architectures which, in the absence of a
544.RB ` \-a '
545command line option, are affected by a
546.IR "build command" .
91f52355 547To determine the default build architectures, \*(sw reads the list of all architectures from the
3315e8b3 548.B archtab
549file, and filters it: if the
550.RB ` \-f '
551command line option is
552.I not
553specified, then architectures marked as
554.I "successfully built"
555are removed from the list; if there is an
556.I "architecture restriction"
557in force, then the list is further filtered according to the
558restriction.
559.TP
560.B "successfully built"
561A package is considered to be successfully built on a given architecture
562if a build command given the
563.RB ` \-i '
564command-line option succeeds on a host of that architecture. The list
565of successfully built architectures can be cleared by the
566.B reset
567command. The
568.RB ` \-f '
91f52355 569option causes \*(sw to ignore whether architectures have been successfully built when
3315e8b3 570determining the
571.IR "default build architectures" .
91f52355 572.SH "COMMAND REFERENCE"
573This section describes all of the available \*(sw commands, in alphabetical order.
3315e8b3 574.\"
91f52355 575.SS all\-arch
3315e8b3 576Clears an architecture restriction set by
91f52355 577.RB ` only\-arch '.
3315e8b3 578Subsequent build commands will run across all known architectures not
579yet successfully built, unless overridden by the
580.RB ` \-a '
581command-line option, or a later
91f52355 582.RB ` only\-arch '
3315e8b3 583command.
584.\"
585.SS arch
586Writes the name of the local host's architecture to standard output.
91f52355 587The architecture name is built into \*(sw at compile time.
588.SS commit
589Writes information from the
590.B .sw\-info
591file to the installed packages index file
592.IB prefix /sw-index\fR.
593.PP
594All expected architectures must be built before a commit will work.
3315e8b3 595.\"
596.SS configure \fR[\fIconfigure-arg\fR...]
91f52355 597Equivalent to the command
598.VS
599.BI "run ../configure \-\-prefix=" prefix " " configure-arg\fR...
600.VE
601where
602.I prefix
603is the installation prefix with which \*(sw itself was configured. If you want to specify a different prefix, pass
604your own
605.B \-\-prefix
606argument.
607.PP
608It is expected that administrators will set up a file
609.IB prefix /share/config.site
610which sets up other Autoconf parameters once the prefix has been
611chosen. See the Autoconf manual for more information.
3315e8b3 612.\"
613.SS host \fIarch\fR
614Writes to standard output the name of a host with requested architecture
615.IR arch .
616The hostname is read from the
617.B archtab
618file.
619.\"
620.SS linktree
621Builds symbolic link trees. For each of the build architectures, a
622directory with the architecture's name is created containing a symbolic
623link corresponding to each file in the main source tree. Thus, a `make'
624in the link tree will fetch the source files correctly, but place the
625objects in the link tree rather than the main source tree, so that
626object files from different architectures don't interfere with each
627other.
628.PP
629If the link trees already exist, then rerunning
91f52355 630.B linktree
3315e8b3 631will update the links. This might be useful if the links somehow become
632invalid.
633.PP
634To turn some of the links in the link trees into real files, use the
635.B snaplink
636command.
637.\"
638.SS listarch
639Writes a list of all known architecture names to standard output. The
640list is obtained by reading the
641.B archtab
642file.
643.\"
644.SS make \fR[\fImake-arg\fR...]
91f52355 645Equivalent to
646.VS
647.BI "run make " make-arg\fR...
648.VE
649in all respects.
3315e8b3 650.\"
91f52355 651.SS only\-arch \fIarch arch\fR...
652Imposes an architecture restriction. Until cancelled by a later
653.B only\-arch
654or
655.B all\-arch
656command, the default build architectures will be limited to the
657architectures listed on the command line. Architecture names may be
658abbreviated as long as the abbreviation is not ambiguous.
659.\"
660.SS reset
661Clears the
662.I "successfully built"
663status of all architectures.
3315e8b3 664.\"
665.SS rsh \fIhost\fR|\fIarch \fR[\fIcommand \fR[\fIargument\fR...]]
91f52355 666Runs
667.I command
668on a remote host, passing it the list of
669.IR argument s.
670The
671.B "sw rsh"
672command is unlike the standard
673.B rsh
674program and its replacements:
675.HP \*o
676The
677.I command
678and
679.IR argument s
680are not subjected to further shell expansion on the remote host.
681.HP \*o
682The command is run with the remote current directory the same as the
683local current directory, rather than the remote user's home directory.
684.HP \*o
685The command is passed an environment constructed from the local
686environment, the default remote environment, and
687.B sw\-env
688files, as described in the section
689.B "Remote environment"
690below.
691.HP \*o
692The remote command is run with standard input attached to
693.BR /dev/null :
694there is no way of running an interactive remote command through
695.BR sw.
696.PP
697The host on which to run the remote command may be specified as one of:
698a standard host name (or IP address), an architecture name (which may
699.I not
700be abbreviated) signifying a host of the appropriate architecture, or
701the special name
702.RB ` \- '
703signifying the current host. (This last option may not sound useful,
704but it's handy for testing.)
3315e8b3 705.\"
706.SS run \fIcommand \fR[\fIargument\fR...]
91f52355 707Runs a command on all build architectures.
708.PP
709For each build architecture
710.IR arch ,
711\*(sw finds a host with the appropriate architecture, by choosing either
712the local host or reading the hostname from the
713.B archtab
714file. It then performs the following actions on that host:
715.HP 1.
716Sets the current directory to be the subdirectory named
717.I arch
718of the directory from which the command was issued. This directory is
719created if it doesn't already exist.
720.HP 2.
721Sets up an environment constructed from the environment prevailing when
722the command was issued, the default environment set up by
723.B rsh
724(or whatever equivalent remote execution program was actually used), and
725the
726.B sw\-env
727files, as described in the section
728.B "Remote environment"
729below.
730.HP 3.
731Executes the program named
732.I command
733passing it the given
734.IR argument s.
735.PP
736Output from the command is both appended to the file
737.IB arch/.build-log
738and output in some
739.IR "output style" ,
740as specified by the
741.RB ` \-o '
742command-line option. See the section
743.B "Output styles"
744below for more details.
745.PP
746If the
747.RB ` \-i '
748option was given on the command line, each architecture on which the
749command succeeds (i.e., reports a zero exit code) is marked as
750.IR "successfully built" ,
751and further build commands will not affect it unless the
752.RB ` \-f '
753command line option is passed, until a
754.B reset
755command is performed.
3315e8b3 756.\"
757.SS setup \fIpackage version \fR[\fImaintainer\fR]
91f52355 758Sets up various pieces of information required by \*(sw. The
759information here will be added into the main index file by a
760.B commit
761command. The information is maintained in a file named
762.B .sw\-info
763in the current directory.
764.PP
765The
766.I package
767should be the basic name of the package, with versioning information
768stripped off, e.g.,
769.RB ` emacs '
770or
771.RB ` perl ',
772not
773.RB ` emacs\-19.34 '.
774The
775.I version
776should be the version number of the package. The
777.I maintainer
778should be the name of the person principally responsible for maintaining
779the package's local installation. If this isn't specified, the calling
780user's name is used as the maintainer.
781.PP
782The
783.B setup
784command must be run before any build command.
3315e8b3 785.\"
786.SS snaplink \fIfile \fR[\fIfile\fR...]
91f52355 787Creates architecture-specific versions of a file. Every
788.I file
789named on the command line is copied to
790.IB arch / file
791for every build architecture
792.IR arch ,
793overwriting any existing file or symbolic link of that name. If
794.I file
795contains leading directories then destination directories are created as
796necessary for the output files. Note that the `snap' operation doesn't
797actually need to follow creation of link trees.
798.\"
799.\"
800.SH "OUTPUT STYLES"
801Output from a build command is presented in one of a number of named
802.IR "output styles" .
3315e8b3 803The style name
804.RB ` plain '
805is always defined: it simply prefixes each line of output with the
806name of the architecture which generated the line, which isn't actually
807particularly easy to read. Other output styles may have been configured
91f52355 808into \*(sw when it was compiled.
3315e8b3 809.PP
91f52355 810The set of output styles supported by \*(sw varies according to how it
811was configured. In any particular \*(sw program, you might have some of
812the following:
3315e8b3 813.TP
814.B plain
815Simply prefixes each output line with the name of the architecture it
816came from. This is quite hard to read, but it doesn't require any
817special operating system support or clever terminal.
818.TP
819.B curses
820Splits the terminal into independently scrolling areas, one for each
821architecture, with a status line for each. Waits for a keypress when
822all architectures are finished building.
823.PP
824The
825.RB ` plain '
91f52355 826style is used when the selected style doesn't work (for example, you
827don't have a sufficiently capable terminal for curses output).
3315e8b3 828.PP
829Output style names can be abbreviated as long as the abbreviation is
91f52355 830unambiguous. You can find the list of available output styles by
831executing the command
832.VS
833sw \-o help run
834.VE
835(which is a little counter-intuitive, I know).
3315e8b3 836.PP
837The author has plans to implement an X-based output style, but hasn't
838got around to it yet.
839.\"
840.\"
91f52355 841.SH "REMOTE ENVIRONMENT"
842The environment for a remote command (executed either through the
843.B rsh
844command, or a build command) is set up as follows:
845.HP \*o
846The complete environment passed to \*(sw is used as a basis.
847.HP \*o
848Any environment variables defined by the remote execution program
849(usually
850.BR rsh )
851override corresponding variables in the basis environment.
852.HP \*o
853Variable assignments are read from the global
854.IB prefix /share/sw\-env
855file. This makes some assignments which are useful everywhere, and will
856then usually include the file
857.B .sw\-env
858in the current directory.
859.PP
860The format of the
861.B sw\-env
862files is documented separately in
863.BR sw\-env (5).
3315e8b3 864.\"
865.\"
866.SH ENVIRONMENT
867The following environment variables are of interest to
868.BR sw :
869.TP
870.B SW
871Contains a space-separated list of default command-line options. These
872are read before, and overridden by, the actual arguments given on the
873command-line.
874.TP
91f52355 875.B SW_MAKE
876The name of the command to use to run a `make'. This is resolved on the
877local host once, rather than one for each build host, which is probably
878a misfeature. To do something more clever, point
879.B SW_MAKE
880at a shell script which then picks out the right architecture-specific
881.RB ` make '
882program from the remote environment.
883.TP
3315e8b3 884.B SW_RSH
885The name of the remote-shell program to use. By default, something
886similar to
887.B rsh
888is chosen. I recommend using the excellent
889.B ssh
890program instead.
891.\"
892.SH FILES
893The following files are of interest to
894.BR sw :
895.TP
91f52355 896.IB prefix /sw\-index
3315e8b3 897The main index file, containing the list of which packages have been
898installed for which architectures. See
899.BR sw-info (5)
900for file format details.
901.TP
902.IB prefix /share/archtab
903The architecture-to-host mapping file. See
904.BR archtab (5)
905for file format details.
906.TP
91f52355 907.IB prefix /share/sw\-env
3315e8b3 908Contains global environment variable settings. See
909.BR sw-env (5)
910for file format details.
911.TP
91f52355 912.IB package /.sw\-info
3315e8b3 913Contains the persistent information about a particular package's build
914status. See
915.BR sw-info (5)
916for file format details.
917.TP
91f52355 918.IB package /.sw\-env
3315e8b3 919Contains package-specific environment variable settings. See
920.BR sw-env (5)
921for file format details.
922.TP
91f52355 923.IB package / arch /.build\-log
3315e8b3 924Contains all the build output for a particular architecture. Usually
925not very interesting, but might be handy one day.
926.\"
927.SH BUGS
928There are no bugs in
929.BR sw ,
930merely unexpected behaviour modes. Silly you for thinking otherwise.
931.SH AUTHOR
91f52355 932The \*(sw program, and this manual, are \*(mw productions, in association
933with the European Bioinformatics Institute. They were written by Mark
3315e8b3 934Wooding <mdw@nsict.org>. Go and ask him if you have problems.
935.\"
936.\"----- That's all, folks --------------------------------------------------