NAME

template-control - A script to expand out template package control scripts in InstallPackage


SYNOPSIS

check-pkg [-hvqsE] [-e ext] [-p directory] [-M master]


OPTIONS

Supported options are:

-h
Display usage information

-v
Verbose output - sent to standard error.

-q
Quiet mode; disables the display of all errors. Will also disable the -v option if it was also given.

-s
Silently exit if no template files are found. Generally used by programs or scripts calling this one.

-E
Always exit with an exit code of zero

-e ext
The extension the template files are given. This will have a . prepended to it. The default is template.

-p directory
Specify the directory to search for package control script template files. The default is InstallPackage.

-M master
The location of the master template file. The default is /usr/local/lib/pkg-tools/master.template


DESCRIPTION

This script handles template files for package control scripts. The author of this script has built up a set of functions which can be used to all sorts of neat things within package control scripts. Things like automating the addition or removal of entries from files /etc/syslog.conf, even if said files use RCS. However this set of functions is an evolving system which means that you have to provide to the package control scripts. There are a number of different ways of doing this:

Personally I prefer the templating system, although you should've probably guessed that from the fact that this command exists in the first place.

The script works by searching the package control directory - by default InstallPackage - for any template files. These files have a file extension of template by default.

Each template file is loaded in turn and combined with the master template file which is held at /usr/local/lib/pkg-tools/master.template

This expansion takes the form of the loading each file in turn and the replacement of the string %%%MASTER_TEMPLATE%%% with the contents of the master template file. There are a number of variables which must by present in the sh code of the package control scripts for this to work.

The expanded file is written into a file which has a name related to the template file name - essentially it is the same name, but with the template file extension stripped away. Thus InstallPackage/postinstall.template would end up as the more useful InstallPackage/postinstall

As mentioned above there are several variables which have to be present for the master template file to work; please see the

master_template(4) manual page for more details.


FILES

/usr/local/lib/pkg-tools/master.template
The master template file.


SEE ALSO

build-pkg(1) master_template(4)


AUTHOR

Simon Burr <simes@bpfh.net>


LICENSE

Copyright (c) 2003, Simon Burr <simes@bpfh.net> All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer. 
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution. 
  * Neither the name of the author nor the names of its contributors may
    be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.