Remove CVS cruft. Revert mangled manpages.
[sw-tools] / perl / sw-cgi.1
CommitLineData
961ce1c2 1.\" -*-nroff-*-
2.\"
e55daacc 3.\" $Id$
961ce1c2 4.\"
5.\" Man page for `sw' CGI script
6.\"
7.\" (c) 1999 EBI
8.\"
9.
10.\"----- Licensing notice ---------------------------------------------------
11.\"
12.\" This file is part of sw-tools.
13.\"
14.\" sw-tools is free software; you can redistribute it and/or modify
15.\" it under the terms of the GNU General Public License as published by
16.\" the Free Software Foundation; either version 2 of the License, or
17.\" (at your option) any later version.
18.\"
19.\" sw-tools is distributed in the hope that it will be useful,
20.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
21.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22.\" GNU General Public License for more details.
23.\"
24.\" You should have received a copy of the GNU General Public License
25.\" along with sw-tools; if not, write to the Free Software Foundation,
26.\" Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27.
e55daacc 28.\"----- Style hacking ------------------------------------------------------
29.
30.de VS \" Start a sort-of verbatim block
31.sp 1
32.in +5n
33.nf
34.ft B
35..
36.de VE \" Stop a sort-of verbatim block
37.ft R
38.fi
39.in -5n
40.sp 1
41..
42.ie \n(.g \{\
43. fam P
44. ds mw \fR[\f(BImdw\fR]
45.\}
46.el .ds mw \fR[\fBmdw\fR]
47.ie t .ds o \(bu
48.el .ds o o
49.ds sw \fBsw\fP
50.
51.\"----- Main manual text ---------------------------------------------------
52.
53.TH sw-cgi 1 "30 July 1999" sw-tools
54.PD 1
55.
56.\"--------------------------------------------------------------------------
57.
58.SH "NAME"
59.
60sw-cgi \- CGI script for browsing installed software and documentation
61.
62.\"--------------------------------------------------------------------------
63.
64.SH "SYNOPSIS"
65.
66.IB prefix /cgi-bin/sw
67.RI [ key = value ]...
68.
69.\"--------------------------------------------------------------------------
70.
71.SH "DESCRIPTION"
72.
73The
74.B sw
75CGI script provides users with a pleasant-ish interface for browsing the
76list of locally installed software and its documentation.
77.PP
78The script picks up arguments from HTTP
79.B GET
80or
81.B POST
82requests, or from the command line (which is useful when debugging).
83Given no arguments, it emits a table of installed software read from the
84index file in
85.IB prefix /sw-index
86together with links to documentation.
87.PP
88The program assumes that any
89.I package
90has documentation stashed in
91.IB prefix /doc/ package
92in plain text format. You can require your installers to do this by
93putting this code in a
94.B sw-precommit
95script (see the
96.B "Command reference"
97in
98.BR sw (1)
99for details):
100.VS
101# --- Ensure the documentation file exists ---
102
961ce1c2 103if [ ! -r "$SW_PREFIX/doc/$SW_PACKAGE" ]; then
104 echo >&2 "no documentation file \`$SW_PREFIX/doc/$SW_PACKAGE'"
105 exit 1
106fi
107.VE
108Links to these documentation files are put into the table
109automatically. The script picks out likely-looking references to other
110sources of information:
111.TP
112.I "manual pages"
113A reference of the form
114.IB name ( section )
115is suspected of being a manual page; the script looks in the manual
116directories to see if this is the case and if so inserts a hypertext
117link to the manual page. This is the standard form for manual page
118references.
119.TP
120.I "info manuals"
121A reference of the form
122.BI info: name
123is assumed to be a reference to the GNU Info manual called
124.I name
125and an appropriate link inserted. There isn't a standard form for Info
126references in non-Info manuals, so I've invented one.
127.TP
128.I "URLs"
129A URL which begins with one of
130.B http://
131or
132.B ftp://
133is spotted and turned into a link. Only these two work.
134.TP
135.I "email addresses"
136Something that looks like an email address is turned into a
137.B mailto
138link.
139.PP
140Similar transformations are applied to manual pages when they're
141formatted.
142.
143.SS "Script arguments"
144The behaviour of the script is determined by the value of the
145.B act
146key. Any of the following may be given:
147.TP
148.B list
149Emit the list of packages in tabular form. This is the default if no
150.B act
151is given.
152.TP
153.B doc
154Format a textual documentation file. The name of the package whose
155documentation is to be emitted is given as the value of the
156.B pkg
157key.
158.TP
159.B man
160Format a manual page, or emit a manual index. If no
161.B sec
162key is given, an index of all manual pages in the software area is
163produced. If
164.B sec
165is a manual page section (e.g.,
166.BR 1 ,
167not
168.BR man1 )
169but
170.B man
171is not given then an index of that particular section is emitted. If
172both
173.B sec
174and
175.B man
176are supplied then the manual page whose name is given by the
177.B man
178key in the section given by the
179.B sec
180key is formatted (using
181.BR nroff (1))
182and displayed. Manual page references, URLs and email addresses are
183transformed into links in the output.
184.TP
185.B info
186Format a GNU Info node. If the
187.B file
188key is given, its value names an Info manual to open; the default is
189.BR dir .
190If the
191.B node
192key is given, its value names a node within the manual; the default is
193.BR Top .
194.TP
195.B show-config
196Emits a table showing the configuration settings which the script is
197aware of. See
198.B Configuration
199below. This is useful during debugging.
200.TP
201.B show-environment
202Displays the environment variables passed to the script by the Web
203server. This is useful during debugging.
204.TP
205.B show-query
206Displays the query string passed by the Web server, decomposed into keys
207and values and decoded. This is useful during debugging.
208.
209.SS "Configuration"
210The
211.B sw
212CGI script needs some configuration before it can do its work properly.
213Indeed, it will refuse to run until the configuration file has been
214edited.
215.PP
216The configuration file is in
217.IB prefix /share/sw.conf\fR.
218The format is simple. A line may be empty, or a comment, in which case
219it is ignored. Comments have
220.RB ` # '
221as their first non-whitespace character; blank lines contain only
222whitespace. A line may also contain a configuration variable
223assignment, of the form
224.I key
225.RB [ = ]
226.IR value .
227The
228.I key
229may be anything you like; only certain keys make sense to the script.
230.PP
231Configuration keys currently used are:
232.TP
233.B pkg
234The name of the package in which the script came. This is set
235automatically and you should not change the value.
236.TP
237.B version
238The version number of the package. This is set automatically and you
239should not change the value.
240.TP
241.B edited-config-file
242Must be assigned the value
243.BR yes .
244If this is not the case the script will immediately report an error.
245The default configuration file comes with a commented-out assignment to
246this variable.
247.TP
248.B prefix
249The installation prefix where your software gets installed. You
250shouldn't need to change this, although it's handy for debugging.
251.TP
252.BR index ", " doc " and " datadir
253The name of the index file, documentation directory and shared data
254directory respectively. The default values of these variables are set
255automatically and you shouldn't need to change them.
256.TP
257.B domain
258Your email domain. Set this to the domain part for email addresses of
259people at your site, and the script will generate correct links in its
260main list page.
261.
262.\"--------------------------------------------------------------------------
263.
264.SH "SEE ALSO"
265.BR sw (1),
266.BR sw-info (5).
267.
268.SH "AUTHOR"
269.
270The \*(sw program, and this manual, are \*(mw productions, in association
271with the European Bioinformatics Institute. They were written by Mark
272Wooding <mdw@nsict.org>. Go and ask him if you have problems.
273.
274.\"----- That's all, folks --------------------------------------------------