Subject: Re: Bug#178583: Documentation (partial) written

From: Ola Lundqvist <[email-masked]>
Date: Tue, 22 Jul 2003 09:57:37 +0200

Hello

This is really great!

On Tue, Jul 22, 2003 at 11:43:07AM +1000, Matthew Palmer wrote:
> I've written an overview manpage for wwwconfig-common, along with the
> necessary rules info to include it in the built package.  I've included the
> complete patch, relative to 0.0.27.
> 
> In future, any manpages which are written for specific commands (and I think
> that most, if not all of them, need one, as well as an expansion of the best
> usage of the package as a whole), merely need to be put in the manpages
> directory, and everything will be taken care of automagically.

Did you write the manpage from scratch or did you use a tool to create it?

I'm not very good at raw manpage format. :)

I'll add this but modify the build things slightly.

I also think about making wwwconfig-common more general in that you can
configure more things than web-related things. What do you think about
such an idea?

Regards,

// Ola

> - Matt

> diff -uNr wwwconfig-common-0.0.27/debian/rules wwwconfig-common-0.0.27.mpalmer/debian/rules
> --- wwwconfig-common-0.0.27/debian/rules	Thu Aug 23 20:19:16 2001
> +++ wwwconfig-common-0.0.27.mpalmer/debian/rules	Tue Jul 22 11:32:22 2003
> @@ -8,6 +8,8 @@
>  # This is the debhelper compatability version to use.
>  export DH_COMPAT=2
>  
> +DESTDIR=$(CURDIR)/debian/wwwconfig-common
> +
>  clean:
>  	dh_testdir
>  	dh_testroot
> @@ -21,10 +23,16 @@
>  	dh_testroot
>  	dh_clean -k
>  	dh_installdirs
> -
> +	
>  	# Add here commands to install the package into debian/wwwconfig-common.
> -	cp *.func *.get *.sh $(CURDIR)/debian/wwwconfig-common/usr/share/wwwconfig-common
> -	rm -f $(CURDIR)/debian/wwwconfig-common/usr/share/wwwconfig-common/test.sh
> +	cp *.func *.get *.sh $(DESTDIR)/usr/share/wwwconfig-common
> +	rm -f $(DESTDIR)/usr/share/wwwconfig-common/test.sh
> +
> +	# Manpage version translation
> +	ver=`dpkg-parsechangelog | grep Version: | sed 's/^Version: //'`; \
> +	for i in manpages/*; do \
> +		sed "s/##PKG_VERSION##/$$ver/" $$i > $(DESTDIR)/usr/share/man/`basename $$i`; \
> +	done
>  
>  # Build architecture-independent files here.
>  binary-indep: install
> @@ -32,6 +40,8 @@
>  	dh_testroot
>  #	dh_installdebconf
>  	dh_installdocs
> +	dh_installman $(DESTDIR)/usr/share/man/*
> +	rm -f $(DESTDIR)/usr/share/man/*.[17]
>  #	dh_undocumented
>  	dh_installchangelogs 
>  	dh_link
> diff -uNr wwwconfig-common-0.0.27/debian/wwwconfig-common.dirs wwwconfig-common-0.0.27.mpalmer/debian/wwwconfig-common.dirs
> --- wwwconfig-common-0.0.27/debian/wwwconfig-common.dirs	Sun Feb 16 03:23:52 2003
> +++ wwwconfig-common-0.0.27.mpalmer/debian/wwwconfig-common.dirs	Tue Jul 22 11:19:39 2003
> @@ -1 +1,2 @@
>  usr/share/wwwconfig-common
> +usr/share/man
> diff -uNr wwwconfig-common-0.0.27/manpages/wwwconfig-common.7 wwwconfig-common-0.0.27.mpalmer/manpages/wwwconfig-common.7
> --- wwwconfig-common-0.0.27/manpages/wwwconfig-common.7	Thu Jan  1 10:00:00 1970
> +++ wwwconfig-common-0.0.27.mpalmer/manpages/wwwconfig-common.7	Tue Jul 22 11:26:47 2003
> @@ -0,0 +1,266 @@
> +.de Sh \" Subsection heading
> +.br
> +.if t .Sp
> +.ne 5
> +.PP
> +\fB\\$1\fR
> +.PP
> +..
> +.de Sp \" Vertical space (when we can't use .PP)
> +.if t .sp .5v
> +.if n .sp
> +..
> +.de Vb \" Begin verbatim text
> +.ft CW
> +.nf
> +.ne \\$1
> +..
> +.de Ve \" End verbatim text
> +.ft R
> +.fi
> +..
> +.\" Set up some character translations and predefined strings.  \*(-- will
> +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
> +.\" double quote, and \*(R" will give a right double quote.  | will give a
> +.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
> +.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
> +.\" expand to `' in nroff, nothing in troff, for use with C<>.
> +.tr \(*W-|\(bv\*(Tr
> +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
> +.ie n \{\
> +.    ds -- \(*W-
> +.    ds PI pi
> +.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
> +.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
> +.    ds L" ""
> +.    ds R" ""
> +.    ds C` ""
> +.    ds C' ""
> +'br\}
> +.el\{\
> +.    ds -- \|\(em\|
> +.    ds PI \(*p
> +.    ds L" ``
> +.    ds R" ''
> +'br\}
> +.\"
> +.\" If the F register is turned on, we'll generate index entries on stderr for
> +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
> +.\" entries marked with X<> in POD.  Of course, you'll have to process the
> +.\" output yourself in some meaningful fashion.
> +.if \nF \{\
> +.    de IX
> +.    tm Index:\\$1\t\\n%\t"\\$2"
> +..
> +.    nr % 0
> +.    rr F
> +.\}
> +.\"
> +.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
> +.\" way too many mistakes in technical documents.
> +.hy 0
> +.if n .na
> +.\"
> +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
> +.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
> +.    \" fudge factors for nroff and troff
> +.if n \{\
> +.    ds #H 0
> +.    ds #V .8m
> +.    ds #F .3m
> +.    ds #[ \f1
> +.    ds #] \fP
> +.\}
> +.if t \{\
> +.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
> +.    ds #V .6m
> +.    ds #F 0
> +.    ds #[ \&
> +.    ds #] \&
> +.\}
> +.    \" simple accents for nroff and troff
> +.if n \{\
> +.    ds ' \&
> +.    ds ` \&
> +.    ds ^ \&
> +.    ds , \&
> +.    ds ~ ~
> +.    ds /
> +.\}
> +.if t \{\
> +.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
> +.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
> +.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
> +.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
> +.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
> +.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
> +.\}
> +.    \" troff and (daisy-wheel) nroff accents
> +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
> +.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
> +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
> +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
> +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
> +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
> +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
> +.ds ae a\h'-(\w'a'u*4/10)'e
> +.ds Ae A\h'-(\w'A'u*4/10)'E
> +.    \" corrections for vroff
> +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
> +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
> +.    \" for low resolution devices (crt and lpr)
> +.if \n(.H>23 .if \n(.V>19 \
> +\{\
> +.    ds : e
> +.    ds 8 ss
> +.    ds o a
> +.    ds d- d\h'-1'\(ga
> +.    ds D- D\h'-1'\(hy
> +.    ds th \o'bp'
> +.    ds Th \o'LP'
> +.    ds ae ae
> +.    ds Ae AE
> +.\}
> +.rm #[ #] #H #V #F C
> +.\" ========================================================================
> +.\"
> +.IX Title "WWWCONFIG-COMMON 7"
> +.TH WWWCONFIG-COMMON 7 "2003-07-22" "##PKG_VERSION##" "wwwconfig-common"
> +.SH "NAME"
> +wwwconfig-common \- the wwwconfig-common tool suite
> +.SH "SYNOPSIS"
> +.IX Header "SYNOPSIS"
> +\&\fB/usr/share/wwwconfig-common/*\fR
> +.SH "DESCRIPTION"
> +.IX Header "DESCRIPTION"
> +Wwwconfig-common is intended to help you configure a package which provides
> +web services of some kind, manipulating apache config files and databases to
> +achieve the desired effect.
> +.PP
> +The philosophy behind wwwconfig-common is to provide a collection of small,
> +simple, and easily understood tools that are used in package maintainer
> +scripts (most likely in concert with debconf) to automate various common
> +aspects of configuring a web services package. This means less work for you,
> +the packager. It also, to some degree means that these tools can be changed
> +if the configuration of web servers and database engines change, meaning
> +less effort needs to go into fixing the packages that use them.
> +.PP
> +A typical package that uses wwwconfig-common will call several
> +wwwconfig-common commands in sequence. The wwwconfig-common commands are all
> +located in \*(L"/usr/share/wwwconfig-common\*(R".
> +
> +.SH "WWWCONFIG-COMMON COMMANDS"
> +.IX Header "WWWCONFIG-COMMON COMMANDS"
> +
> +Here is a (hopefully) complete list of available wwwconfig-common commands.
> +See their man pages for additional documentation (if available), or the
> +source code for additional comments on their usage.  An indication of
> +whether the command has a manpage is a number in brackets after it (but
> +don't take that as gospel).
> +.Sp
> +.RS 4
> +.IP apache-addtype_all.sh
> +add an AddType directive to an apache config.
> +.IP apache-cominclude.sh
> +comment out an Include directive in a config file.
> +.IP apache-cominclude_all.sh
> +comment out an Include directive in all the config files for a webserver.
> +.IP apache-include-postrm.sh
> +do the Right Thing for Include directives in an apache config, based on the
> +arguments to the postrm script.
> +.IP apache-include.sh
> +Include a file in an apache config file, possibly uncommenting an existing
> +Include directive.
> +.IP apache-include_all.sh
> +as per apache-include.sh, but checks all the config files of the webserver
> +for the appropriate Include directive.
> +.IP apache-index.sh
> +adds a filename which is to be considered as an index file (a DirectoryIndex
> +directive).
> +.IP apache-index_all.sh
> +as per apache-index.sh, but checks all the config files of the webserver for
> +an existing appropriate DirectoryIndex directive.
> +.IP apache-php.sh
> +verify that PHP is installed in the webserver.
> +.IP apache-uncominclude.sh
> +uncomment an apache Include directive.
> +.IP apache-uninclude.sh
> +remove the Include directive for a given file.
> +.IP apache-uninclude_all.sh
> +remove the Include directive for a given file from all the config files for
> +a webserver.
> +.IP autopatch.sh
> +apply a patch.
> +.IP autopatch_all.sh
> +applies all the patches found in a directory.
> +.IP exim-trust.sh
> +tell exim to "trust" a user (allow them to set the Sender: header, amongst
> +other things).
> +.IP mysql-createdb.sh
> +create a DB in a MySQL server.
> +.IP mysql-createuser.sh
> +create a user on a MySQL server.
> +.IP mysql-dropdb.sh
> +remove a database from a MySQL server.
> +.IP mysql-dropuser.sh
> +remove a user from a MySQL server.
> +.IP mysql-exec.sh
> +execute an SQL script on a MySQL server.
> +.IP mysql-if-exec.sh
> +execute an SQL script on a MySQL server if an SQL command runs successfully.
> +.IP mysql-ifnot-exec.sh
> +execute an SQL script on a MySQL server if an SQL command fails.
> +.IP pgsql-allowip.sh
> +allow IP connections to the PgSQL database.
> +.IP pgsql-createdb.sh
> +create a DB in a PostgreSQL server.
> +.IP pgsql-createuser.sh
> +create a user on a PostgreSQL server.
> +.IP pgsql-dropdb.sh
> +remove a database from a PostgreSQL server.
> +.IP pgsql-dropuser.sh
> +remove a user from a PostgreSQL server.
> +.IP pgsql-exec.sh
> +execute an SQL script on a PostgreSQL server.
> +.IP pgsql-if-exec.sh
> +execute an SQL script on a PostgreSQL server if an SQL command runs
> +successfully.
> +.IP pgsql-ifnot-exec.sh
> +execute an SQL script on a PostgreSQL server if an SQL command fails.
> +.IP php-extensions.sh
> +verify that a needed extension is loaded in the PHP config.
> +.IP restart.sh
> +Automatically restart apache servers if they need it (after a config
> +update).
> +
> +.SH "NOTES"
> +.IX Header "NOTES"
> +.Sh "Calling conventions"
> +.IX Subsection "Calling conventions"
> +All of the scripts in wwwconfig-common take their information the same way,
> +as environment variables.  Before calling any script, you should set the
> +appropriate variables in the usual way.  If you're using Perl in your
> +maintainer scripts, you should set the variables on the command line prior
> +to calling the script, such as \fBservers=apache restart.sh\fR.
> +
> +.Sh "Dependant packages"
> +.IX Subsection "Dependant packages"
> +There is a large number of scripts in wwwconfig-common, and it is unlikely
> +that any one package will use all of them (or even a large subset of them).
> +Therefore, in order to keep dependency bloat to a minimum, any package which
> +uses a script that, in turn, needs commands from another package must depend
> +on that package itself.  Do not expect wwwconfig-common to depend on these
> +packages itself.
> +
> +.PP
> +As an example, if I have a package which uses \fBmysql-exec.sh\fR, my
> +package must depend on mysql-client, since \fBmysql-exec.sh\fR uses the
> +\fBmysql\fR command to do it's work.
> +
> +.SH "AUTHOR"
> +.IX Header "AUTHOR"
> +The wwwconfig-common scripts were written by Ola Lundqvist
> +<[email-masked]>, with contributions from Luca De Vitis <[email-masked]>
> +and Arndt Schönewald.  This manpage was written by Matthew Palmer
> +<[email-masked]>, modelled from the debhelper manpage written by Joey
> +Hess.

-- 
 --------------------- Ola Lundqvist ---------------------------
/  [email-masked]                     Annebergsslingan 37      \
|  [email-masked]                 654 65 KARLSTAD          |
|  +46 (0)54-10 14 30                  +46 (0)70-332 1551       |
|  http://www.opal.dhs.org             UIN/icq: 4912500         |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------