<html lang="en"> <head> <title>Creating Packages - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Packages.html#Packages" title="Packages"> <link rel="prev" href="Administrating-Packages.html#Administrating-Packages" title="Administrating Packages"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Creating-Packages"></a> <p> Previous: <a rel="previous" accesskey="p" href="Administrating-Packages.html#Administrating-Packages">Administrating Packages</a>, Up: <a rel="up" accesskey="u" href="Packages.html#Packages">Packages</a> <hr> </div> <h3 class="section">35.4 Creating Packages</h3> <p>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 <code>package</code> and may contain the following files <p class="noindent"> <dl> <dt><code>package/DESCRIPTION</code><dd>This is a required file containing information about the package. See <a href="The-DESCRIPTION-File.html#The-DESCRIPTION-File">The DESCRIPTION File</a>, for details on this file. <br><dt><code>package/COPYING</code><dd>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. <br><dt><code>package/INDEX</code><dd>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 <code>Categories</code> keyword in the <code>DESCRIPTION</code> file. See <a href="The-INDEX-file.html#The-INDEX-file">The INDEX file</a>, for details on this file. <p><a name="doc_002dPKG_005fADD"></a><br><dt><code>package/PKG_ADD</code><dd>An optional file that includes commands that are run when the package is added to the users path. Note that <code>PKG_ADD</code><!-- /@w --> directives 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 link <pre class="example"> ln -s foo.oct bar.oct </pre> <p class="noindent">with an autoload directive like <pre class="example"> autoload ('bar', which ('foo')); </pre> <p class="noindent">See <a href="PKG_005fADD-and-PKG_005fDEL-directives.html#PKG_005fADD-and-PKG_005fDEL-directives">PKG_ADD and PKG_DEL directives</a>, for details on <code>PKG_ADD</code><!-- /@w --> directives. <br><dt><code>package/PKG_DEL</code><dd>An optional file that includes commands that are run when the package is removed from the users path. Note that <code>PKG_DEL</code><!-- /@w --> directives in the source code of the package will also be added to this file by the Octave package manager. See <a href="PKG_005fADD-and-PKG_005fDEL-directives.html#PKG_005fADD-and-PKG_005fDEL-directives">PKG_ADD and PKG_DEL directives</a>, for details on <code>PKG_DEL</code><!-- /@w --> directives. <br><dt><code>package/pre_install.m</code><dd>This is an optional script that is run prior to the installation of a package. <br><dt><code>package/post_install.m</code><dd>This is an optional script that is run after the installation of a package. <br><dt><code>package/on_uninstall.m</code><dd>This is an optional script that is run prior to the removal of a package. </dl> <p>Besides the above mentioned files, a package can also contain on or more of the following directories <p class="noindent"> <dl> <dt><code>package/inst</code><dd>An optional directory containing any files that are directly installed by the package. Typically this will include any <code>m</code>-files. <br><dt><code>package/src</code><dd>An optional directory containing code that must be built prior to the packages installation. The Octave package manager will execute <samp><span class="file">./configure</span></samp> in this directory if this script exists, and will then call <code>make</code> if a file <samp><span class="file">Makefile</span></samp> exists in this directory. <code>make install</code> will however not be called. If a file called <code>FILES</code> exists all files listed there will be copied to the <code>inst</code> directory, so they also will be installed. If the <code>FILES</code> file doesn't exist, <samp><span class="file">src/*.m</span></samp> and <samp><span class="file">src/*.oct</span></samp> will be copied to the <code>inst</code> directory. <br><dt><code>package/doc</code><dd>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. <br><dt><code>package/bin</code><dd>An optional directory containing files that will be added to the Octave <code>EXEC_PATH</code><!-- /@w --> when the package is loaded. This might contain external scripts, etc., called by functions within the package. </dl> <ul class="menu"> <li><a accesskey="1" href="The-DESCRIPTION-File.html#The-DESCRIPTION-File">The DESCRIPTION File</a> <li><a accesskey="2" href="The-INDEX-file.html#The-INDEX-file">The INDEX file</a> <li><a accesskey="3" href="PKG_005fADD-and-PKG_005fDEL-directives.html#PKG_005fADD-and-PKG_005fDEL-directives">PKG_ADD and PKG_DEL directives</a> </ul> </body></html>