recipes: use + to append C flags in order to preserve the current (mostly the warning...
[dragora.git] / qi / doc / qi.html
blob445836853d7661bf838c9d18834d48374a24235a
1 <html lang="en">
2 <head>
3 <title>Qi manual</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 <meta name="description" content="Qi manual">
6 <meta name="generator" content="makeinfo 4.13">
7 <link title="Top" rel="top" href="#Top">
8 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9 <!--
10 This manual is for Qi (version 1.0-rc4,
11 30 Jan 2017), which is a simple source builder and package manager.
13 Copyright (C) 2015, 2016, 2017 Matias A. Fonzo, Argentina,
14 Santiago del Estero.
16 Permission is granted to copy, distribute and/or modify this
17 document under the terms of the GNU Free Documentation License,
18 Version 1.3 or any later version published by the Free Software
19 Foundation; with no Invariant Sections, with no Front-Cover Texts,
20 and with no Back-Cover Texts. A copy of the license is included
21 in the section entitled "GNU Free Documentation License".
22 -->
23 <meta http-equiv="Content-Style-Type" content="text/css">
24 <style type="text/css"><!--
25 pre.display { font-family:inherit }
26 pre.format { font-family:inherit }
27 pre.smalldisplay { font-family:inherit; font-size:smaller }
28 pre.smallformat { font-family:inherit; font-size:smaller }
29 pre.smallexample { font-size:smaller }
30 pre.smalllisp { font-size:smaller }
31 span.sc { font-variant:small-caps }
32 span.roman { font-family:serif; font-weight:normal; }
33 span.sansserif { font-family:sans-serif; font-weight:normal; }
34 --></style>
35 <link rel="stylesheet" type="text/css" href="document-1.0.1.css">
36 </head>
37 <body>
38 <h1 class="settitle">Qi manual</h1>
39 <div class="contents">
40 <h2>Table of Contents</h2>
41 <ul>
42 <li><a name="toc_Top" href="#Top">Qi manual</a>
43 <li><a name="toc_Introduction" href="#Introduction">1 Introduction</a>
44 <li><a name="toc_Invocation" href="#Invocation">2 Invocation</a>
45 <ul>
46 <li><a href="#Invocation">2.1 Environment</a>
47 <li><a href="#Invocation">2.2 Notes</a>
48 </li></ul>
49 <li><a name="toc_The-qirc-file" href="#The-qirc-file">3 The qirc file</a>
50 <li><a name="toc_Packages" href="#Packages">4 Packages</a>
51 <ul>
52 <li><a href="#Packages">4.1 Adding packages</a>
53 <li><a href="#Packages">4.2 Removing packages</a>
54 <li><a href="#Packages">4.3 Upgrading packages</a>
55 <li><a href="#Packages">4.4 Notes</a>
56 </li></ul>
57 <li><a name="toc_Recipes" href="#Recipes">5 Recipes</a>
58 <ul>
59 <li><a href="#Recipes">5.1 Variables</a>
60 <ul>
61 <li><a href="#Recipes">5.1.1 Special variables</a>
62 <li><a href="#Recipes">5.1.2 Variables from the environment</a>
63 </li></ul>
64 <li><a href="#Recipes">5.2 The meta file</a>
65 <li><a href="#Recipes">5.3 Building packages</a>
66 <li><a href="#Recipes">5.4 Writing recipes</a>
67 <ul>
68 <li><a href="#Recipes">5.4.1 Internal functions</a>
69 </li></ul>
70 </li></ul>
71 <li><a name="toc_Order-files" href="#Order-files">6 Order files</a>
72 <ul>
73 <li><a href="#Order-files">6.1 The depends file</a>
74 </li></ul>
75 <li><a name="toc_Examine-packages" href="#Examine-packages">7 Examine packages</a>
76 <li><a name="toc_Messages" href="#Messages">8 Messages</a>
77 <li><a name="toc_Exit-status" href="#Exit-status">9 Exit status</a>
78 <li><a name="toc_GNU-Free-Documentation-License" href="#GNU-Free-Documentation-License">Appendix A GNU Free Documentation License</a>
79 <li><a name="toc_Index" href="#Index">Index</a>
80 </li></ul>
81 </div>
85 <div class="node">
86 <a name="Top"></a>
87 <p><hr>
88 Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
89 Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
91 </div>
93 <h2 class="unnumbered">Qi manual</h2>
95 <p>This manual is for Qi (version 1.0-rc4,
96 30 Jan 2017).
98 <ul class="menu">
99 <li><a accesskey="1" href="#Introduction">Introduction</a>: Purpose, description
100 <li><a accesskey="2" href="#Invocation">Invocation</a>: Command-line interface
101 <li><a accesskey="3" href="#The-qirc-file">The qirc file</a>: Configuration file
102 <li><a accesskey="4" href="#Packages">Packages</a>: Managing packages
103 <li><a accesskey="5" href="#Recipes">Recipes</a>: Building packages
104 <li><a accesskey="6" href="#Order-files">Order files</a>: Handling the build order
105 <li><a accesskey="7" href="#Examine-packages">Examine packages</a>: Debugging purposes
106 <li><a accesskey="8" href="#Messages">Messages</a>: Output messages
107 <li><a accesskey="9" href="#Exit-status">Exit status</a>: Exit codes
108 <li><a href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>
109 <li><a href="#Index">Index</a>
110 </ul>
112 <pre class="sp">
114 </pre>
115 Copyright &copy; 2015-2017 Matias A. Fonzo, Argentina, Santiago
116 del Estero.
118 <p>The Qi home page can be found at <a href="http://www.dragora.org">http://www.dragora.org</a>.
119 Send&nbsp;bug&nbsp;reports&nbsp;or&nbsp;suggestions&nbsp;to&nbsp;<a href="mailto:dragora-users@nongnu.org">dragora-users@nongnu.org</a>.<!-- /@w -->
121 <div class="node">
122 <a name="Introduction"></a>
123 <p><hr>
124 Next:&nbsp;<a rel="next" accesskey="n" href="#Invocation">Invocation</a>,
125 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
126 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
128 </div>
130 <h2 class="chapter">1 Introduction</h2>
132 <p><a name="index-introduction-1"></a>
133 Qi is a source builder and a package manager:
135 <p>It contains a set of (individual) tools to build, install, remove, and
136 upgrade software packages. It follows the philosophy of simplicity
137 without adding too many features, such as those that can be found in
138 popular package managers. Basically it does two things: builds
139 packages and manages them.
141 <p>Qi constructs the sources using recipe names, files that contain
142 specific instructions to build every source. As result, a binary
143 package is obtained which can be installed, removed, upgraded, or
144 inspected in the system.
146 <p>The packages are managed thanks to an external tool called
147 <em>graft(1)</em>, which provides a mechanism for managing multiple
148 packages under a single directory hierarchy, it was inspired by both
149 Depot (Carnegie Mellon University) and Stow (Bob Glickstein). In this
150 aspect, Qi complements Graft: it can work with packages, check them,
151 solve conflicts, and more...
153 <div class="node">
154 <a name="Invocation"></a>
155 <p><hr>
156 Next:&nbsp;<a rel="next" accesskey="n" href="#The-qirc-file">The qirc file</a>,
157 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
158 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
160 </div>
162 <h2 class="chapter">2 Invocation</h2>
164 <p><a name="index-invocation-2"></a>
165 The synopsis to invoke Qi is:
167 <pre class="example"> pkg&lt;action&gt; [options] [package|recipe|order] ...
168 </pre>
169 <p class="noindent">The following commands or actions are supported by Qi:
171 <dl>
172 <dt>&lsquo;<samp><span class="samp">pkghelp</span></samp>&rsquo;<dd>Shows the help.
174 <br><dt>&lsquo;<samp><span class="samp">pkgadd</span></samp>&rsquo;<dd>Add the packages to the system using <em>graft(1)</em> for linking.
176 <br><dt>&lsquo;<samp><span class="samp">pkgremove</span></samp>&rsquo;<dd>Remove the packages from the system.
178 <br><dt>&lsquo;<samp><span class="samp">pkgupgrade</span></samp>&rsquo;<dd>Upgrade software packages.
180 <br><dt>&lsquo;<samp><span class="samp">pkgbuild</span></samp>&rsquo;<dd>Build packages using recipe files.
182 <br><dt>&lsquo;<samp><span class="samp">pkgorder</span></samp>&rsquo;<dd>Resolves the build order through .order files.
184 <br><dt>&lsquo;<samp><span class="samp">pkgerupt</span></samp>&rsquo;<dd>Examine packages for debugging purposes.
186 <pre class="sp">
188 </pre>
189 <strong>Global options</strong>
191 <p>There are global or common options for the commands, as well as specific to each one.
193 <br><dt>&lsquo;<samp><span class="samp">-h</span></samp>&rsquo;<dd>Show options for the given command and exit.
195 <pre class="sp">
197 </pre>
198 <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgadd</span></samp><strong>&rsquo;:</strong>
200 <br><dt>&lsquo;<samp><span class="samp">-f</span></samp>&rsquo;<dd>Force package installation (implies -p).
202 <br><dt>&lsquo;<samp><span class="samp">-P</span></samp>&rsquo;<dd>Extract package on an installation tree.
204 <p>This option sets &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.
206 <p>Default value: <em>PREFIX/pkg</em>
208 <br><dt>&lsquo;<samp><span class="samp">-p</span></samp>&rsquo;<dd>Prune conflicts.
210 <br><dt>&lsquo;<samp><span class="samp">-t</span></samp>&rsquo;<dd>Target directory for linking.
212 <p>This option sets &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;.
214 <p>Default value: <em>/</em>
216 <br><dt>&lsquo;<samp><span class="samp">-V</span></samp>&rsquo;<dd><em>graft(1)</em> very verbose.
218 <br><dt>&lsquo;<samp><span class="samp">-w</span></samp>&rsquo;<dd>Warn about the files that will be linked.
220 <pre class="sp">
222 </pre>
223 <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgremove</span></samp><strong>&rsquo;:</strong>
225 <br><dt>&lsquo;<samp><span class="samp">-k</span></samp>&rsquo;<dd>Keep (don't delete) package directory.
227 <br><dt>&lsquo;<samp><span class="samp">-P</span></samp>&rsquo;<dd>Remove from an installation tree.
229 <p>This option sets &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.
231 <p>Default value: <em>PREFIX/pkg</em>
233 <br><dt>&lsquo;<samp><span class="samp">-p</span></samp>&rsquo;<dd>Prune conflicts.
235 <br><dt>&lsquo;<samp><span class="samp">-t</span></samp>&rsquo;<dd>Target directory for unlinking.
237 <p>This option sets &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;.
239 <p>Default value: <em>/</em>
241 <br><dt>&lsquo;<samp><span class="samp">-V</span></samp>&rsquo;<dd><em>graft(1)</em> very verbose.
243 <pre class="sp">
245 </pre>
246 <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgupgrade</span></samp><strong>&rsquo;:</strong>
248 <br><dt>&lsquo;<samp><span class="samp">-k</span></samp>&rsquo;<dd>Keep (don't delete) package directory.
250 <br><dt>&lsquo;<samp><span class="samp">-P</span></samp>&rsquo;<dd>Package installation tree.
252 <p>This option sets &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.
254 <p>Default value: <em>PREFIX/pkg</em>
256 <br><dt>&lsquo;<samp><span class="samp">-t</span></samp>&rsquo;<dd>Target directory.
258 <p>This option sets &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;.
260 <p>Default value: <em>/</em>
262 <br><dt>&lsquo;<samp><span class="samp">-V</span></samp>&rsquo;<dd>Enable (very) verbose mode.
264 <br><dt>&lsquo;<samp><span class="samp">-w</span></samp>&rsquo;<dd>Warn about packages that will be upgraded.
266 <pre class="sp">
268 </pre>
269 <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgbuild</span></samp><strong>&rsquo;:</strong>
271 <br><dt>&lsquo;<samp><span class="samp">-a</span></samp>&rsquo;<dd>Architecture to use.
273 <p>This option sets &lsquo;<samp><span class="samp">${arch}</span></samp>&rsquo;.
275 <p>Default value is obtained via <em>uname(1)</em> as &lsquo;<samp><span class="samp">uname -m</span></samp>&rsquo;.
277 <br><dt>&lsquo;<samp><span class="samp">-i</span></samp>&rsquo;<dd>Increment release number.
279 <p>This option increment the release number when a package is produced.
281 <br><dt>&lsquo;<samp><span class="samp">-j</span></samp>&rsquo;<dd>Parallel jobs for the compiler
283 <p>This option sets &lsquo;<samp><span class="samp">${jobs}</span></samp>&rsquo;.
285 <p>Default value: <em>1</em>
287 <br><dt>&lsquo;<samp><span class="samp">-k</span></samp>&rsquo;<dd>Keep (don't delete) &lsquo;<samp><span class="samp">${srcdir}</span></samp>&rsquo; and &lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo;.
289 <br><dt>&lsquo;<samp><span class="samp">-n</span></samp>&rsquo;<dd>Don't create a .tlz package.
291 <br><dt>&lsquo;<samp><span class="samp">-o</span></samp>&rsquo;<dd>Where the produced packages are written.
293 <p>This option sets &lsquo;<samp><span class="samp">${outdir}</span></samp>&rsquo;.
295 <p>Default value: <em>/var/cache/qi/packages</em>
297 <br><dt>&lsquo;<samp><span class="samp">-U</span></samp>&rsquo;<dd>Perform package upgrade after build.
299 <p>This option calls to <samp><span class="command">pkgupgrade</span></samp>.
301 <pre class="sp">
303 </pre>
304 <strong>Options for command &lsquo;</strong><samp><span class="samp">pkgorder</span></samp><strong>&rsquo;:</strong>
306 <br><dt>&lsquo;<samp><span class="samp">-x</span></samp>&rsquo;<dd>Exclude depends file.
308 <h3 class="section">2.1 Environment</h3>
310 <p><a name="index-environment-3"></a>
311 Some influential environment variables:
313 <br><dt>&lsquo;<samp><span class="samp">QICFLAGS</span></samp>&rsquo;<dd>C compiler flags for building packages.
315 <p>Default value: <em>"-g0 -Os"</em>
317 <br><dt>&lsquo;<samp><span class="samp">QICXXFLAGS</span></samp>&rsquo;<dd>C++ compiler flags for building packages.
319 <p>Default value: <em>"-g0 -Os"</em>
321 <br><dt>&lsquo;<samp><span class="samp">QILDFLAGS</span></samp>&rsquo;<dd>Linker flags for building packages.
323 <p>Default value: <em>-s</em>
325 <br><dt>&lsquo;<samp><span class="samp">DOPOST</span></samp>&rsquo;<dd>post-install script control variable.
327 <p>The <samp><span class="env">DOPOST</span></samp> variable is currently used for <samp><span class="command">pkgadd</span></samp>,
328 <samp><span class="command">pkgupgrade</span></samp>, <samp><span class="command">pkgbuild</span></samp> (when option -U is given).
330 <p>A different value than "DOPOST" omits the execution of the post-install
331 script (if any).
333 <br><dt>&lsquo;<samp><span class="samp">RC</span></samp>&rsquo;<dd>Runtime configuration file.
335 <p>A different value than "RC" overrides the configuration file.
337 <p>This is used by: <samp><span class="command">pkgadd</span></samp>, <samp><span class="command">pkgremove</span></samp>,
338 <samp><span class="command">pkgupgrade</span></samp>, <samp><span class="command">pkgbuild</span></samp>.
340 <br><dt>&lsquo;<samp><span class="samp">TMPDIR</span></samp>&rsquo;<dd>Temporary directory (by default <em>/tmp</em>).
342 <p><samp><span class="env">TMPDIR</span></samp> is expanded with random numbers for major security.
344 <p>This is used by: <samp><span class="command">pkgbuild</span></samp>, <samp><span class="command">pkgerupt</span></samp>.
345 </dl>
347 <h3 class="section">2.2 Notes</h3>
349 <p><a name="index-notes-4"></a>
350 <ul>
351 <li>Command names has been prefixed with &lsquo;<samp><span class="samp">pkg</span></samp>&rsquo; to facilitate the
352 set in relation to its purpose.
354 <li>The <em>PREFIX</em> reference is related with the installation
355 prefix of Qi.
357 <li>All the options can be mixed. Options specified in the
358 command-line have priority over the config file <samp><span class="file">qirc</span></samp>.
359 If there are no options, and if <samp><span class="file">qirc</span></samp> is not present,
360 default (internal) values will be used instead.
361 </ul>
363 <div class="node">
364 <a name="The-qirc-file"></a>
365 <p><hr>
366 Next:&nbsp;<a rel="next" accesskey="n" href="#Packages">Packages</a>,
367 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invocation">Invocation</a>,
368 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
370 </div>
372 <h2 class="chapter">3 The qirc file</h2>
374 <p><a name="index-the-qirc-file-5"></a>
375 <samp><span class="file">qirc</span></samp> is the configuration file for Qi used at runtime during the
376 installation, removal of a package or when a recipe is built. This
377 file is optional, and it can be useful to define variables and
378 configure external tools (such as a download manager) for default use.
380 <ul>
381 <li>Variables are declared as &lsquo;<samp><span class="samp">name=value</span></samp>&rsquo;.
383 <li>Declaration of values should only take one line, no line break.
385 <li>Assignments like &lsquo;<samp><span class="samp">name=$var</span></samp>&rsquo; are only interpreted as
386 literal.
387 </ul>
389 <p class="noindent">The options specified in the command-line can override the values
390 specified in the configuration file. For more information, see
391 <a href="#Invocation">Invocation</a>.
393 <p class="noindent">The order in which Qi looks for this file is:
395 <ol type=1 start=1>
396 <li><samp><span class="env">${HOME}/.qirc</span></samp>
397 Effective user.
399 <li>&lsquo;<samp><span class="samp">${sysconfdir}/qirc</span></samp>&rsquo;
400 System-wide.
401 </ol>
403 <p>If you intend to run Qi for a specific user, you should copy the file
404 &lsquo;<samp><span class="samp">${sysconfdir}/qirc</span></samp>&rsquo; to <samp><span class="env">${HOME}/.qirc</span></samp> setting
405 &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo; and &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo; for your <samp><span class="env">$HOME</span></samp>.
407 <div class="node">
408 <a name="Packages"></a>
409 <p><hr>
410 Next:&nbsp;<a rel="next" accesskey="n" href="#Recipes">Recipes</a>,
411 Previous:&nbsp;<a rel="previous" accesskey="p" href="#The-qirc-file">The qirc file</a>,
412 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
414 </div>
416 <h2 class="chapter">4 Packages</h2>
418 <p><a name="index-packages-6"></a>
419 A package is a suite of programs usually distributed in binary form
420 which may also contain manual pages, documentation, or any other file
421 associated to a specific software.
423 <p>The Qi package format is a simple redistributable <em>tar(1)</em> archive
424 compressed with <em>lzip(1)</em>. The package extension ends in ".tlz".
426 <p class="noindent">Both package installation and package deinstallation are managed using
427 &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo; and &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo;:
429 <p>&lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo; is a common directory tree where the package contents
430 is decompressed (resides). By default the tree is located at
431 <em>PREFIX/pkg</em>.
433 <p>&lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo; is a target directory where the links will be
434 made taking &lsquo;<samp><span class="samp">${packagedir}/package_name</span></samp>&rsquo; into account.
436 <p>Packages are installed in self-contained directory trees and symbolic
437 links from a common area are made to the package files. This allows
438 multiple versions of the same package to co-exist on the one system.
440 <p>All the links to install or to remove a package are managed using
441 <em>graft(1)</em>. Since multiple packages can be installed or removed
442 at the same time, certain conflicts may arise between the packages.
444 <p>According to the User's Guide of Graft<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>,
445 a conflict is defined as one of the following conditions:
447 <ul>
448 <li>If the package object is a directory and the target object exists
449 but is not a directory.
451 <li>If the package object is not a directory and the target object
452 exists and is not a symbolic link.
454 <li>If the package object is not a directory and the target object
455 exists and is a symbolic link to something other than the package
456 object.
457 </ul>
459 <p class="noindent">Qi's default behavior is to not proceed with the installation when a
460 conflict occurs. But when a package that is going to be removed is in
461 conflict with another package, <em>graft(1)</em> removes those parts that
462 are not in conflict, leaving the links belonging to the original
463 package. This behavior can be changed if the option -p is specified
464 (see the examples below).
466 <h3 class="section">4.1 Adding packages</h3>
468 <p><a name="index-adding-packages-7"></a>
469 This sort order is particularly useful just before the actual package
470 installation, because it helps to understand how the package
471 installation works:
473 <ol type=1 start=1>
474 <li>Detects and reports if the package is already installed.
476 <li>Ignores some signals up to completing the installation:
477 HUP INT QUIT ABRT TERM.
479 <li>The integrity of the file (package) is checked.
481 <li>Creates required directory for the package as
482 &lsquo;<samp><span class="samp">${packagedir}/package_name</span></samp>&rsquo;.
484 <li>Decompress the content of the package in
485 &lsquo;<samp><span class="samp">${packagedir}/package_name</span></samp>&rsquo;.
487 <li>A test of the package is performed before completing the
488 installation to see if there are no conflicts with another package.
489 This is the default behavior if -p is not supplied.
491 <li><em>graft(1)</em> is invoked to install symbolic links from
492 the package installation directory to the target directory.
494 <li>If the meta file is readable, the description will be shown for
495 the package.
497 <li>Run post install instructions from <samp><span class="file">post-install</span></samp>, if any.
498 </ol>
500 <p class="noindent"><em>Usage:</em> pkgadd [-hfpVw] [-P &lt;DIR&gt;] [-t &lt;DIR&gt;] [package.tlz ...]
502 <p>To install a single package, simply type:
504 <pre class="example"> pkgadd coreutils-8.24-x86_64+1.tlz
505 </pre>
506 <p>To install multiple packages at once:
508 <pre class="example"> pkgadd gcc-4.9.3-x86_64+1.tlz rafaela-2.2-i586+1.tlz ...
509 </pre>
510 <p>Warn about the files that will be linked:
512 <pre class="example"> pkgadd -w gcc-4.9.3-x86_64+1.tlz
513 </pre>
514 <ul>
515 <li>This is to verify the content of a package before installing it.
516 </ul>
518 <p>See what happens when a package is installed (very verbose):
520 <pre class="example"> pkgadd -V mariana-3.0-x86_64+1.tlz
521 </pre>
522 <ul>
523 <li>This is for a detailed (long) output.
524 </ul>
526 <p>Installing in a different directory tree and target:
528 <pre class="example"> pkgadd -P /tmp/pkgdir -T /tmp/targetdir lzip-1.17-i586+1.tlz
529 </pre>
530 <p>When a package is already installed, <samp><span class="command">pkgadd</span></samp> refuses to
531 continue. This is to keep some control over the database of your
532 packages, if you really want to force the installation of a package,
533 you can use the -f option (which implies -p). See below.
535 <p><strong>Pruning conflicts</strong>
537 <p>Remove objects (files, links or directories) from the target
538 directory that are in conflict with the package directory:
540 <pre class="example"> pkgadd -p zutils-1.4-x86_64+1.tlz
541 </pre>
542 <p>When the -p option is used, it proceeds to install the package
543 normally, but first will try to remove any conflict. Use it with care,
544 combine this option with -V.
546 <h3 class="section">4.2 Removing packages</h3>
548 <p><a name="index-removing-packages-8"></a>
549 This sort order is particularly useful just before the actual package
550 deinstallation, because it helps to understand how the package
551 deinstallation works:
553 <ol type=1 start=1>
554 <li>Look for a package name to remove inside of
555 &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;. Package names must be specified using the full
556 package name, such as "name-version-arch+release.tlz" or specifying the
557 package name directory.
559 <li>Ignores some signals up to completing the deinstallation:
560 HUP INT QUIT ABRT TERM.
562 <li><em>graft(1)</em> is invoked to remove symbolic links from
563 the package installation directory to the target directory:
565 <p>If a conflict exists with another package, those links that are not in
566 conflict will be preserved. It's possible to prune all the conflicts
567 using the -p option.
569 <li>Remove directories made empty by package deletion. This has
570 effect on &lsquo;<samp><span class="samp">${targetdir}</span></samp>&rsquo; but not for &lsquo;<samp><span class="samp">${packagedir}</span></samp>&rsquo;.
572 <li>The package directory is deleted if the option -k is not
573 supplied.
574 </ol>
576 <p class="noindent"><em>Usage:</em> pkgremove [-hkpV] [-P &lt;DIR&gt;] [-t &lt;DIR&gt;] [package_name ...]
578 <p>To remove a package, just execute the command:
580 <pre class="example"> pkgremove xz-5.2.2-x86_64+1
581 </pre>
582 <p>To remove multiple versions of the same package:
584 <pre class="example"> pkgremove xz*
585 </pre>
586 <p>To remove multiple packages at once:
588 <pre class="example"> pkgremove foo bar baz ...
589 </pre>
590 <p>Detailed output (very verbose):
592 <pre class="example"> pkgremove -V xz-5.2.2-x86_64+1
593 </pre>
594 <p>Removing from a different directory tree and target:
596 <pre class="example"> pkgremove -P /tmp/pkgdir -T /tmp/targetdir lzip-1.17-x86_64+1
597 </pre>
598 <p>Pruning conflicts:
600 <pre class="example"> pkgremove -p -V hunter
601 </pre>
602 <h3 class="section">4.3 Upgrading packages</h3>
604 <p><a name="index-upgrading-packages-9"></a>
605 This sort order is particularly useful just before the actual package
606 upgrade, because it helps to understand how the package upgrade works:
608 <ol type=1 start=1>
609 <li>Prepare temporary location for the incoming package.
611 <li>Pre-install incoming package into the temporary location.
613 <li>Remove packages under the same name: this is considered
614 as the old packages. (Default behaviour if -k is not supplied).
616 <li>Upgrade or install the package calling to <samp><span class="command">pkgadd</span></samp>.
618 <li>Delete temporary location of the package.
619 </ol>
621 <p class="noindent"><em>Usage:</em> pkgupgrade [-hkVw] [-P &lt;DIR&gt;] [-t &lt;DIR&gt;] [package.tlz ...]
623 <p>Upgrading a package is simple as:
625 <pre class="example"> pkgupgrade coreutils-8.25-x86_64+1.tlz
626 </pre>
627 <p class="noindent">&lsquo;<samp><span class="samp">pkgupgrade</span></samp>&rsquo; uses <samp><span class="command">pkgadd</span></samp> and <samp><span class="command">pkgremove</span></samp> to
628 upgrade software packages. So it inherits the properties of each
629 utility, except here, only the essential options are provided. For
630 example, the option -V (for a detailed output) belongs to when these
631 utilities are invoked. The options -P and -t work in the same way as
632 the previous examples for <samp><span class="command">pkgadd</span></samp>, <samp><span class="command">pkgremove</span></samp>.
633 &lsquo;<samp><span class="samp">pkgupgrade</span></samp>&rsquo; will try to update the package or to install it
634 (in case it has not been installed).
636 <p>To see what packages will be updated (if any), always type:
638 <pre class="example"> pkgupgrade -w coreutils-8.25-x86_64+1.tlz
639 </pre>
640 <h3 class="section">4.4 Notes</h3>
642 <p><a name="index-notes-10"></a>
643 <ul>
644 <li>Some signals like HUP INT QUIT ABRT TERM are ignored on the
645 package installation or deinstallation. The intention is to ignore
646 the cancellation while the package is being installed or removed (e.g.
647 Ctrl+C, terminal window closed, etc.). The installation or removal
648 of a package can be crucial for the proper functioning of the system.
650 <li>The meta file is read from the directory where the package is
651 found.
653 <li>A post-install script is read from
654 &lsquo;<samp><span class="samp">${packagedir}/package_name/var/lib/qi/post-install/name.install</span></samp>&rsquo;.
656 <li>Default behavior is to upgrade or install a package removing old
657 packages, this is "packages found under the same name". If you want to
658 preserve the multiple versions of the same package, you must pass the
659 -k option.
660 </ul>
662 <div class="node">
663 <a name="Recipes"></a>
664 <p><hr>
665 Next:&nbsp;<a rel="next" accesskey="n" href="#Order-files">Order files</a>,
666 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Packages">Packages</a>,
667 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
669 </div>
671 <h2 class="chapter">5 Recipes</h2>
673 <p><a name="index-recipes-11"></a>
674 A recipe is a file telling qi what to do. Most often, the recipe
675 tells qi how to build a binary package from a source tarball.
677 <p>A recipe has two parts: a list of variable definitions and a list of
678 sections. By convention, the syntax of a section is:
680 <pre class="example"> section_name() {
681 section lines
683 </pre>
684 <p>The section name is followed by parentheses, one space and an opening
685 brace. The line finishing the section contains just a closing brace.
686 The section names or the function names currently recognized are
687 &lsquo;<samp><span class="samp">build</span></samp>&rsquo;.
689 <p>The &lsquo;<samp><span class="samp">build</span></samp>&rsquo; section is an augmented shell script. This is the main
690 section (or <strong>shell function</strong>) which contains the instructions to
691 build and produce a package.
693 <h3 class="section">5.1 Variables</h3>
695 <p><a name="index-variables-12"></a>
696 A "variable" is a <strong>shell variable</strong> defined either in <samp><span class="file">qirc</span></samp>
697 or in a recipe to represent a string of text, called the variable's
698 "value". These values are substituted by explicit request in the
699 definitions of other variables or in calls to external commands.
701 <p>Variables can represent lists of file names, options to pass to
702 compilers, programs to run, directories to look in for source files,
703 directories to write output in, or anything else you can imagine.
705 <p>Definitions of variables in qi have four levels of precedence.
706 Options which define variables from the command-line override those
707 specified in the <samp><span class="file">qirc</span></samp> file, while variables defined in the recipe
708 override those specified in <samp><span class="file">qirc</span></samp>, taking priority over those
709 variables settled by options via command-line. Finally, some variables
710 (arch, jobs, outdir, worktree, tardir, netget, rsync) have default
711 values if they are not defined anywhere.
713 <p>Options that set variables through the command-line can only reference
714 variables defined in <samp><span class="file">qirc</span></samp> and variables with default values.
716 <p>Definitions of variables in <samp><span class="file">qirc</span></samp> can only reference variables
717 previously defined in <samp><span class="file">qirc</span></samp> and variables with default values.
719 <p>Definitions of variables in the recipe can only reference variables
720 settled by command-line, variables previously defined in the recipe,
721 variables defined in <samp><span class="file">qirc</span></samp>, and variables with default values.
723 <h4 class="subsection">5.1.1 Special variables</h4>
725 <p><a name="index-special-variables-13"></a>
726 The three variables &lsquo;<samp><span class="samp">arch</span></samp>&rsquo;, &lsquo;<samp><span class="samp">jobs</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">outdir</span></samp>&rsquo; can
727 only be set using command line options or in <samp><span class="file">qirc</span></samp>. If not
728 specified, they have default values.
730 <p>&lsquo;<samp><span class="samp">arch</span></samp>&rsquo; is the architecture to compose the package name. Its
731 value is available in the recipe as &lsquo;<samp><span class="samp">${arch}</span></samp>&rsquo;. Default value is
732 the output of &lsquo;<samp><span class="samp">uname -m</span></samp>&rsquo;.
734 <p>&lsquo;<samp><span class="samp">jobs</span></samp>&rsquo; is the number of jobs to pass to the compiler. Its
735 default value is available in the recipe as &lsquo;<samp><span class="samp">${jobs}</span></samp>&rsquo;. Defaults
736 to &lsquo;<samp><span class="samp">1</span></samp>&rsquo;.
738 <p>&lsquo;<samp><span class="samp">outdir</span></samp>&rsquo; is the directory where the produced packages are
739 written. This variable cannot be redefined in the recipe. Defaults to
740 &lsquo;<samp><span class="samp">/var/cache/qi/packages</span></samp>&rsquo;.
742 <p>&lsquo;<samp><span class="samp">worktree</span></samp>&rsquo; is the working tree where archives, patches, and
743 recipes are expected. This variable cannot be redefined in the
744 recipe. Defaults to &lsquo;<samp><span class="samp">/usr/src/qi</span></samp>&rsquo;.
746 <p>The variable &lsquo;<samp><span class="samp">tardir</span></samp>&rsquo; is defined in the recipe to the directory
747 where the tarball containing the source can be found. The full name of
748 the tarball is commonly used as &lsquo;<samp><span class="samp">${tardir}/$tarname</span></samp>&rsquo;. A value
749 of &lsquo;<samp><span class="samp">.</span></samp>&rsquo; for &lsquo;<samp><span class="samp">tardir</span></samp>&rsquo; sets it to the value of the CWD (Current
750 Working Directory), this means, from where the recipe is located.
752 <p>The two variables &lsquo;<samp><span class="samp">srcdir</span></samp>&rsquo; and &lsquo;<samp><span class="samp">destdir</span></samp>&rsquo; can be defined in
753 the recipe, as any other variable, but if they are not, Qi uses default
754 values for them when building the package.
756 <p>&lsquo;<samp><span class="samp">srcdir</span></samp>&rsquo; contains the source code to be compiled, and defaults to
757 &lsquo;<samp><span class="samp">${program}-${version}</span></samp>&rsquo;.
759 <p>&lsquo;<samp><span class="samp">destdir</span></samp>&rsquo; is the place where the built package will be installed,
760 and defaults to &lsquo;<samp><span class="samp">${TMPDIR}/package-${program}</span></samp>&rsquo;.
762 <p>If &lsquo;<samp><span class="samp">pkgname</span></samp>&rsquo; is left undefined, the special variable
763 &lsquo;<samp><span class="samp">program</span></samp>&rsquo; is assigned by default. If &lsquo;<samp><span class="samp">pkgversion</span></samp>&rsquo; is left
764 undefined, the special variable &lsquo;<samp><span class="samp">version</span></samp>&rsquo; is assigned by default.
766 <p>&lsquo;<samp><span class="samp">pkgname</span></samp>&rsquo;, &lsquo;<samp><span class="samp">pkgversion</span></samp>&rsquo;, along with &lsquo;<samp><span class="samp">version</span></samp>&rsquo;,
767 &lsquo;<samp><span class="samp">arch</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">release</span></samp>&rsquo;, are used to produce the name of the
768 package in the form
769 &lsquo;<samp><span class="samp">${pkgname}-${pkgversion}-${arch}+${release}.tlz</span></samp>&rsquo;. All of
770 them must be defined in the recipe, excepting &lsquo;<samp><span class="samp">arch</span></samp>&rsquo;, which is
771 optional.
773 <ul>
774 <li>&lsquo;<samp><span class="samp">program</span></samp>&rsquo;: name of the package.
776 <li>&lsquo;<samp><span class="samp">version</span></samp>&rsquo;: version of the package.
778 <li>&lsquo;<samp><span class="samp">arch</span></samp>&rsquo;: architecture of the package.
780 <li>&lsquo;<samp><span class="samp">release</span></samp>&rsquo;: release number of the package. It is recommended to
781 increase this number after any significant change in the recipe is made.
782 </ul>
784 <p class="noindent">Obtaining sources over the network must be declared in the recipe using
785 the &lsquo;<samp><span class="samp">fetch</span></samp>&rsquo; variable. Use double quotes for separated values.
787 <p>The variables &lsquo;<samp><span class="samp">netget</span></samp>&rsquo; and &lsquo;<samp><span class="samp">rsync</span></samp>&rsquo; can be defined in
788 <samp><span class="file">qirc</span></samp> to establish a network downloader in order to get the
789 sources. If they are not defined, qi uses default values:
791 <p>&lsquo;<samp><span class="samp">netget</span></samp>&rsquo; is the general network downloader tool for use, and
792 defaults to &lsquo;<samp><span class="samp">wget -c -w1 -t3 --no-check-certificate</span></samp>&rsquo;.
794 <p>&lsquo;<samp><span class="samp">rsync</span></samp>&rsquo; is the network tool for sources containing the prefix for
795 the RSYNC protocol, and defaults to
796 &lsquo;<samp><span class="samp">rsync -v -a -L -z -i --progress</span></samp>&rsquo;.
798 <p class="noindent">There are three important variables to produce meta information of the
799 package: &lsquo;<samp><span class="samp">description</span></samp>&rsquo;, &lsquo;<samp><span class="samp">homepage</span></samp>&rsquo;, &lsquo;<samp><span class="samp">license</span></samp>&rsquo;.
801 <p>The variable &lsquo;<samp><span class="samp">description</span></samp>&rsquo; is special to write the description of the
802 package, which will be shown when installed.
804 <p>A description has two parts: a brief description and a long
805 description. By convention, the syntax of a description is:
807 <pre class="example"> description="
808 Brief description.
810 Long description.
812 </pre>
813 <p class="noindent">The first (substantial) line of the value is a brief description of the
814 software (called the "blurb"). A new (blank) line is followed to
815 separate the brief description from the long description.
817 <p>An example looks like:
819 <pre class="example"> description="
820 A source builder and a package manager.
822 Qi is a source builder and a package manager. It contains a set of
823 tools to build, install, remove, and upgrade software packages.
825 Qi follows the philosophy of the simplicity without adding too many
826 features, such as those that can be found in popular package managers.
827 Basically it does two things: builds packages and manages them.
829 </pre>
830 <ul>
831 <li>Consider a length limit of 78 characters as maximum.
832 See <a href="#Recipes">The meta file</a>.
833 </ul>
835 <p class="noindent">The &lsquo;<samp><span class="samp">homepage</span></samp>&rsquo; variable is used simply to declare the main site or
836 home of the source, thus:
838 <pre class="example"> homepage=http://www.dragora.org
839 </pre>
840 <p class="noindent">The variable &lsquo;<samp><span class="samp">license</span></samp>&rsquo; is used for license information<a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a>.
841 Some code in the program can be covered by license A, license B, or
842 license C. For "separate licensing" or "heterogeneous licensing",
843 we suggest using <strong>|</strong> for a disjunction, <strong>&amp;</strong> for a
844 conjunction (if that ever happens in a significant way), and comma
845 for heterogeneous licensing. Comma would have lower precedence. Plus
846 added special terms.
848 <pre class="example"> license="LGPL, GPL | Artistic, GPL + added permission"
849 </pre>
850 <h4 class="subsection">5.1.2 Variables from the environment</h4>
852 <p><a name="index-variables-from-the-environment-14"></a>
853 The variables <samp><span class="env">QICFLAGS</span></samp>, <samp><span class="env">QICXXFLAGS</span></samp>, and <samp><span class="env">QILDFLAGS</span></samp> have
854 no effect by default. The environment variables such as <samp><span class="env">CFLAGS</span></samp>,
855 <samp><span class="env">CXXFLAGS</span></samp>, and <samp><span class="env">LDFLAGS</span></samp> are unset at compile time.
857 <p>Recommended practices is to set variables in front of &lsquo;<samp><span class="samp">configure</span></samp>&rsquo;
858 or in front of <em>make(1)</em> instead of exporting to the environment.
859 As follows:
861 <blockquote>
862 Variables not defined in a site shell script can be set in the
863 environment passed to configure. However, some packages may run
864 configure again during the build, and the customized values of these
865 variables may be lost. In order to avoid this problem, you should set
866 them in the configure command line, using &lsquo;<samp><span class="samp">VAR=value</span></samp>&rsquo;. For
867 example:
869 <p><code>./configure CC=/usr/local2/bin/gcc</code>
871 <p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html</a>
872 </blockquote>
874 <blockquote>
875 Indeed, while configure can notice the definition of CC in &lsquo;<samp><span class="samp">./configure
876 CC=bizarre-cc</span></samp>&rsquo;, it is impossible to notice it in &lsquo;<samp><span class="samp">CC=bizarre-cc
877 ./configure</span></samp>&rsquo;, which, unfortunately, is what most users do.
879 <p>[...]
881 <p>configure: error: changes in the environment can compromise the build.
883 <p><a href="http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</a>
884 </blockquote>
886 <blockquote>
887 It is not wise for makefiles to depend for their functioning on
888 environment variables set up outside their control, since this would
889 cause different users to get different results from the same makefile.
890 This is against the whole purpose of most makefiles.
892 <p><a href="http://gnu.org/software/make/manual/make.html#Environment">http://gnu.org/software/make/manual/make.html#Environment</a>
893 </blockquote>
895 <h3 class="section">5.2 The meta file</h3>
897 <p><a name="index-the-meta-file-15"></a>
898 The "meta file" is an external file created by <samp><span class="command">pkgbuild</span></samp> when
899 a recipe is processed and when a package is produced. The file is
900 generated as &lsquo;<samp><span class="samp">${full_pkgname}.tlz.txt</span></samp>&rsquo; which contains
901 information about the package such as &lsquo;<samp><span class="samp">program</span></samp>&rsquo;, &lsquo;<samp><span class="samp">version</span></samp>&rsquo;,
902 &lsquo;<samp><span class="samp">release</span></samp>&rsquo;. Also definitions of the special variables
903 &lsquo;<samp><span class="samp">fetch</span></samp>&rsquo;, &lsquo;<samp><span class="samp">description</span></samp>&rsquo;, &lsquo;<samp><span class="samp">homepage</span></samp>&rsquo;, &lsquo;<samp><span class="samp">license</span></samp>&rsquo;.
905 <p>A meta file has the purpose to extract information and the purpose to
906 reflect essential information to the user without having to check
907 inside the package itself.
909 <p>The meta file is basically composed as:
911 <pre class="example"> # Description
913 variable=value
915 </pre>
916 <p class="noindent">The description is extracted from the declared variable
917 &lsquo;<samp><span class="samp">description</span></samp>&rsquo;, where each line is interpreted literally and where
918 the description is pre-formatted to fit in (exactly) 80 columns. Plus
919 &lsquo;<samp><span class="samp"># </span></samp>&rsquo; is prepend to each line.
921 <p>Followed by new line, the rest is composed by variables; the inclusion
922 of its values, may vary. For example, in addition to the special
923 variables, there are implicit variables such as &lsquo;<samp><span class="samp">blurb</span></samp>&rsquo;,
924 &lsquo;<samp><span class="samp">depends</span></samp>&rsquo;.
926 <p>The &lsquo;<samp><span class="samp">blurb</span></samp>&rsquo; variable is related to the special variable
927 &lsquo;<samp><span class="samp">description</span></samp>&rsquo;. Always taking the first (substantial) line
928 or "brief description".
930 <p>The value of &lsquo;<samp><span class="samp">depends</span></samp>&rsquo; only will be included if the
931 <samp><span class="file">depends</span></samp> file is a regular file. See <a href="#Order-files">The depends file</a>.
933 <p class="noindent">Now let's take a look on a real example of a meta file:
935 <pre class="example"> # A lossless data compressor based on the LZMA algorithm.
937 # Clzip is a lossless data compressor with a user interface similar to
938 # the one of gzip or bzip2. Clzip is about as fast as gzip, compresses
939 # most files more than bzip2, and is better than both from a data
940 # recovery perspective.
942 # Clzip uses the lzip file format; the files produced by clzip are fully
943 # compatible with lzip-1.4 or newer, and can be rescued with lziprecover.
945 # Clzip is in fact a C language version of lzip, intended for embedded
946 # devices or systems lacking a C++ compiler.
948 QICFLAGS="-g0 -Os"
949 QICXXFLAGS="-g0 -Os"
950 QILDFLAGS="-s"
951 program=clzip
952 version=1.8
953 release=1
954 blurb="A lossless data compressor based on the LZMA algorithm."
955 homepage="http://lzip.nongnu.org/clzip.html"
956 license="GPLv2+"
957 fetch="http://download.savannah.gnu.org/releases/lzip/clzip/clzip-1.8.tar.gz"
958 depends=" "
960 </pre>
961 <p>Creation of the meta file is made in &lsquo;<samp><span class="samp">${outdir}</span></samp>&rsquo;.
963 <h3 class="section">5.3 Building packages</h3>
965 <p><a name="index-building-packages-16"></a>
966 This sort order is particularly useful just before the actual package
967 build, because it helps to understand how a package is being built:
969 <ol type=1 start=1>
970 <li>A recipe is read from the current directory, if not, it will be
971 looked in &lsquo;<samp><span class="samp">${worktree}/recipes</span></samp>&rsquo;. Names of recipes can be
972 invoked relative to &lsquo;<samp><span class="samp">${worktree}/recipes</span></samp>&rsquo;. The recipe must be
973 a regular file and must be readable by the user who is running the
974 command.
976 <li>Checks are made when the recipe is imported (included), essential
977 variable names cannot be empty: &lsquo;<samp><span class="samp">program</span></samp>&rsquo;, &lsquo;<samp><span class="samp">version</span></samp>&rsquo;,
978 &lsquo;<samp><span class="samp">release</span></samp>&rsquo;. Also the main function &lsquo;<samp><span class="samp">build()</span></samp>&rsquo; must be present.
980 <li><samp><span class="command">pkgbuild</span></samp> tries to obtain the sources remotely if it
981 does not exist locally (&lsquo;<samp><span class="samp">${tardir}</span></samp>&rsquo;). Once the source is
982 already in place, its timestamp is updated, creating or updating the
983 SHA1 sum.
985 <li>Required directories are created: &lsquo;<samp><span class="samp">${TMPDIR}/$srcdir</span></samp>&rsquo;,
986 &lsquo;<samp><span class="samp">${outdir}</span></samp>&rsquo;, &lsquo;<samp><span class="samp">${destdir}/var/lib/qi/recipes</span></samp>&rsquo;.
988 <li>Sane ownerships and permissions are applied to the full source
989 directory: &lsquo;<samp><span class="samp">${TMPDIR}/$srcdir</span></samp>&rsquo;.
991 <li>The main function &lsquo;<samp><span class="samp">build()</span></samp>&rsquo; is called. Exits immediately if
992 a command exits with a non-zero status.
994 <li>A package is going to be created under the following conditions:
996 <ul>
997 <li>If &lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo; is not empty.
999 <li>If the option -n was not given.
1000 </ul>
1002 <p>A copy of the recipe (file) is included on
1003 &lsquo;<samp><span class="samp">${destdir}/var/lib/qi/recipes</span></samp>&rsquo; as &lsquo;<samp><span class="samp">${full_pkgname}.recipe</span></samp>&rsquo;.
1005 <p>If the <samp><span class="file">post-install</span></samp> script is in the current working directory
1006 or from where the recipe name resides, it will be added as
1007 &lsquo;<samp><span class="samp">${destdir}/var/lib/qi/post-install/${full_pkgname}.install</span></samp>&rsquo;.
1009 <p>The package is produced from the content of &lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo;. First,
1010 creating a tarball, and then compressing it using the maximum level of
1011 compression of <em>lzip(1)</em>.
1013 <li>By default, directories like &lsquo;<samp><span class="samp">${TMPDIR}/$srcdir</span></samp>&rsquo; and
1014 &lsquo;<samp><span class="samp">${destdir}</span></samp>&rsquo; are deleted.
1016 <li>If the option -U is given, <samp><span class="command">pkgupgrade</span></samp> is invoked to
1017 install or upgrade the package.
1019 </ol>
1021 <p class="noindent"><em>Usage:</em> pkgbuild [-hiknU] [-a &lt;ARCH&gt;] [-j &lt;JOBS&gt;] [-o &lt;DIR&gt;] [recipe ...]
1023 <p>To build a single package, simply type:
1025 <pre class="example"> pkgbuild clzip.recipe
1026 </pre>
1027 <p>Compile passing parallel jobs to the compiler for speed up the process:
1029 <pre class="example"> pkgbuild -j4 clzip.recipe
1030 </pre>
1031 <p>To build and install or upgrade multiple packages at once:
1033 <pre class="example"> pkgbuild -U clzip.recipe zutils.recipe matias.recipe
1034 </pre>
1035 <p>Reading recipes and building from the output of a command:
1037 <pre class="example"> cat depends | pkgbuild -
1038 </pre>
1039 <p>Incrementing the release number after a significant change in a recipe:
1040 <pre class="example"> pkgbuild -i stargazer.recipe
1041 </pre>
1042 <p class="noindent">If the recipe name cannot be read from the current directory or from
1043 a specific path name, &lsquo;<samp><span class="samp">${worktree}/recipes</span></samp>&rsquo; is used for the
1044 search:
1046 <p>There is a special case for the names of recipes &lsquo;<samp><span class="samp">recipe</span></samp>&rsquo;.
1047 <samp><span class="command">pkgbuild</span></samp> can complete the recipe name without being required
1048 to be specified in the command-line, only if the name of the recipe is
1049 &lsquo;<samp><span class="samp">recipe</span></samp>&rsquo;. For example:
1051 <pre class="example"> pkgbuild devel/gcc
1052 </pre>
1053 <p>Will complete the search as &lsquo;<samp><span class="samp">${worktree}/recipes/devel/gcc/recipe</span></samp>&rsquo;.
1055 <h3 class="section">5.4 Writing recipes</h3>
1057 <p><a name="index-writing-recipes-17"></a>
1059 <h4 class="subsection">5.4.1 Internal functions</h4>
1061 <p><a name="index-internal-functions-18"></a>
1062 Some internal functions are available to be applied on the recipe:
1064 <dl>
1065 <dt>&lsquo;<samp><span class="samp">unpack()</span></samp>&rsquo;<dd>The unpack function can decompress multiple (compressed) files while
1066 verifies the integrity. Depending on where the function is called,
1067 the decompression occurs in the current working directory.
1069 <p>Usage: <code>unpack file(s) ...</code>
1071 <p>The cases supported for the special extensions are: *.tar, *.tar.*,
1072 *.tgz*, *.tbz*, *.tlz*, *.txz*, *.zip, *.ZIP, *.gz, *.bz2, *.lz.
1073 </dl>
1075 <div class="node">
1076 <a name="Order-files"></a>
1077 <p><hr>
1078 Next:&nbsp;<a rel="next" accesskey="n" href="#Examine-packages">Examine packages</a>,
1079 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Recipes">Recipes</a>,
1080 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1082 </div>
1084 <h2 class="chapter">6 Order files</h2>
1086 <p><a name="index-g_t_002eorder-files-19"></a>
1087 <samp><span class="command">pkgorder</span></samp> has the purpose to resolve the build order through
1088 .order files. In other words, is a good complement for
1089 <samp><span class="command">pkgbuild</span></samp>.
1091 <p class="noindent"><em>Usage:</em> pkgorder [-x] [file_name.order ...]
1093 <p class="noindent">Basically, <samp><span class="command">pkgorder</span></samp> reads from a declared file which ends in
1094 ".order". The output is an ordered list of recipe names which can be
1095 passed to <samp><span class="command">pkgbuild</span></samp> (via a pipe) to build a number or a series
1096 of packages.
1098 <p><span class="sc">Declaration</span>
1100 <p>If 'a' depends on 'b' and 'c', and 'c' depends on 'b' as well, the file
1101 might look like:
1103 <pre class="example"> a.recipe: c.recipe b.recipe
1104 b.recipe:
1105 c.recipe: b.recipe
1106 </pre>
1107 <p>Each letter represents a recipe name, complete dependencies for
1108 the first recipe name are listed in descending order, which is
1109 printed from right to left, and removed from left to right:
1111 <p><span class="sc">Output</span>
1113 <pre class="example"> b.recipe
1114 c.recipe
1115 a.recipe
1116 </pre>
1117 <ul>
1118 <li>Commented lines starting with a '#' are allowed. Blank lines,
1119 colons, parentheses, and end of line are removed.
1120 </ul>
1122 <h3 class="section">6.1 The depends file</h3>
1124 <p><a name="index-the-depends-file-20"></a>
1125 When <samp><span class="command">pkgorder</span></samp> read from an order file; by default, it will
1126 proceed to read the dependencies of each recipe. This behavior can be
1127 omitted if the -x option is given.
1129 <p>The procedure for reading the dependencies of each recipe is
1130 extracting the directory location where the order file resides. Then
1131 it iterates over the declared items extracting its location in search
1132 of the special file <samp><span class="file">depends</span></samp>.
1134 <ul>
1135 <li>The <samp><span class="file">depends</span></samp> file only is read (sequentially) if it is
1136 a regular file and is not empty.
1137 </ul>
1139 <p class="noindent">The special file <samp><span class="file">depends</span></samp> must contain a list of prerequisites
1140 for the recipe. Prerequisites are names of valid recipes, including
1141 its location. The location must be relative to &lsquo;<samp><span class="samp">${worktree}</span></samp>&rsquo;
1142 (variable described in <a href="#Recipes">Recipes</a>).
1144 <p>Example of a <samp><span class="file">depends</span></samp> file declared for <em>bash.recipe</em>:
1146 <pre class="example"> libs/readline/readline.recipe
1147 </pre>
1148 <p>Then, if <em>core/bash/bash.recipe</em> has been declared on
1149 <em>core.order</em>, the output would be:
1151 <pre class="example"> ...
1152 libs/readline/readline.recipe
1153 core/bash/bash.recipe
1155 </pre>
1156 <p>Combined in a pipe, <em>readline</em> represents the first dependency
1157 of <em>bash</em>:
1159 <pre class="example"> <code>pkgorder core.order | pkgbuild -U -</code>
1160 </pre>
1161 <div class="node">
1162 <a name="Examine-packages"></a>
1163 <p><hr>
1164 Next:&nbsp;<a rel="next" accesskey="n" href="#Messages">Messages</a>,
1165 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Order-files">Order files</a>,
1166 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1168 </div>
1170 <h2 class="chapter">7 Examine packages</h2>
1172 <p><a name="index-examine-packages-21"></a>
1173 <samp><span class="command">pkgerupt</span></samp> is a special command to examine packages for
1174 debugging purposes.
1176 <p class="noindent"><em>Usage:</em> pkgerupt [-h] [package.tlz ...]
1178 <p>When a package name is given <samp><span class="command">pkgerupt</span></samp> will create a random
1179 directory for the package. The prefix directory where the random
1180 directory is created is controlled by the <samp><span class="env">TMPDIR</span></samp> variable,
1181 by default <samp><span class="env">TMPDIR</span></samp> is assigned to <em>/tmp</em>. Creation mode
1182 is "u=,g=rwx,o=rwx" (0700).
1184 <p>The extraction to inspecting a package is equivalent to the shell
1185 instruction:
1187 <pre class="example"> <code>( umask 000 &amp;&amp; cd -- $PRVDIR &amp;&amp; lzip -cd - | tar -xf - ) &lt; $file</code>
1188 </pre>
1189 <p>The package content is decompressed in the random (private) directory
1190 via pipe. Creation mode is "u=rwx,g=rwx,o=rwx" (0777).
1192 <p>If there is any substantial change, consider increasing the build
1193 number when repackaging: edit the value of the &lsquo;<samp><span class="samp">release</span></samp>&rsquo; variable
1194 (recipe), compose the output file using the new number.
1196 <div class="node">
1197 <a name="Messages"></a>
1198 <p><hr>
1199 Next:&nbsp;<a rel="next" accesskey="n" href="#Exit-status">Exit status</a>,
1200 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Examine-packages">Examine packages</a>,
1201 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1203 </div>
1205 <h2 class="chapter">8 Messages</h2>
1207 <p><a name="index-output-messages-22"></a>
1208 Some symbols are used for output messages to help to identify
1209 the messages shown by the tools in Qi. There are four simple
1210 categories where the symbols are represented:
1212 <pre class="sp">
1214 </pre>
1215 <strong>Specifics</strong>
1217 <p>This symbols are unique to identify the running tool:
1219 <dl>
1220 <dt>&lsquo;<samp><span class="samp">+</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgadd</span></samp> tool.
1222 <br><dt>&lsquo;<samp><span class="samp">-</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgremove</span></samp> tool.
1224 <br><dt>&lsquo;<samp><span class="samp">~</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgupgrade</span></samp> tool.
1226 <br><dt>&lsquo;<samp><span class="samp">#</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgbuild</span></samp> tool.
1228 <br><dt>&lsquo;<samp><span class="samp">=</span></samp>&rsquo;<dd>This symbol belongs to the <samp><span class="command">pkgerupt</span></samp> tool.
1230 <br><dt>&lsquo;<samp><span class="samp">%</span></samp>&rsquo;<dd>This symbol is used to scan a package or to warn when
1231 the option is used.
1233 <p>Specific symbols are enclosed between &lsquo;<samp><span class="samp">( )</span></samp>&rsquo;.
1234 </dl>
1236 <dl>
1237 <strong>Preventive</strong>
1239 <p>Preventive symbols are intended to alert the user about unforeseen
1240 or important situations, and to meet requirements before proceeding:
1242 <dt>&lsquo;<samp><span class="samp">*</span></samp>&rsquo;<dd>Normally used for testing compressed sources, obtain remote sources,
1243 or set system permissions.
1245 <p>Preventive symbols are enclosed between &lsquo;<samp><span class="samp">[ ]</span></samp>&rsquo;.
1246 </dl>
1248 <dl>
1249 <strong>Informative</strong>
1251 <p>Informative symbols are intended to inform users the most essential
1252 tasks during the execution:
1254 <dt>&lsquo;<samp><span class="samp">i</span></samp>&rsquo;<dd>Symbol used when a task is going to be performed or when a task has
1255 been completed.
1257 <br><dt>&lsquo;<samp><span class="samp">!</span></samp>&rsquo;<dd>This symbol informs about deleting files.
1259 <p>Informative symbols are enclosed between &lsquo;<samp><span class="samp">[ ]</span></samp>&rsquo;.
1260 </dl>
1262 <p><strong>Transitory</strong>
1264 <p>Transitory symbols are part for occasional changes (&lsquo;<samp><span class="samp">@</span></samp>&rsquo;) but no
1265 less important. Also to invoke Qi tools externally (&lsquo;<samp><span class="samp">^</span></samp>&rsquo;).
1267 <p>Transitory symbols are enclosed between &lsquo;<samp><span class="samp">{ }</span></samp>&rsquo;.
1269 <div class="node">
1270 <a name="Exit-status"></a>
1271 <p><hr>
1272 Next:&nbsp;<a rel="next" accesskey="n" href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>,
1273 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Messages">Messages</a>,
1274 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1276 </div>
1278 <h2 class="chapter">9 Exit status</h2>
1280 <p><a name="index-exit-codes-23"></a>
1281 All the conditions of exit codes are described in this chapter.
1283 <dl>
1284 <dt>&lsquo;<samp><span class="samp">0</span></samp>&rsquo;<dd>Successful completion (no errors).
1286 <br><dt>&lsquo;<samp><span class="samp">1</span></samp>&rsquo;<dd><strong>Minor common errors:</strong>
1288 <ul>
1289 <li>Illegal option.
1291 <li>Option requires an argument.
1293 <li>Internal function to load not found.
1295 <li>Program (prerequisite) is not available.
1296 </ul>
1298 <br><dt>&lsquo;<samp><span class="samp">2</span></samp>&rsquo;<dd><strong>Command execution error</strong>
1300 <p>Evaluation of external commands or shell arguments. If it fails,
1301 returns 2.
1303 <br><dt>&lsquo;<samp><span class="samp">3</span></samp>&rsquo;<dd><strong>Integrity check error for compressed files</strong>
1305 <p>Compressed files means:
1307 <ul>
1308 <li>All the tarballs supported by <em>tar(1)</em>.
1310 <li>Zip files supported by <em>unzip(1)</em>.
1312 <li>Gzip files supported by <em>gzip(1)</em>.
1314 <li>Bzip2 files supported by <em>bzip2(1)</em>.
1316 <li>Lzip files supported by <em>lzip(1)</em>.
1317 </ul>
1319 <br><dt>&lsquo;<samp><span class="samp">4</span></samp>&rsquo;<dd><strong>File empty, not regular, or expected</strong>
1321 <p>Commonly, it is expected:
1323 <ul>
1324 <li>A binary package (.tlz).
1326 <li>An installed package to remove.
1328 <li>A recipe file.
1330 <li>A file of order (.order).
1331 </ul>
1333 <br><dt>&lsquo;<samp><span class="samp">5</span></samp>&rsquo;<dd><strong>Empty or not defined variable</strong>
1335 <p>This exit code is used for reporting about empty or undefined variables.
1336 Usually, variables of the recipe or assigned arrays that are tested.
1338 <br><dt>&lsquo;<samp><span class="samp">6</span></samp>&rsquo;<dd><strong>Package already installed</strong>
1340 <p>The package directory for an incoming package already exists.
1342 <br><dt>&lsquo;<samp><span class="samp">10</span></samp>&rsquo;<dd><strong>Network manager error</strong>
1344 <p>Exit status from the execution of the network manager tool and its
1345 arguments.
1346 </dl>
1348 <p class="noindent"><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
1349 Error messages are reported to the standard error.
1350 </td></tr></table>
1352 <div class="node">
1353 <a name="GNU-Free-Documentation-License"></a>
1354 <p><hr>
1355 Next:&nbsp;<a rel="next" accesskey="n" href="#Index">Index</a>,
1356 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Exit-status">Exit status</a>,
1357 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1359 </div>
1361 <h2 class="appendix">Appendix A GNU Free Documentation License</h2>
1363 <!-- The GNU Free Documentation License. -->
1364 <div align="center">Version 1.3, 3 November 2008</div>
1366 <!-- This file is intended to be included within another document, -->
1367 <!-- hence no sectioning command or @node. -->
1368 <pre class="display"> Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
1369 <a href="http://fsf.org/">http://fsf.org/</a>
1371 Everyone is permitted to copy and distribute verbatim copies
1372 of this license document, but changing it is not allowed.
1373 </pre>
1374 <ol type=1 start=0>
1375 <li>PREAMBLE
1377 <p>The purpose of this License is to make a manual, textbook, or other
1378 functional and useful document <dfn>free</dfn> in the sense of freedom: to
1379 assure everyone the effective freedom to copy and redistribute it,
1380 with or without modifying it, either commercially or noncommercially.
1381 Secondarily, this License preserves for the author and publisher a way
1382 to get credit for their work, while not being considered responsible
1383 for modifications made by others.
1385 <p>This License is a kind of &ldquo;copyleft&rdquo;, which means that derivative
1386 works of the document must themselves be free in the same sense. It
1387 complements the GNU General Public License, which is a copyleft
1388 license designed for free software.
1390 <p>We have designed this License in order to use it for manuals for free
1391 software, because free software needs free documentation: a free
1392 program should come with manuals providing the same freedoms that the
1393 software does. But this License is not limited to software manuals;
1394 it can be used for any textual work, regardless of subject matter or
1395 whether it is published as a printed book. We recommend this License
1396 principally for works whose purpose is instruction or reference.
1398 <li>APPLICABILITY AND DEFINITIONS
1400 <p>This License applies to any manual or other work, in any medium, that
1401 contains a notice placed by the copyright holder saying it can be
1402 distributed under the terms of this License. Such a notice grants a
1403 world-wide, royalty-free license, unlimited in duration, to use that
1404 work under the conditions stated herein. The &ldquo;Document&rdquo;, below,
1405 refers to any such manual or work. Any member of the public is a
1406 licensee, and is addressed as &ldquo;you&rdquo;. You accept the license if you
1407 copy, modify or distribute the work in a way requiring permission
1408 under copyright law.
1410 <p>A &ldquo;Modified Version&rdquo; of the Document means any work containing the
1411 Document or a portion of it, either copied verbatim, or with
1412 modifications and/or translated into another language.
1414 <p>A &ldquo;Secondary Section&rdquo; is a named appendix or a front-matter section
1415 of the Document that deals exclusively with the relationship of the
1416 publishers or authors of the Document to the Document's overall
1417 subject (or to related matters) and contains nothing that could fall
1418 directly within that overall subject. (Thus, if the Document is in
1419 part a textbook of mathematics, a Secondary Section may not explain
1420 any mathematics.) The relationship could be a matter of historical
1421 connection with the subject or with related matters, or of legal,
1422 commercial, philosophical, ethical or political position regarding
1423 them.
1425 <p>The &ldquo;Invariant Sections&rdquo; are certain Secondary Sections whose titles
1426 are designated, as being those of Invariant Sections, in the notice
1427 that says that the Document is released under this License. If a
1428 section does not fit the above definition of Secondary then it is not
1429 allowed to be designated as Invariant. The Document may contain zero
1430 Invariant Sections. If the Document does not identify any Invariant
1431 Sections then there are none.
1433 <p>The &ldquo;Cover Texts&rdquo; are certain short passages of text that are listed,
1434 as Front-Cover Texts or Back-Cover Texts, in the notice that says that
1435 the Document is released under this License. A Front-Cover Text may
1436 be at most 5 words, and a Back-Cover Text may be at most 25 words.
1438 <p>A &ldquo;Transparent&rdquo; copy of the Document means a machine-readable copy,
1439 represented in a format whose specification is available to the
1440 general public, that is suitable for revising the document
1441 straightforwardly with generic text editors or (for images composed of
1442 pixels) generic paint programs or (for drawings) some widely available
1443 drawing editor, and that is suitable for input to text formatters or
1444 for automatic translation to a variety of formats suitable for input
1445 to text formatters. A copy made in an otherwise Transparent file
1446 format whose markup, or absence of markup, has been arranged to thwart
1447 or discourage subsequent modification by readers is not Transparent.
1448 An image format is not Transparent if used for any substantial amount
1449 of text. A copy that is not &ldquo;Transparent&rdquo; is called &ldquo;Opaque&rdquo;.
1451 <p>Examples of suitable formats for Transparent copies include plain
1452 ASCII without markup, Texinfo input format, LaTeX input
1453 format, SGML or XML using a publicly available
1454 DTD, and standard-conforming simple HTML,
1455 PostScript or PDF designed for human modification. Examples
1456 of transparent image formats include PNG, XCF and
1457 JPG. Opaque formats include proprietary formats that can be
1458 read and edited only by proprietary word processors, SGML or
1459 XML for which the DTD and/or processing tools are
1460 not generally available, and the machine-generated HTML,
1461 PostScript or PDF produced by some word processors for
1462 output purposes only.
1464 <p>The &ldquo;Title Page&rdquo; means, for a printed book, the title page itself,
1465 plus such following pages as are needed to hold, legibly, the material
1466 this License requires to appear in the title page. For works in
1467 formats which do not have any title page as such, &ldquo;Title Page&rdquo; means
1468 the text near the most prominent appearance of the work's title,
1469 preceding the beginning of the body of the text.
1471 <p>The &ldquo;publisher&rdquo; means any person or entity that distributes copies
1472 of the Document to the public.
1474 <p>A section &ldquo;Entitled XYZ&rdquo; means a named subunit of the Document whose
1475 title either is precisely XYZ or contains XYZ in parentheses following
1476 text that translates XYZ in another language. (Here XYZ stands for a
1477 specific section name mentioned below, such as &ldquo;Acknowledgements&rdquo;,
1478 &ldquo;Dedications&rdquo;, &ldquo;Endorsements&rdquo;, or &ldquo;History&rdquo;.) To &ldquo;Preserve the Title&rdquo;
1479 of such a section when you modify the Document means that it remains a
1480 section &ldquo;Entitled XYZ&rdquo; according to this definition.
1482 <p>The Document may include Warranty Disclaimers next to the notice which
1483 states that this License applies to the Document. These Warranty
1484 Disclaimers are considered to be included by reference in this
1485 License, but only as regards disclaiming warranties: any other
1486 implication that these Warranty Disclaimers may have is void and has
1487 no effect on the meaning of this License.
1489 <li>VERBATIM COPYING
1491 <p>You may copy and distribute the Document in any medium, either
1492 commercially or noncommercially, provided that this License, the
1493 copyright notices, and the license notice saying this License applies
1494 to the Document are reproduced in all copies, and that you add no other
1495 conditions whatsoever to those of this License. You may not use
1496 technical measures to obstruct or control the reading or further
1497 copying of the copies you make or distribute. However, you may accept
1498 compensation in exchange for copies. If you distribute a large enough
1499 number of copies you must also follow the conditions in section 3.
1501 <p>You may also lend copies, under the same conditions stated above, and
1502 you may publicly display copies.
1504 <li>COPYING IN QUANTITY
1506 <p>If you publish printed copies (or copies in media that commonly have
1507 printed covers) of the Document, numbering more than 100, and the
1508 Document's license notice requires Cover Texts, you must enclose the
1509 copies in covers that carry, clearly and legibly, all these Cover
1510 Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
1511 the back cover. Both covers must also clearly and legibly identify
1512 you as the publisher of these copies. The front cover must present
1513 the full title with all words of the title equally prominent and
1514 visible. You may add other material on the covers in addition.
1515 Copying with changes limited to the covers, as long as they preserve
1516 the title of the Document and satisfy these conditions, can be treated
1517 as verbatim copying in other respects.
1519 <p>If the required texts for either cover are too voluminous to fit
1520 legibly, you should put the first ones listed (as many as fit
1521 reasonably) on the actual cover, and continue the rest onto adjacent
1522 pages.
1524 <p>If you publish or distribute Opaque copies of the Document numbering
1525 more than 100, you must either include a machine-readable Transparent
1526 copy along with each Opaque copy, or state in or with each Opaque copy
1527 a computer-network location from which the general network-using
1528 public has access to download using public-standard network protocols
1529 a complete Transparent copy of the Document, free of added material.
1530 If you use the latter option, you must take reasonably prudent steps,
1531 when you begin distribution of Opaque copies in quantity, to ensure
1532 that this Transparent copy will remain thus accessible at the stated
1533 location until at least one year after the last time you distribute an
1534 Opaque copy (directly or through your agents or retailers) of that
1535 edition to the public.
1537 <p>It is requested, but not required, that you contact the authors of the
1538 Document well before redistributing any large number of copies, to give
1539 them a chance to provide you with an updated version of the Document.
1541 <li>MODIFICATIONS
1543 <p>You may copy and distribute a Modified Version of the Document under
1544 the conditions of sections 2 and 3 above, provided that you release
1545 the Modified Version under precisely this License, with the Modified
1546 Version filling the role of the Document, thus licensing distribution
1547 and modification of the Modified Version to whoever possesses a copy
1548 of it. In addition, you must do these things in the Modified Version:
1550 <ol type=A start=1>
1551 <li>Use in the Title Page (and on the covers, if any) a title distinct
1552 from that of the Document, and from those of previous versions
1553 (which should, if there were any, be listed in the History section
1554 of the Document). You may use the same title as a previous version
1555 if the original publisher of that version gives permission.
1557 <li>List on the Title Page, as authors, one or more persons or entities
1558 responsible for authorship of the modifications in the Modified
1559 Version, together with at least five of the principal authors of the
1560 Document (all of its principal authors, if it has fewer than five),
1561 unless they release you from this requirement.
1563 <li>State on the Title page the name of the publisher of the
1564 Modified Version, as the publisher.
1566 <li>Preserve all the copyright notices of the Document.
1568 <li>Add an appropriate copyright notice for your modifications
1569 adjacent to the other copyright notices.
1571 <li>Include, immediately after the copyright notices, a license notice
1572 giving the public permission to use the Modified Version under the
1573 terms of this License, in the form shown in the Addendum below.
1575 <li>Preserve in that license notice the full lists of Invariant Sections
1576 and required Cover Texts given in the Document's license notice.
1578 <li>Include an unaltered copy of this License.
1580 <li>Preserve the section Entitled &ldquo;History&rdquo;, Preserve its Title, and add
1581 to it an item stating at least the title, year, new authors, and
1582 publisher of the Modified Version as given on the Title Page. If
1583 there is no section Entitled &ldquo;History&rdquo; in the Document, create one
1584 stating the title, year, authors, and publisher of the Document as
1585 given on its Title Page, then add an item describing the Modified
1586 Version as stated in the previous sentence.
1588 <li>Preserve the network location, if any, given in the Document for
1589 public access to a Transparent copy of the Document, and likewise
1590 the network locations given in the Document for previous versions
1591 it was based on. These may be placed in the &ldquo;History&rdquo; section.
1592 You may omit a network location for a work that was published at
1593 least four years before the Document itself, or if the original
1594 publisher of the version it refers to gives permission.
1596 <li>For any section Entitled &ldquo;Acknowledgements&rdquo; or &ldquo;Dedications&rdquo;, Preserve
1597 the Title of the section, and preserve in the section all the
1598 substance and tone of each of the contributor acknowledgements and/or
1599 dedications given therein.
1601 <li>Preserve all the Invariant Sections of the Document,
1602 unaltered in their text and in their titles. Section numbers
1603 or the equivalent are not considered part of the section titles.
1605 <li>Delete any section Entitled &ldquo;Endorsements&rdquo;. Such a section
1606 may not be included in the Modified Version.
1608 <li>Do not retitle any existing section to be Entitled &ldquo;Endorsements&rdquo; or
1609 to conflict in title with any Invariant Section.
1611 <li>Preserve any Warranty Disclaimers.
1612 </ol>
1614 <p>If the Modified Version includes new front-matter sections or
1615 appendices that qualify as Secondary Sections and contain no material
1616 copied from the Document, you may at your option designate some or all
1617 of these sections as invariant. To do this, add their titles to the
1618 list of Invariant Sections in the Modified Version's license notice.
1619 These titles must be distinct from any other section titles.
1621 <p>You may add a section Entitled &ldquo;Endorsements&rdquo;, provided it contains
1622 nothing but endorsements of your Modified Version by various
1623 parties&mdash;for example, statements of peer review or that the text has
1624 been approved by an organization as the authoritative definition of a
1625 standard.
1627 <p>You may add a passage of up to five words as a Front-Cover Text, and a
1628 passage of up to 25 words as a Back-Cover Text, to the end of the list
1629 of Cover Texts in the Modified Version. Only one passage of
1630 Front-Cover Text and one of Back-Cover Text may be added by (or
1631 through arrangements made by) any one entity. If the Document already
1632 includes a cover text for the same cover, previously added by you or
1633 by arrangement made by the same entity you are acting on behalf of,
1634 you may not add another; but you may replace the old one, on explicit
1635 permission from the previous publisher that added the old one.
1637 <p>The author(s) and publisher(s) of the Document do not by this License
1638 give permission to use their names for publicity for or to assert or
1639 imply endorsement of any Modified Version.
1641 <li>COMBINING DOCUMENTS
1643 <p>You may combine the Document with other documents released under this
1644 License, under the terms defined in section 4 above for modified
1645 versions, provided that you include in the combination all of the
1646 Invariant Sections of all of the original documents, unmodified, and
1647 list them all as Invariant Sections of your combined work in its
1648 license notice, and that you preserve all their Warranty Disclaimers.
1650 <p>The combined work need only contain one copy of this License, and
1651 multiple identical Invariant Sections may be replaced with a single
1652 copy. If there are multiple Invariant Sections with the same name but
1653 different contents, make the title of each such section unique by
1654 adding at the end of it, in parentheses, the name of the original
1655 author or publisher of that section if known, or else a unique number.
1656 Make the same adjustment to the section titles in the list of
1657 Invariant Sections in the license notice of the combined work.
1659 <p>In the combination, you must combine any sections Entitled &ldquo;History&rdquo;
1660 in the various original documents, forming one section Entitled
1661 &ldquo;History&rdquo;; likewise combine any sections Entitled &ldquo;Acknowledgements&rdquo;,
1662 and any sections Entitled &ldquo;Dedications&rdquo;. You must delete all
1663 sections Entitled &ldquo;Endorsements.&rdquo;
1665 <li>COLLECTIONS OF DOCUMENTS
1667 <p>You may make a collection consisting of the Document and other documents
1668 released under this License, and replace the individual copies of this
1669 License in the various documents with a single copy that is included in
1670 the collection, provided that you follow the rules of this License for
1671 verbatim copying of each of the documents in all other respects.
1673 <p>You may extract a single document from such a collection, and distribute
1674 it individually under this License, provided you insert a copy of this
1675 License into the extracted document, and follow this License in all
1676 other respects regarding verbatim copying of that document.
1678 <li>AGGREGATION WITH INDEPENDENT WORKS
1680 <p>A compilation of the Document or its derivatives with other separate
1681 and independent documents or works, in or on a volume of a storage or
1682 distribution medium, is called an &ldquo;aggregate&rdquo; if the copyright
1683 resulting from the compilation is not used to limit the legal rights
1684 of the compilation's users beyond what the individual works permit.
1685 When the Document is included in an aggregate, this License does not
1686 apply to the other works in the aggregate which are not themselves
1687 derivative works of the Document.
1689 <p>If the Cover Text requirement of section 3 is applicable to these
1690 copies of the Document, then if the Document is less than one half of
1691 the entire aggregate, the Document's Cover Texts may be placed on
1692 covers that bracket the Document within the aggregate, or the
1693 electronic equivalent of covers if the Document is in electronic form.
1694 Otherwise they must appear on printed covers that bracket the whole
1695 aggregate.
1697 <li>TRANSLATION
1699 <p>Translation is considered a kind of modification, so you may
1700 distribute translations of the Document under the terms of section 4.
1701 Replacing Invariant Sections with translations requires special
1702 permission from their copyright holders, but you may include
1703 translations of some or all Invariant Sections in addition to the
1704 original versions of these Invariant Sections. You may include a
1705 translation of this License, and all the license notices in the
1706 Document, and any Warranty Disclaimers, provided that you also include
1707 the original English version of this License and the original versions
1708 of those notices and disclaimers. In case of a disagreement between
1709 the translation and the original version of this License or a notice
1710 or disclaimer, the original version will prevail.
1712 <p>If a section in the Document is Entitled &ldquo;Acknowledgements&rdquo;,
1713 &ldquo;Dedications&rdquo;, or &ldquo;History&rdquo;, the requirement (section 4) to Preserve
1714 its Title (section 1) will typically require changing the actual
1715 title.
1717 <li>TERMINATION
1719 <p>You may not copy, modify, sublicense, or distribute the Document
1720 except as expressly provided under this License. Any attempt
1721 otherwise to copy, modify, sublicense, or distribute it is void, and
1722 will automatically terminate your rights under this License.
1724 <p>However, if you cease all violation of this License, then your license
1725 from a particular copyright holder is reinstated (a) provisionally,
1726 unless and until the copyright holder explicitly and finally
1727 terminates your license, and (b) permanently, if the copyright holder
1728 fails to notify you of the violation by some reasonable means prior to
1729 60 days after the cessation.
1731 <p>Moreover, your license from a particular copyright holder is
1732 reinstated permanently if the copyright holder notifies you of the
1733 violation by some reasonable means, this is the first time you have
1734 received notice of violation of this License (for any work) from that
1735 copyright holder, and you cure the violation prior to 30 days after
1736 your receipt of the notice.
1738 <p>Termination of your rights under this section does not terminate the
1739 licenses of parties who have received copies or rights from you under
1740 this License. If your rights have been terminated and not permanently
1741 reinstated, receipt of a copy of some or all of the same material does
1742 not give you any rights to use it.
1744 <li>FUTURE REVISIONS OF THIS LICENSE
1746 <p>The Free Software Foundation may publish new, revised versions
1747 of the GNU Free Documentation License from time to time. Such new
1748 versions will be similar in spirit to the present version, but may
1749 differ in detail to address new problems or concerns. See
1750 <a href="http://www.gnu.org/copyleft/">http://www.gnu.org/copyleft/</a>.
1752 <p>Each version of the License is given a distinguishing version number.
1753 If the Document specifies that a particular numbered version of this
1754 License &ldquo;or any later version&rdquo; applies to it, you have the option of
1755 following the terms and conditions either of that specified version or
1756 of any later version that has been published (not as a draft) by the
1757 Free Software Foundation. If the Document does not specify a version
1758 number of this License, you may choose any version ever published (not
1759 as a draft) by the Free Software Foundation. If the Document
1760 specifies that a proxy can decide which future versions of this
1761 License can be used, that proxy's public statement of acceptance of a
1762 version permanently authorizes you to choose that version for the
1763 Document.
1765 <li>RELICENSING
1767 <p>&ldquo;Massive Multiauthor Collaboration Site&rdquo; (or &ldquo;MMC Site&rdquo;) means any
1768 World Wide Web server that publishes copyrightable works and also
1769 provides prominent facilities for anybody to edit those works. A
1770 public wiki that anybody can edit is an example of such a server. A
1771 &ldquo;Massive Multiauthor Collaboration&rdquo; (or &ldquo;MMC&rdquo;) contained in the
1772 site means any set of copyrightable works thus published on the MMC
1773 site.
1775 <p>&ldquo;CC-BY-SA&rdquo; means the Creative Commons Attribution-Share Alike 3.0
1776 license published by Creative Commons Corporation, a not-for-profit
1777 corporation with a principal place of business in San Francisco,
1778 California, as well as future copyleft versions of that license
1779 published by that same organization.
1781 <p>&ldquo;Incorporate&rdquo; means to publish or republish a Document, in whole or
1782 in part, as part of another Document.
1784 <p>An MMC is &ldquo;eligible for relicensing&rdquo; if it is licensed under this
1785 License, and if all works that were first published under this License
1786 somewhere other than this MMC, and subsequently incorporated in whole
1787 or in part into the MMC, (1) had no cover texts or invariant sections,
1788 and (2) were thus incorporated prior to November 1, 2008.
1790 <p>The operator of an MMC Site may republish an MMC contained in the site
1791 under CC-BY-SA on the same site at any time before August 1, 2009,
1792 provided the MMC is eligible for relicensing.
1794 </ol>
1796 <h3 class="heading">ADDENDUM: How to use this License for your documents</h3>
1798 <p>To use this License in a document you have written, include a copy of
1799 the License in the document and put the following copyright and
1800 license notices just after the title page:
1802 <pre class="smallexample"> Copyright (C) <var>year</var> <var>your name</var>.
1803 Permission is granted to copy, distribute and/or modify this document
1804 under the terms of the GNU Free Documentation License, Version 1.3
1805 or any later version published by the Free Software Foundation;
1806 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
1807 Texts. A copy of the license is included in the section entitled ``GNU
1808 Free Documentation License''.
1809 </pre>
1810 <p>If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
1811 replace the &ldquo;with<small class="dots">...</small>Texts.&rdquo; line with this:
1813 <pre class="smallexample"> with the Invariant Sections being <var>list their titles</var>, with
1814 the Front-Cover Texts being <var>list</var>, and with the Back-Cover Texts
1815 being <var>list</var>.
1816 </pre>
1817 <p>If you have Invariant Sections without Cover Texts, or some other
1818 combination of the three, merge those two alternatives to suit the
1819 situation.
1821 <p>If your document contains nontrivial examples of program code, we
1822 recommend releasing these examples in parallel under your choice of
1823 free software license, such as the GNU General Public License,
1824 to permit their use in free software.
1826 <!-- Local Variables: -->
1827 <!-- ispell-local-pdict: "ispell-dict" -->
1828 <!-- End: -->
1829 <div class="node">
1830 <a name="Index"></a>
1831 <p><hr>
1832 Previous:&nbsp;<a rel="previous" accesskey="p" href="#GNU-Free-Documentation-License">GNU Free Documentation License</a>,
1833 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1835 </div>
1837 <h2 class="unnumbered">Index</h2>
1839 <ul class="index-cp" compact>
1840 <li><a href="#index-g_t_002eorder-files-19">.order files</a>: <a href="#Order-files">Order files</a></li>
1841 <li><a href="#index-adding-packages-7">adding packages</a>: <a href="#Packages">Packages</a></li>
1842 <li><a href="#index-building-packages-16">building packages</a>: <a href="#Recipes">Recipes</a></li>
1843 <li><a href="#index-environment-3">environment</a>: <a href="#Invocation">Invocation</a></li>
1844 <li><a href="#index-examine-packages-21">examine packages</a>: <a href="#Examine-packages">Examine packages</a></li>
1845 <li><a href="#index-exit-codes-23">exit codes</a>: <a href="#Exit-status">Exit status</a></li>
1846 <li><a href="#index-internal-functions-18">internal functions</a>: <a href="#Recipes">Recipes</a></li>
1847 <li><a href="#index-introduction-1">introduction</a>: <a href="#Introduction">Introduction</a></li>
1848 <li><a href="#index-invocation-2">invocation</a>: <a href="#Invocation">Invocation</a></li>
1849 <li><a href="#index-notes-10">notes</a>: <a href="#Packages">Packages</a></li>
1850 <li><a href="#index-notes-4">notes</a>: <a href="#Invocation">Invocation</a></li>
1851 <li><a href="#index-output-messages-22">output messages</a>: <a href="#Messages">Messages</a></li>
1852 <li><a href="#index-packages-6">packages</a>: <a href="#Packages">Packages</a></li>
1853 <li><a href="#index-recipes-11">recipes</a>: <a href="#Recipes">Recipes</a></li>
1854 <li><a href="#index-removing-packages-8">removing packages</a>: <a href="#Packages">Packages</a></li>
1855 <li><a href="#index-special-variables-13">special variables</a>: <a href="#Recipes">Recipes</a></li>
1856 <li><a href="#index-the-depends-file-20">the depends file</a>: <a href="#Order-files">Order files</a></li>
1857 <li><a href="#index-the-meta-file-15">the meta file</a>: <a href="#Recipes">Recipes</a></li>
1858 <li><a href="#index-the-qirc-file-5">the qirc file</a>: <a href="#The-qirc-file">The qirc file</a></li>
1859 <li><a href="#index-upgrading-packages-9">upgrading packages</a>: <a href="#Packages">Packages</a></li>
1860 <li><a href="#index-variables-12">variables</a>: <a href="#Recipes">Recipes</a></li>
1861 <li><a href="#index-variables-from-the-environment-14">variables from the environment</a>: <a href="#Recipes">Recipes</a></li>
1862 <li><a href="#index-writing-recipes-17">writing recipes</a>: <a href="#Recipes">Recipes</a></li>
1863 </ul><div class="footnote">
1864 <hr>
1865 <a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> The official guide
1866 for Graft can be found at
1867 <a href="http://peters.gormand.com.au/Home/tools/graft/graft.html">http://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>
1869 <p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small>
1870 The proposal for &lsquo;<samp><span class="samp">license</span></samp>&rsquo; was made by Richard M. Stallman at
1871 <a href="http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html">http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html</a>.</p>
1873 <hr></div>
1875 </body></html>
1877 <!--
1878 \x1f
1879 Local Variables:
1880 coding: iso-8859-1
1881 End: