![]()
This document describes the structure and recommended procedures for creating prepackaged module installation archives. These files, called PMARs, can be used with the pmar_install tool (pike -x pmar_install) to install modules without having to run the build process. This tool is primarily intended for distribution of pike-only modules, or for the distribution of modules packaged for systems which typically do not have build environments (such as Microsoft Windows).1.1 Structure of a PMAR A PMAR file is simply a TAR file that contains files in a particular directory structure. In its simplest forms, it consists of the following: myModule/ METADATA.TXT MODULE/ KEY=value MODULE=Public.Foo VERSION=1.2 PLATFORM=any/any Optional componentsAt the moment, there are a few optional components of a PMAR file which may be useful for more exotic installations. These optional components are a set of pike classes that can be run to perform pre and post install operations.To use these features, create a SCRIPTS directory in your package, and place files called "preinstall.pike" and/or "postinstall.pike". These scripts will be run, if present, at the appropriate times.The constructor of the script will receive the installer object (pmar_install.pike), and a System.Filesystem object of the PMAR file. They should also contain a method called run(), which returns a boolean that indicates success or failure. If a pre/post install activity fails, the installation will halt.You can use the objects passed to the constructor to get system install directories, and to access files within your package. Note that most packages will not need to make use of this functionality.You can find a sample make rule that automates the creation of PMARs (and creates module repository releases of your module, as well) in the SampleModule module in Bill Welliver's CVS repository. A link to a TAR of this can be found here.Powered by PikeWiki2 |
|||
gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University |