Mercurial > octave-nkf
annotate doc/interpreter/package.txi @ 10828:322f43e0e170
Grammarcheck .txi documentation files.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 28 Jul 2010 12:45:04 -0700 |
parents | 3140cb7a05a1 |
children | d682cd6669ac |
rev | line source |
---|---|
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
1 @c Copyright (C) 2007, 2008, 2009 S�ren Hauberg |
7018 | 2 @c |
3 @c This file is part of Octave. | |
4 @c | |
5 @c Octave is free software; you can redistribute it and/or modify it | |
6 @c under the terms of the GNU General Public License as published by the | |
7 @c Free Software Foundation; either version 3 of the License, or (at | |
8 @c your option) any later version. | |
9 @c | |
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT | |
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
13 @c for more details. | |
14 @c | |
15 @c You should have received a copy of the GNU General Public License | |
16 @c along with Octave; see the file COPYING. If not, see | |
17 @c <http://www.gnu.org/licenses/>. | |
6537 | 18 |
19 @node Packages | |
20 @chapter Packages | |
21 | |
22 Since Octave is Free Software users are encouraged to share their | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
23 programs amongst each other. To aid this sharing Octave supports the |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
24 installation of extra packages. The `Octave-Forge' project is a |
6537 | 25 community-maintained set of packages that can be downloaded and |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
26 installed in Octave. At the time of writing the `Octave-Forge' project |
6537 | 27 can be found on-line at @uref{http://octave.sourceforge.net}, but |
28 since the Internet is an ever-changing place this may not be true at | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
29 the time of reading. Therefore it is recommended to see the Octave |
6537 | 30 website for an updated reference. |
31 | |
32 @menu | |
33 * Installing and Removing Packages:: | |
34 * Using Packages:: | |
35 * Administrating Packages:: | |
36 * Creating Packages:: | |
37 @end menu | |
38 | |
6538 | 39 @findex pkg |
6537 | 40 @node Installing and Removing Packages |
41 @section Installing and Removing Packages | |
42 | |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
43 Assuming a package is available in the file @file{image-1.0.0.tar.gz} |
8828 | 44 it can be installed from the Octave prompt with the command |
6537 | 45 |
46 @example | |
47 pkg install image-1.0.0.tar.gz | |
48 @end example | |
49 | |
50 @noindent | |
51 If the package is installed successfully nothing will be printed on | |
52 the prompt, but if an error occurred during installation it will be | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
53 reported. It is possible to install several packages at once by |
6537 | 54 writing several package files after the @code{pkg install} command. |
55 If a different version of the package is already installed it will | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
56 be removed prior to installing the new package. This makes it easy to |
6537 | 57 upgrade and downgrade the version of a package, but makes it |
58 impossible to have several versions of the same package installed at | |
59 once. | |
60 | |
61 To see which packages are installed type | |
62 | |
63 @example | |
64 @group | |
65 pkg list | |
7031 | 66 @print{} Package Name | Version | Installation directory |
67 @print{} --------------+---------+----------------------- | |
68 @print{} image *| 1.0.0 | /home/jwe/octave/image-1.0.0 | |
6537 | 69 @end group |
70 @end example | |
71 | |
72 @noindent | |
73 In this case only version 1.0.0 of the @code{image} package is | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
74 installed. The '*' character next to the package name shows that the |
6616 | 75 image package is loaded and ready for use. |
6537 | 76 |
77 It is possible to remove a package from the system using the | |
78 @code{pkg uninstall} command like this | |
79 | |
80 @example | |
81 pkg uninstall image | |
82 @end example | |
83 | |
84 @noindent | |
85 If the package is removed successfully nothing will be printed in the | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
86 prompt, but if an error occurred it will be reported. It should be |
6537 | 87 noted that the package file used for installation is not needed for |
88 removal, and that only the package name as reported by @code{pkg list} | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
89 should be used when removing a package. It is possible to remove |
6537 | 90 several packages at once by writing several package names after the |
91 @code{pkg uninstall} command. | |
92 | |
93 To minimize the amount of code duplication between packages it is | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
94 possible that one package depends on another one. If a package |
6537 | 95 depends on another, it will check if that package is installed |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
96 during installation. If it is not, an error will be reported and |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
97 the package will not be installed. This behavior can be disabled |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
98 by passing the @option{-nodeps} flag to the @code{pkg install} |
6537 | 99 command |
100 | |
101 @example | |
102 pkg install -nodeps my_package_with_dependencies.tar.gz | |
103 @end example | |
104 | |
105 @noindent | |
106 Since the installed package expects its dependencies to be installed | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
107 it may not function correctly. Because of this it is not recommended |
6537 | 108 to disable dependency checking. |
109 | |
8540
1eb16d930f3c
package.txi: @DOCSTRING for pkg
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
110 @DOCSTRING(pkg) |
1eb16d930f3c
package.txi: @DOCSTRING for pkg
John W. Eaton <jwe@octave.org>
parents:
8347
diff
changeset
|
111 |
6537 | 112 @node Using Packages |
113 @section Using Packages | |
114 | |
115 By default installed packages are available from the Octave prompt, | |
116 but it is possible to control this using the @code{pkg load} and | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
117 @code{pkg unload} commands. The functions from a package can be |
6537 | 118 removed from the Octave path by typing |
119 | |
120 @example | |
121 pkg unload package_name | |
122 @end example | |
123 | |
124 @noindent | |
125 where @code{package_name} is the name of the package to be removed | |
126 from the path. | |
127 | |
128 In much the same way a package can be added to the Octave path by | |
129 typing | |
130 | |
131 @example | |
132 pkg load package_name | |
133 @end example | |
134 | |
135 @node Administrating Packages | |
136 @section Administrating Packages | |
137 | |
138 On UNIX-like systems it is possible to make both per-user and | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
139 system-wide installations of a package. If the user performing the |
6537 | 140 installation is @code{root} the packages will be installed in a |
141 system-wide directory that defaults to | |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
142 @file{OCTAVE_HOME/share/octave/packages/}. If the user is not |
6537 | 143 @code{root} the default installation directory is |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
144 @file{~/octave/}. Packages will be installed in a subdirectory of the |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
145 installation directory that will be named after the package. It is |
6537 | 146 possible to change the installation directory by using the |
147 @code{pkg prefix} command | |
148 | |
149 @example | |
150 pkg prefix new_installation_directory | |
151 @end example | |
152 | |
153 @noindent | |
154 The current installation directory can be retrieved by typing | |
155 | |
156 @example | |
157 current_installation_directory = pkg prefix | |
158 @end example | |
159 | |
160 To function properly the package manager needs to keep some | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
161 information about the installed packages. For per-user packages this |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
162 information is by default stored in the file @file{~/.octave_packages} |
6537 | 163 and for system-wide installations it is stored in |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
164 @file{OCTAVE_HOME/share/octave/octave_packages}. The path to the |
6537 | 165 per-user file can be changed with the @code{pkg local_list} command |
166 | |
167 @example | |
168 pkg local_list /path/to/new_file | |
169 @end example | |
170 | |
171 @noindent | |
172 For system-wide installations this can be changed in the same way | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
173 using the @code{pkg global_list} command. If these commands are |
6537 | 174 called without a new path, the current path will be returned. |
175 | |
176 @node Creating Packages | |
177 @section Creating Packages | |
178 | |
179 Internally a package is simply a gzipped tar file that contains a | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
180 top level directory of any given name. This directory will in the |
6537 | 181 following be referred to as @code{package} and may contain the |
182 following files | |
183 | |
184 @noindent | |
185 @table @code | |
186 @item package/DESCRIPTION | |
187 This is a required file containing information about the package. | |
188 @xref{The DESCRIPTION File}, for details on this file. | |
189 | |
190 @item package/COPYING | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
191 This is a required file containing the license of the package. No |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
192 restrictions is made on the license in general. If however the |
6537 | 193 package contains dynamically linked functions the license must be |
194 compatible with the GNU General Public License. | |
195 | |
196 @item package/INDEX | |
197 This is an optional file describing the functions provided by the | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
198 package. If this file is not given then one with be created |
6537 | 199 automatically from the functions in the package and the |
200 @code{Categories} keyword in the @code{DESCRIPTION} file. | |
201 @xref{The INDEX file}, for details on this file. | |
202 | |
8297 | 203 @anchor{doc-PKG_ADD} |
6537 | 204 @item package/PKG_ADD |
205 An optional file that includes commands that are run when the package | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
206 is added to the users path. Note that @w{@code{PKG_ADD}} directives in the |
6537 | 207 source code of the package will also be added to this file by the |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
208 Octave package manager. Note that symbolic links are to be avoided in |
6537 | 209 packages, as symbolic links do not exist on some file systems, and so |
210 a typical use for this file is the replacement of the symbolic link | |
211 | |
212 @example | |
213 ln -s foo.oct bar.oct | |
214 @end example | |
215 | |
216 @noindent | |
217 with an autoload directive like | |
218 | |
219 @example | |
220 autoload ('bar', which ('foo')); | |
221 @end example | |
222 | |
223 @noindent | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
224 @xref{PKG_ADD and PKG_DEL directives}, for details on @w{@code{PKG_ADD}} |
6537 | 225 directives. |
226 | |
227 @item package/PKG_DEL | |
228 An optional file that includes commands that are run when the package | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
229 is removed from the users path. Note that @w{@code{PKG_DEL}} directives in |
6537 | 230 the source code of the package will also be added to this file by the |
231 Octave package manager. | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
232 @xref{PKG_ADD and PKG_DEL directives}, for details on @w{@code{PKG_DEL}} |
6537 | 233 directives. |
234 | |
235 @item package/pre_install.m | |
236 This is an optional script that is run prior to the installation of a | |
237 package. | |
238 | |
239 @item package/post_install.m | |
240 This is an optional script that is run after the installation of a | |
241 package. | |
242 | |
243 @item package/on_uninstall.m | |
244 This is an optional script that is run prior to the removal of a | |
245 package. | |
246 @end table | |
247 | |
248 Besides the above mentioned files, a package can also contain on or | |
249 more of the following directories | |
250 | |
251 @noindent | |
252 @table @code | |
253 @item package/inst | |
254 An optional directory containing any files that are directly installed | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
255 by the package. Typically this will include any @code{m}-files. |
6537 | 256 |
257 @item package/src | |
258 An optional directory containing code that must be built prior to the | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
259 packages installation. The Octave package manager will execute |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
260 @file{./configure} in this directory if this script exists, and will |
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
261 then call @code{make} if a file @file{Makefile} exists in this |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
262 directory. @code{make install} will however not be called. If a file |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
263 called @code{FILES} exists all files listed there will be copied to the |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
264 @code{inst} directory, so they also will be installed. If the |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
265 @code{FILES} file doesn't exist, @file{src/*.m} and @file{src/*.oct} |
6537 | 266 will be copied to the @code{inst} directory. |
267 | |
268 @item package/doc | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
269 An optional directory containing documentation for the package. The |
6537 | 270 files in this directory will be directly installed in a sub-directory |
271 of the installed package for future reference. | |
272 | |
273 @item package/bin | |
274 An optional directory containing files that will be added to the | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
275 Octave @w{@env{EXEC_PATH}} when the package is loaded. This might contain |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
276 external scripts, etc., called by functions within the package. |
6537 | 277 @end table |
278 | |
279 @menu | |
280 * The DESCRIPTION File:: | |
281 * The INDEX file:: | |
282 * PKG_ADD and PKG_DEL directives:: | |
283 @end menu | |
284 | |
285 @node The DESCRIPTION File | |
286 @subsection The DESCRIPTION File | |
287 | |
288 The @code{DESCRIPTION} file contains various information about the | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
289 package, such as its name, author, and version. This file has a very |
6537 | 290 simple format |
291 | |
292 @noindent | |
293 @itemize | |
294 @item | |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
295 Lines starting with @samp{#} are comments. |
6537 | 296 |
297 @item | |
298 Lines starting with a blank character are continuations from the | |
299 previous line. | |
300 | |
301 @item | |
302 Everything else is of the form @code{NameOfOption: ValueOfOption}. | |
303 @end itemize | |
304 | |
305 @noindent | |
306 The following is a simple example of a @code{DESCRIPTION} file | |
307 | |
308 @example | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
309 @group |
6537 | 310 Name: The name of my package |
311 Version: 1.0.0 | |
312 Date: 2007-18-04 | |
313 Author: The name (and possibly email) of the package author. | |
7031 | 314 Maintainer: The name (and possibly email) of the current |
315 package maintainer. | |
6537 | 316 Title: The title of the package |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
317 Description: A short description of the package. If this |
7031 | 318 description gets too long for one line it can continue |
319 on the next by adding a space to the beginning of the | |
320 following lines. | |
7016 | 321 License: GPL version 3 or later |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
322 @end group |
6537 | 323 @end example |
324 | |
325 The package manager currently recognizes the following keywords | |
326 | |
327 @noindent | |
328 @table @code | |
329 @item Name | |
330 Name of the package. | |
331 | |
332 @item Version | |
333 Version of the package. | |
334 | |
335 @item Date | |
336 Date of last update. | |
337 | |
338 @item Author | |
339 Original author of the package. | |
340 | |
341 @item Maintainer | |
342 Maintainer of the package. | |
343 | |
344 @item Title | |
345 A one line description of the package. | |
346 | |
347 @item Description | |
348 A one paragraph description of the package. | |
349 | |
350 @item Categories | |
351 Optional keyword describing the package (if no @code{INDEX} file is | |
352 given this is mandatory). | |
353 | |
354 @item Problems | |
355 Optional list of known problems. | |
356 | |
357 @item Url | |
358 Optional list of homepages related to the package. | |
359 | |
360 @item Autoload | |
361 Optional field that sets the default loading behavior for the package. | |
362 If set to @code{yes}, @code{true} or @code{on}, then Octave will | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
363 automatically load the package when starting. Otherwise the package |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
364 must be manually loaded with the pkg load command. This default |
6537 | 365 behavior can be overridden when the package is installed. |
366 | |
367 @item Depends | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
368 A list of other Octave packages that this package depends on. This can |
6537 | 369 include dependencies on particular versions, with a format |
370 | |
371 @example | |
372 Depends: package (>= 1.0.0) | |
373 @end example | |
374 | |
375 @noindent | |
376 Possible operators are @code{<}, @code{<=}, @code{==}, @code{>=} or | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
377 @code{>}. If the part of the dependency in @code{()} is missing, any |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
378 version of the package is acceptable. Multiple dependencies can be |
6537 | 379 defined either as a comma separated list or on separate @code{Depends} |
380 lines. | |
381 | |
382 @item License | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
383 An optional short description of the used license (e.g., GPL version 3 |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
384 or newer). This is optional since the file @code{COPYING} is mandatory. |
6537 | 385 |
386 @item SystemRequirements | |
387 These are the external install dependencies of the package and are not | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
388 checked by the package manager. This is here as a hint to the |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
389 distribution packager. They follow the same conventions as the |
6537 | 390 @code{Depends} keyword. |
391 | |
392 @item BuildRequires | |
393 These are the external build dependencies of the package and are not | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
394 checked by the package manager. This is here as a hint to the |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
395 distribution packager. They follow the same conventions as the |
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
396 @code{Depends} keyword. Note that in general, packaging systems such |
6537 | 397 as @code{rpm} or @code{deb} and autoprobe the install dependencies |
398 from the build dependencies, and therefore the often a | |
399 @code{BuildRequires} dependency removes the need for a | |
400 @code{SystemRequirements} dependency. | |
401 | |
402 @end table | |
403 | |
404 @noindent | |
405 The developer is free to add additional arguments to the | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
406 @code{DESCRIPTION} file for their own purposes. One further detail to |
8325
b93ac0586e4b
spelling corrections
Brian Gough<bjg@network-theory.co.uk>
parents:
8297
diff
changeset
|
407 aid the packager is that the @code{SystemRequirements} and |
8347
fa78cb8d8a5c
corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents:
8325
diff
changeset
|
408 @code{BuildRequires} keywords can have a distribution dependent section, |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
409 and the automatic build process will use these. An example of the |
6537 | 410 format of this is |
411 | |
412 @example | |
413 BuildRequires: libtermcap-devel [Mandriva] libtermcap2-devel | |
414 @end example | |
415 | |
416 @noindent | |
417 where the first package name will be used as a default and if the | |
418 RPMs are built on a Mandriva distribution, then the second package | |
419 name will be used instead. | |
420 | |
421 @node The INDEX file | |
422 @subsection The INDEX file | |
423 | |
8347
fa78cb8d8a5c
corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents:
8325
diff
changeset
|
424 The optional @code{INDEX} file provides a categorical view of the |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
425 functions in the package. This file has a very simple format |
6537 | 426 |
427 @noindent | |
428 @itemize | |
9307
c2923c27c877
Various documentation improvements
Rik <rdrider0-list@yahoo.com>
parents:
9209
diff
changeset
|
429 @item Lines beginning with @samp{#} are comments. |
6537 | 430 |
431 @item The first non-comment line should look like this | |
432 | |
433 @example | |
434 toolbox >> Toolbox name | |
435 @end example | |
436 | |
437 @item Lines beginning with an alphabetical character indicates a new | |
438 category of functions. | |
439 | |
440 @item Lines starting with a white space character indicate that the | |
8347
fa78cb8d8a5c
corrections for typos
Brian Gough<bjg@network-theory.co.uk>
parents:
8325
diff
changeset
|
441 function names on the line belong to the last mentioned category. |
6537 | 442 @end itemize |
443 | |
444 @noindent | |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
445 The format can be summarized with the following example. |
6537 | 446 |
447 @example | |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
448 @group |
6537 | 449 # A comment |
450 toolbox >> Toolbox name | |
451 Category Name 1 | |
452 function1 function2 function3 | |
453 function4 | |
454 Category Name 2 | |
7007 | 455 function2 function5 |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
456 @end group |
6537 | 457 @end example |
458 | |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
459 If you wish to refer to a function that users might expect |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
460 to find in your package but is not there, providing a work around or |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
461 pointing out that the function is available elsewhere, you can use: |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
462 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
463 @example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
464 fn = workaround description |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
465 @end example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
466 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
467 @noindent |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
468 This workaround description will not appear when listing functions in the |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
469 package with @code{pkg describe} but they will be published |
10791
3140cb7a05a1
Add spellchecker scripts for Octave and run spellcheck of documentation
Rik <octave@nomad.inbox5.com>
parents:
9307
diff
changeset
|
470 in the HTML documentation online. |
3140cb7a05a1
Add spellchecker scripts for Octave and run spellcheck of documentation
Rik <octave@nomad.inbox5.com>
parents:
9307
diff
changeset
|
471 Workaround descriptions can use any HTML markup, but |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
472 keep in mind that it will be enclosed in a bold-italic environment. |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
473 For the special case of: |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
474 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
475 @example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
476 fn = use <code>alternate expression</code> |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
477 @end example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
478 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
479 @noindent |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
480 the bold-italic is automatically suppressed. You will need |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
481 to use @code{<code>} even in references: |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
482 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
483 @example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
484 fn = use <a href="someothersite.html"><code>fn</code></a> |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
485 @end example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
486 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
487 @noindent |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
488 Sometimes functions are only partially compatible, in which |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
489 case you can list the non-compatible cases separately. To |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
490 refer to another function in the package, use @code{<f>fn</f>}. |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
491 For example: |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
492 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
493 @example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
494 eig (a, b) = use <f>qz</f> |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
495 @end example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
496 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
497 @noindent |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
498 Since sites may have many missing functions, you can define |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
499 a macro rather than typing the same link over and again. |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
500 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
501 @example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
502 $id = expansion |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
503 @end example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
504 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
505 @noindent |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
506 defines the macro id. You can use @code{$id} anywhere in the |
10828
322f43e0e170
Grammarcheck .txi documentation files.
Rik <octave@nomad.inbox5.com>
parents:
10791
diff
changeset
|
507 description and it will be expanded. For example: |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
508 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
509 @example |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
510 @group |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
511 $TSA = see <a href="link_to_spctools">SPC Tools</a> |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
512 arcov = $TSA <code>armcv</code> |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
513 @end group |
7496
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
514 @end example |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
515 |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
516 @noindent |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
517 id is any string of letters, numbers and @code{_}. |
e27f8afa99e5
better documentation on the INDEX file format
carlo@guglielmo.local
parents:
7031
diff
changeset
|
518 |
6537 | 519 @node PKG_ADD and PKG_DEL directives |
520 @subsection PKG_ADD and PKG_DEL directives | |
521 | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
522 If the package contains files called @w{@code{PKG_ADD}} or @w{@code{PKG_DEL}} |
6537 | 523 the commands in these files will be executed when the package is |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
524 added or removed from the users path. In some situations such files |
6537 | 525 are a bit cumbersome to maintain, so the package manager supports |
9079
4d610aba7347
Cleanup documentation for system.texi, package.texi
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
526 automatic creation of such files. If a source file in the package |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
527 contains a @w{@code{PKG_ADD}} or @w{@code{PKG_DEL}} directive they will be |
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
528 added to either the @w{@code{PKG_ADD}} or @w{@code{PKG_DEL}} files. |
6537 | 529 |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
530 In @code{m}-files a @w{@code{PKG_ADD}} directive looks like this |
6537 | 531 |
532 @example | |
533 ## PKG_ADD: some_octave_command | |
534 @end example | |
535 | |
536 @noindent | |
537 Such lines should be added before the @code{function} keyword. | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
538 In C++ files a @w{@code{PKG_ADD}} directive looks like this |
6537 | 539 |
540 @example | |
541 // PKG_ADD: some_octave_command | |
542 @end example | |
543 | |
544 @noindent | |
545 In both cases @code{some_octave_command} should be replaced by the | |
9209
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
546 command that should be placed in the @w{@code{PKG_ADD}} file. |
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
547 @w{@code{PKG_DEL}} directives work in the same way, except the @w{@code{PKG_ADD}} |
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
548 keyword is replaced with @w{@code{PKG_DEL}} and the commands get added |
923c7cb7f13f
Simplify TeXinfo files by eliminating redundant @iftex followed by @tex construction.
Rik <rdrider0-list@yahoo.com>
parents:
9079
diff
changeset
|
549 to the @w{@code{PKG_DEL}} file. |