| GNU Octave Manual Version 3 by John W. Eaton, David Bateman, Søren Hauberg Paperback (6"x9"), 568 pages ISBN 095461206X RRP £24.95 ($39.95) |
33.4 Creating Packages
Internally a package is simply a gzipped tar file that contains a
top level directory of any given name. This directory will in the
following be referred to as package and may contain the
following files
package/DESCRIPTION- This is a required file containing information about the package. See section 33.4.1 The DESCRIPTION File, for details on this file.
package/COPYING- This is a required file containing the license of the package. No restrictions is made on the license in general. If however the package contains dynamically linked functions the license must be compatible with the GNU General Public License.
package/INDEX-
This is an optional file describing the functions provided by the
package. If this file is not given then one with be created
automatically from the functions in the package and the
Categorieskeyword in theDESCRIPTIONfile. See section 33.4.2 The INDEX file, for details on this file. package/PKG_ADD-
An optional file that includes commands that are run when the package
is added to the users path. Note that
PKG_ADDdirectives in the source code of the package will also be added to this file by the Octave package manager. Note that symbolic links are to be avoided in packages, as symbolic links do not exist on some file systems, and so a typical use for this file is the replacement of the symbolic linkln -s foo.oct bar.oct
with an autoload directive likeautoload ('bar', which ('foo'));See section 33.4.3 PKG_ADD and PKG_DEL directives, for details onPKG_ADDdirectives. package/PKG_DEL-
An optional file that includes commands that are run when the package
is removed from the users path. Note that
PKG_DELdirectives in the source code of the package will also be added to this file by the Octave package manager. See section 33.4.3 PKG_ADD and PKG_DEL directives, for details onPKG_DELdirectives. package/pre_install.m- This is an optional script that is run prior to the installation of a package.
package/post_install.m- This is an optional script that is run after the installation of a package.
package/on_uninstall.m- This is an optional script that is run prior to the removal of a package.
Besides the above mentioned files, a package can also contain on or more of the following directories
package/inst-
An optional directory containing any files that are directly installed
by the package. Typically this will include any
m-files. package/src-
An optional directory containing code that must be built prior to the
packages installation. The Octave package manager will execute
./configurein this directory if this script exists, and will then callmakeif a fileMakefileexists in this directory.make installwill however not be called. If a file calledFILESexist all files listed there will be copied to theinstdirectory, so they also will be installed. If theFILESfile doesn't exist,src/*.mandsrc/*.octwill be copied to theinstdirectory. package/doc- An optional directory containing documentation for the package. The files in this directory will be directly installed in a sub-directory of the installed package for future reference.
package/bin-
An optional directory containing files that will be added to the
Octave
EXEC_PATHwhen the package is loaded. This might contain external scripts, etc, called by functions within the package.
| ISBN 095461206X | GNU Octave Manual Version 3 | See the print edition |