qi: Bump to version 1.5 (Release Candidate 1)
[dragora.git] / qi / doc / qi.html
blob770b6e6344a85aa02db9ba729eebae9332f0369c
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- This user guide is for Qi (version 1.5rc1,
4 24 Apr 2020), which is a simple but well-integrated package manager.
6 Copyright (C) 2019-2020 Matias Andres Fonzo, Santiago del Estero,
7 Argentina.
9 Permission is granted to copy, distribute and/or modify this document
10 under the terms of the GNU Free Documentation License, Version 1.3 or
11 any later version published by the Free Software Foundation; with no
12 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
13 Texts. A copy of the license is included in the section entitled
14 "GNU Free Documentation License". -->
15 <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
16 <head>
17 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
18 <title>Qi user guide</title>
20 <meta name="description" content="Qi user guide">
21 <meta name="keywords" content="Qi user guide">
22 <meta name="resource-type" content="document">
23 <meta name="distribution" content="global">
24 <meta name="Generator" content="makeinfo">
25 <link href="#Top" rel="start" title="Top">
26 <link href="#Index" rel="index" title="Index">
27 <link href="#SEC_Contents" rel="contents" title="Table of Contents">
28 <link href="dir.html#Top" rel="up" title="(dir)">
29 <style type="text/css">
30 <!--
31 a.summary-letter {text-decoration: none}
32 blockquote.indentedblock {margin-right: 0em}
33 blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
34 blockquote.smallquotation {font-size: smaller}
35 div.display {margin-left: 3.2em}
36 div.example {margin-left: 3.2em}
37 div.lisp {margin-left: 3.2em}
38 div.smalldisplay {margin-left: 3.2em}
39 div.smallexample {margin-left: 3.2em}
40 div.smalllisp {margin-left: 3.2em}
41 kbd {font-style: oblique}
42 pre.display {font-family: inherit}
43 pre.format {font-family: inherit}
44 pre.menu-comment {font-family: serif}
45 pre.menu-preformatted {font-family: serif}
46 pre.smalldisplay {font-family: inherit; font-size: smaller}
47 pre.smallexample {font-size: smaller}
48 pre.smallformat {font-family: inherit; font-size: smaller}
49 pre.smalllisp {font-size: smaller}
50 span.nolinebreak {white-space: nowrap}
51 span.roman {font-family: initial; font-weight: normal}
52 span.sansserif {font-family: sans-serif; font-weight: normal}
53 ul.no-bullet {list-style: none}
54 -->
55 </style>
58 </head>
60 <body lang="en">
61 <h1 class="settitle" align="center">Qi user guide</h1>
67 <a name="SEC_Contents"></a>
68 <h2 class="contents-heading">Table of Contents</h2>
70 <div class="contents">
72 <ul class="no-bullet">
73 <li><a name="toc-Introduction-1" href="#Introduction">1 Introduction</a></li>
74 <li><a name="toc-Invoking-qi-1" href="#Invoking-qi">2 Invoking qi</a></li>
75 <li><a name="toc-The-qirc-file-1" href="#The-qirc-file">3 The qirc file</a></li>
76 <li><a name="toc-Packages-1" href="#Packages">4 Packages</a>
77 <ul class="no-bullet">
78 <li><a name="toc-Package-conflicts" href="#Package-conflicts">4.1 Package conflicts</a></li>
79 <li><a name="toc-Installing-packages" href="#Installing-packages">4.2 Installing packages</a></li>
80 <li><a name="toc-Removing-packages" href="#Removing-packages">4.3 Removing packages</a></li>
81 <li><a name="toc-Upgrading-packages" href="#Upgrading-packages">4.4 Upgrading packages</a>
82 <ul class="no-bullet">
83 <li><a name="toc-Package-blacklist" href="#Package-blacklist">4.4.1 Package blacklist</a></li>
84 </ul></li>
85 </ul></li>
86 <li><a name="toc-Recipes-1" href="#Recipes">5 Recipes</a>
87 <ul class="no-bullet">
88 <li><a name="toc-Variables" href="#Variables">5.1 Variables</a></li>
89 <li><a name="toc-Special-variables" href="#Special-variables">5.2 Special variables</a></li>
90 <li><a name="toc-Writing-recipes" href="#Writing-recipes">5.3 Writing recipes</a></li>
91 <li><a name="toc-Building-packages" href="#Building-packages">5.4 Building packages</a></li>
92 <li><a name="toc-Variables-from-the-environment" href="#Variables-from-the-environment">5.5 Variables from the environment</a></li>
93 <li><a name="toc-The-meta-file" href="#The-meta-file">5.6 The meta file</a></li>
94 </ul></li>
95 <li><a name="toc-Order-files-1" href="#Order-files">6 Order files</a></li>
96 <li><a name="toc-Creating-packages-1" href="#Creating-packages">7 Creating packages</a></li>
97 <li><a name="toc-Examining-packages-1" href="#Examining-packages">8 Examining packages</a></li>
98 <li><a name="toc-Exit-status-1" href="#Exit-status">9 Exit status</a></li>
99 <li><a name="toc-Index-1" href="#Index">Index</a></li>
100 </ul>
101 </div>
104 <a name="Top"></a>
105 <div class="header">
107 Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
108 </div>
109 <a name="SEC_Top"></a>
111 <p>This user guide is for Qi (version 1.5rc1,
112 24 Apr 2020).
113 </p>
114 <table class="menu" border="0" cellspacing="0">
115 <tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Description and features of qi
116 </td></tr>
117 <tr><td align="left" valign="top">&bull; <a href="#Invoking-qi" accesskey="2">Invoking qi</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Command-line options
118 </td></tr>
119 <tr><td align="left" valign="top">&bull; <a href="#The-qirc-file" accesskey="3">The qirc file</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Configuration file
120 </td></tr>
121 <tr><td align="left" valign="top">&bull; <a href="#Packages" accesskey="4">Packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Managing packages
122 </td></tr>
123 <tr><td align="left" valign="top">&bull; <a href="#Recipes" accesskey="5">Recipes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Building packages
124 </td></tr>
125 <tr><td align="left" valign="top">&bull; <a href="#Order-files" accesskey="6">Order files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Handling build order
126 </td></tr>
127 <tr><td align="left" valign="top">&bull; <a href="#Creating-packages" accesskey="7">Creating packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Making Qi packages
128 </td></tr>
129 <tr><td align="left" valign="top">&bull; <a href="#Examining-packages" accesskey="8">Examining packages</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Debugging purposes
130 </td></tr>
131 <tr><td align="left" valign="top">&bull; <a href="#Exit-status" accesskey="9">Exit status</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Exit codes
132 </td></tr>
133 <tr><td align="left" valign="top">&bull; <a href="#Index">Index</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
134 </td></tr>
135 </table>
137 <br>
138 <p>Copyright (C) 2019-2020 Matias Fonzo.
139 </p>
140 <p>Qi&rsquo;s home page can be found at <a href="https://www.dragora.org">https://www.dragora.org</a>.
141 Send&nbsp;bug&nbsp;reports&nbsp;or&nbsp;suggestions&nbsp;to&nbsp;<a href="mailto:dragora-users@nongnu.org"><span class="nolinebreak">dragora-users</span>@nongnu.org</a>.<!-- /@w -->
142 </p>
143 <hr>
144 <a name="Introduction"></a>
145 <div class="header">
147 Next: <a href="#Invoking-qi" accesskey="n" rel="next">Invoking qi</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
148 </div>
149 <a name="Introduction-1"></a>
150 <h2 class="chapter">1 Introduction</h2>
151 <a name="index-introduction"></a>
153 <p>Qi is a simple but well-integrated package manager. It can create,
154 install, remove, and upgrade software packages. Qi produces binary
155 packages using recipes, which are files containing specific instructions
156 to build each package from source. Qi can manage multiple packages
157 under a single directory hierarchy. This method allows to maintain a set
158 of packages and multiple versions of them. This means that Qi could be
159 used as the main package manager or complement the existing one.
160 </p>
161 <p>Qi offers a friendly command line interface, a global configuration
162 file, a simple recipe layout to deploy software packages; also works
163 with binary packages in parallel, speeding up installations and packages
164 in production. The format used for packages is a simplified but safe
165 POSIX pax archive compressed with lzip.
166 </p>
167 <p>Qi is a modern (POSIX-compliant) shell script released under the
168 terms of the GNU General Public License. There are only two major
169 dependencies for the magic: graft(1) and tarlz(1), the rest is expected
170 to be found in any Unix-like system.
171 </p>
172 <hr>
173 <a name="Invoking-qi"></a>
174 <div class="header">
176 Next: <a href="#The-qirc-file" accesskey="n" rel="next">The qirc file</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
177 </div>
178 <a name="Invoking-qi-1"></a>
179 <h2 class="chapter">2 Invoking qi</h2>
180 <a name="index-invocation"></a>
182 <p>This chapter describes the synopsis and command line options for
183 invoke Qi.
184 </p>
185 <div class="example">
186 <pre class="example">Usage: qi [<var>OPTION</var>]... [<var>FILE</var>]...
187 </pre></div>
189 <p>One mandatory option specifies the operation that &lsquo;<samp>qi</samp>&rsquo; should
190 perform, other options are meant to detail how this operation should be
191 performed.
192 </p>
193 <p>qi supports the following options to operate:
194 </p>
195 <dl compact="compact">
196 <dt><code>-b</code></dt>
197 <dd><p>Build package using recipe names.
198 </p>
199 </dd>
200 <dt><code>-c</code></dt>
201 <dd><p>Create .tlz package from directory.
202 </p>
203 </dd>
204 <dt><code>-d</code></dt>
205 <dd><p>Delete packages.
206 </p>
207 </dd>
208 <dt><code>-i</code></dt>
209 <dd><p>Install packages.
210 </p>
211 </dd>
212 <dt><code>-o</code></dt>
213 <dd><p>Resolve build order through .order files.
214 </p>
215 </dd>
216 <dt><code>-u</code></dt>
217 <dd><p>Upgrade packages (implies -i, -d and -p options).
218 </p>
219 </dd>
220 <dt><code>-w</code></dt>
221 <dd><p>Warn about files that will be linked.
222 </p>
223 </dd>
224 <dt><code>-x</code></dt>
225 <dd><p>Extract a package for debugging purposes.
226 </p></dd>
227 </dl>
229 <p>There are common options between modes:
230 </p>
231 <dl compact="compact">
232 <dt><code>-N</code></dt>
233 <dd><p>Do not read the configuration file.
234 </p>
235 <p>This will ignore any value in the qirc file.
236 </p>
237 </dd>
238 <dt><code>-P &lt;DIR&gt;</code></dt>
239 <dd><p>Package directory for installations.
240 </p>
241 <p>This option sets &lsquo;<samp>${packagedir}</samp>&rsquo;.
242 </p>
243 <p>Only valid for -i, -d, or -u options.
244 </p>
245 </dd>
246 <dt><code>-f</code></dt>
247 <dd><p>Force option.
248 </p>
249 <p>This option can force the build of a recipe, or force the upgrade of a
250 pre-existing package.
251 </p>
252 <p>Only valid for -b, -u options.
253 </p>
254 </dd>
255 <dt><code>-t &lt;DIR&gt;</code></dt>
256 <dd><p>Target directory for symbolic links.
257 </p>
258 <p>This option sets &lsquo;<samp>${targetdir}</samp>&rsquo;.
259 </p>
260 <p>Only valid for -i, -d, or -u options.
261 </p>
262 </dd>
263 <dt><code>-k</code></dt>
264 <dd><p>Keep (don&rsquo;t delete) &lsquo;<samp>${srcdir}</samp>&rsquo; or &lsquo;<samp>${destdir}</samp>&rsquo; in build
265 mode, keep (don&rsquo;t delete) package directory in delete mode.
266 </p>
267 <p>Only valid for -b, -d or -u options.
268 </p>
269 </dd>
270 <dt><code>-p</code></dt>
271 <dd><p>Prune conflicts on package installations.
272 </p>
273 <p>This option may proceed with the package installation if one or more
274 conflicts occur.
275 </p>
276 </dd>
277 <dt><code>-r /rootdir</code></dt>
278 <dd><p>Use the fully qualified named directory as the root directory for all qi
279 operations. The target directory and package directory will be relative
280 to the specified directory, including the log file for graft.
281 </p>
282 </dd>
283 <dt><code>-v</code></dt>
284 <dd><p>Be verbose (a 2nd -v gives more).
285 </p></dd>
286 </dl>
288 <p>Options for build mode (-b):
289 </p>
290 <dl compact="compact">
291 <dt><code>-O &lt;DIR&gt;</code></dt>
292 <dd><p>Where the packages produced are written.
293 </p>
294 <p>This option sets &lsquo;<samp>${outdir}</samp>&rsquo;.
295 </p>
296 </dd>
297 <dt><code>-W &lt;DIR&gt;</code></dt>
298 <dd><p>Where archives, patches, and recipes are expected.
299 </p>
300 <p>This option sets &lsquo;<samp>${worktree}</samp>&rsquo;.
301 </p>
302 </dd>
303 <dt><code>-Z &lt;DIR&gt;</code></dt>
304 <dd><p>Where (compressed) sources will be found.
305 </p>
306 <p>This option sets &lsquo;<samp>${tardir}</samp>&rsquo;.
307 </p>
308 </dd>
309 <dt><code>-a</code></dt>
310 <dd><p>Architecture to use.
311 </p>
312 <p>Default value is obtained via uname(1) as &lsquo;<samp>uname -m</samp>&rsquo;.
313 </p>
314 </dd>
315 <dt><code>-j</code></dt>
316 <dd><p>Parallel jobs for the compiler.
317 </p>
318 <p>If not specified, default sets to 1.
319 </p>
320 </dd>
321 <dt><code>-1</code></dt>
322 <dd><p>Increment release number (&lsquo;<samp>${release}</samp>&rsquo; + 1).
323 </p>
324 <p>It will be omitted if the -n option is being used.
325 </p>
326 </dd>
327 <dt><code>-n</code></dt>
328 <dd><p>Don&rsquo;t create a .tlz package.
329 </p>
330 </dd>
331 <dt><code>-S</code></dt>
332 <dd><p>Selects the option to skip completed recipes.
333 </p>
334 <p>This means, in interactive mode, when the dialog to
335 summarize recipes is shown.
336 </p></dd>
337 </dl>
339 <p>Informative options:
340 </p>
341 <dl compact="compact">
342 <dt><code>-L</code></dt>
343 <dd><p>Print default directory locations.
344 </p>
345 <p>This will print the target directory, package directory, working tree,
346 the directory for tarballs, and the output directory for the packages
347 produced.
348 </p>
349 </dd>
350 <dt><code>-h</code></dt>
351 <dd><p>Display the help describing the options and then exit.
352 </p>
353 </dd>
354 <dt><code>-V</code></dt>
355 <dd><p>Print the version number and license information.
356 The version number should be included in all bug reports.
357 </p></dd>
358 </dl>
360 <p>Expected non-option arguments are package directories and regular files:
361 recipes or files ending in .tlz, .order.
362 </p>
363 <p>When FILE is -, qi can read from the standard input. See examples at
364 <a href="#Packages">Packages</a>.
365 </p>
367 <hr>
368 <a name="The-qirc-file"></a>
369 <div class="header">
371 Next: <a href="#Packages" accesskey="n" rel="next">Packages</a>, Previous: <a href="#Invoking-qi" accesskey="p" rel="prev">Invoking qi</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
372 </div>
373 <a name="The-qirc-file-1"></a>
374 <h2 class="chapter">3 The qirc file</h2>
375 <a name="index-configuration-file"></a>
377 <p>The global <samp>qirc</samp> file offers a way to define variables and tools
378 (such as a download manager) for default use. This file is used by qi
379 at runtime, e.g., to build, install, remove or upgrade packages.
380 </p>
381 <p>Variables and their possible values must be declared as any other
382 variable in the shell.
383 </p>
384 <p>The command line options related to the package directory and target
385 directory and some of the command line options used for the build mode,
386 have the power to override the values declared on <samp>qirc</samp>.
387 See <a href="#Invoking-qi">Invoking qi</a>.
388 </p>
389 <p>The order in which qi looks for this file is:
390 </p>
391 <ol>
392 <li> <code>${HOME}/.qirc</code>
393 Effective user.
395 </li><li> &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo;
396 System-wide.
397 </li></ol>
399 <p>If you intend to run qi as effective user, the file
400 &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo; could be copied to <code>${HOME}/.qirc</code>
401 setting the paths for &lsquo;<samp>${packagedir}</samp>&rsquo; and &lsquo;<samp>${targetdir}</samp>&rsquo;
402 according to the <code>$HOME</code>.
403 </p>
405 <hr>
406 <a name="Packages"></a>
407 <div class="header">
409 Next: <a href="#Recipes" accesskey="n" rel="next">Recipes</a>, Previous: <a href="#The-qirc-file" accesskey="p" rel="prev">The qirc file</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
410 </div>
411 <a name="Packages-1"></a>
412 <h2 class="chapter">4 Packages</h2>
413 <a name="index-managing-packages"></a>
415 <p>A package is a suite of programs usually distributed in binary form
416 which may also contain manual pages, documentation, or any other file
417 associated to a specific software.
418 </p>
419 <p>The package format used by qi is a simplified POSIX pax archive
420 compressed with lzip<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>. The file extension for packages ends
421 in &lsquo;<samp>.tlz</samp>&rsquo;.
422 </p>
423 <p>Both package installation and package de-installation are managed using
424 two important (internal) variables: &lsquo;<samp>${packagedir}</samp>&rsquo; and
425 &lsquo;<samp>${targetdir}</samp>&rsquo;, these values can be changed in the
426 configuration file or via options.
427 </p>
428 <p>&lsquo;<samp>${packagedir}</samp>&rsquo; is a common directory tree where the package
429 contents will be decompressed (will reside).
430 </p>
431 <p>&lsquo;<samp>${targetdir}</samp>&rsquo; is a target directory where the links will be
432 made by graft(1) taking &lsquo;<samp>${packagedir}/package_name</samp>&rsquo; into account.
433 </p>
434 <p>Packages are installed in self-contained directory trees and symbolic
435 links from a common area are made to the package files. This allows
436 multiple versions of the same package to coexist on the same system.
437 </p>
438 <a name="Package-conflicts"></a>
439 <h3 class="section">4.1 Package conflicts</h3>
440 <a name="index-package-conflicts"></a>
442 <p>All the links to install or remove a package are handled by graft(1).
443 Since multiple packages can be installed or removed at the same time,
444 certain conflicts may arise between the packages.
445 </p>
446 <p>graft<a name="DOCF2" href="#FOOT2"><sup>2</sup></a>
447 defines a CONFLICT as one of the following conditions:
448 </p>
449 <ul>
450 <li> If the package object is a directory and the target object exists but is
451 not a directory.
453 </li><li> If the package object is not a directory and the target object exists
454 and is not a symbolic link.
456 </li><li> If the package object is not a directory and the target object exists
457 and is a symbolic link to something other than the package object.
458 </li></ul>
460 <p>The default behavior of qi for an incoming package is to ABORT if a
461 conflict arises. When a package is going to be deleted, qi tells to
462 graft(1) to remove those parts that are not in conflict, leaving the
463 links to the belonging package. This behavior can be forced if the
464 -p option is given.
465 </p>
466 <a name="Installing-packages"></a>
467 <h3 class="section">4.2 Installing packages</h3>
468 <a name="index-package-installation"></a>
470 <p>To install a single package, simply type:
471 </p>
472 <div class="example">
473 <pre class="example">qi -i coreutils-8.30-i586+1.tlz
474 </pre></div>
476 <p>To install multiple packages at once, type:
477 </p>
478 <div class="example">
479 <pre class="example">qi -i gcc-8.3.0-i586+1.tlz rafaela-2.2-i586+1.tlz ...
480 </pre></div>
482 <p>Warn about the files that will be linked:
483 </p>
484 <div class="example">
485 <pre class="example">qi -w bash-5.0-i586+1.tlz
486 </pre></div>
488 <p>This is to verify the content of a package before installing it.
489 </p>
490 <p>See the process of an installation (very verbose):
491 </p>
492 <div class="example">
493 <pre class="example">qi -i -v mariana-3.0-i586+1.tlz
494 </pre></div>
496 <p>A second -v gives more.
497 </p>
498 <p>Installing package in a different location:
499 </p>
500 <div class="example">
501 <pre class="example">qi -r /media/floppy -i lzip-1.21-i586+1.tlz
502 </pre></div>
504 <p>Important: the -r option assumes &lsquo;<samp>${targetdir}</samp>&rsquo; and
505 &lsquo;<samp>${packagedir}</samp>&rsquo;. See the following example.
506 </p>
507 <div class="example">
508 <pre class="example">qi -r /home/selk -i lzip-1.21-i586+1.tlz
509 </pre></div>
511 <p>In this case the content of &quot;lzip-1.21-i586+1.tlz&quot; will be decompressed
512 into &lsquo;<samp>/home/selk/pkgs/lzip-1.21-i586+1</samp>&rsquo;. Assuming that the main
513 binary for lzip is under &lsquo;<samp>/home/selk/pkgs/lzip-1.21-i586+1/usr/bin/</samp>&rsquo;
514 the target for &quot;usr/bin&quot; will be created at &lsquo;<samp>/home/selk</samp>&rsquo;. Considering
515 that you have exported the <code>PATH</code> as &lsquo;<samp>${HOME}/usr/bin</samp>&rsquo;, now the
516 system is able to see the recent lzip.
517 </p>
518 <p>Installing from a list of packages using standard input:
519 </p>
520 <div class="example">
521 <pre class="example">qi -i - &lt; PACKAGELIST.txt
522 </pre></div>
524 <p>Or in combination with another tool:
525 </p><div class="example">
526 <pre class="example">sort -u PACKAGELIST.txt | qi -i -
527 </pre></div>
529 <p>The list of packages must contain full path names to be passed in the
530 installation, e.g.:
531 </p><div class="example">
532 <pre class="example">/var/cache/qi/packages/tcl-8.6.9-x86_64+1.tlz
533 /var/cache/qi/packages/tk-8.6.9.1-x86_64+1.tlz
534 /var/cache/qi/packages/vala-0.42.3-x86_64+1.tlz
535 </pre></div>
537 <a name="Removing-packages"></a>
538 <h3 class="section">4.3 Removing packages</h3>
539 <a name="index-package-de_002dinstallation"></a>
541 <p>To remove a package, simply type:
542 </p>
543 <div class="example">
544 <pre class="example">qi -d xz-5.2.4-i586+1.tlz
545 </pre></div>
547 <p>Delete mode will match the package name using &lsquo;<samp>${packagedir}</samp>&rsquo; as
548 prefix. For example, if the value of &lsquo;<samp>${packagedir}</samp>&rsquo; is set to
549 /usr/pkg, this will be equal to:
550 </p>
551 <div class="example">
552 <pre class="example">qi -d /usr/pkg/xz-5.2.4-i586+1
553 </pre></div>
555 <p>Detailed output (very verbose):
556 </p>
557 <div class="example">
558 <pre class="example">qi -d -v /usr/pkg/xz-5.2.4-i586+1
559 </pre></div>
561 <p>A second -v gives more.
562 </p>
563 <p>By default the delete mode does not preserve a package directory after
564 removing its links from &lsquo;<samp>${targetdir}</samp>&rsquo;, but this behavior can be
565 changed if the -k option is passed:
566 </p>
567 <div class="example">
568 <pre class="example">qi -d -k /usr/pkg/lzip-1.21-i586+1
569 </pre></div>
571 <p>This means that the links to the package can be reactivated, later:
572 </p>
573 <div class="example">
574 <pre class="example">cd /usr/pkg &amp;&amp; graft -i lzip-1.21-i586+1
575 </pre></div>
577 <p>Removing package from a different location:
578 </p>
579 <div class="example">
580 <pre class="example">qi -r /home/cthulhu -d xz-5.2.4-i586+1
581 </pre></div>
583 <p>Removing a package using standard input:
584 </p>
585 <div class="example">
586 <pre class="example">echo &quot;vala-0.42.3-x86_64+1&quot; | qi -d -
587 </pre></div>
589 <p>This will match with the package directory.
590 </p>
591 <a name="Upgrading-packages"></a>
592 <h3 class="section">4.4 Upgrading packages</h3>
593 <a name="index-package-upgrade"></a>
595 <p>The upgrade mode inherits the properties of the installation and removal
596 process. To make sure that a package is updated, the package is installed
597 in a temporary directory taking &lsquo;<samp>${packagedir}</samp>&rsquo; into account. Once
598 the incoming package is pre-installed, qi can proceed to search and delete
599 packages that have the same name (considered as previous ones). Finally,
600 the package is re-installed at its final location and the temporary
601 directory is removed.
602 </p>
603 <p>To upgrade a package, just type:
604 </p>
605 <div class="example">
606 <pre class="example">qi -u gcc-9.0.1-i586+1.tlz
607 </pre></div>
609 <p>This will proceed to upgrade &quot;gcc-9.0.1-i586+1&quot; removing any other version
610 of &quot;gcc&quot; (if any).
611 </p>
612 <p>If you want to keep the package directories of versions found during the
613 upgrade process, just pass:
614 </p>
615 <div class="example">
616 <pre class="example">qi -u -k gcc-9.0.1-i586+1.tlz
617 </pre></div>
619 <p>To see the upgrade process (very verbose):
620 </p>
621 <div class="example">
622 <pre class="example">qi -u -v gcc-9.0.1-i586+1.tlz
623 </pre></div>
625 <p>A second -v gives more.
626 </p>
627 <p>To force the upgrade of an existing package:
628 </p>
629 <div class="example">
630 <pre class="example">qi -u -f gcc-9.0.1-i586+1.tlz
631 </pre></div>
633 <a name="Package-blacklist"></a>
634 <h4 class="subsection">4.4.1 Package blacklist</h4>
635 <a name="index-package-blacklist"></a>
637 <p>To implement general package facilities, either to install, remove or
638 maintain the hierarchy of packages in a clean manner, qi makes use of the
639 pruning operation via graft(1) by default:
640 </p>
641 <p>There is a risk if those are crucial packages for the proper functioning
642 of the system, because it implies the deactivation of symbolic from the
643 target directory, <em>especially</em> when transitioning an incoming package
644 into its final location during upgrade.
645 </p>
646 <p>A blacklist of package names has been devised for the case where
647 a user decides to upgrade all packages in the system, or
648 just the crucial ones, such as the C library.
649 </p>
650 <p>The blacklist is related to the upgrade mode only, consists in installing
651 a package instead of updating it or removing previous versions of it;
652 the content of the package will be updated over the existing content at
653 &lsquo;<samp>${packagedir}</samp>&rsquo;, while the existing links from
654 &lsquo;<samp>${targetdir}</samp>&rsquo; will be preserved. A pruning of links will be
655 carried out in order to re-link possible differences with the recent
656 content, this helps to avoid leaving dead links in the target directory.
657 </p>
658 <p>The package names for the blacklist to be declared must be set from
659 the configuration file.
660 </p>
662 <hr>
663 <a name="Recipes"></a>
664 <div class="header">
666 Next: <a href="#Order-files" accesskey="n" rel="next">Order files</a>, Previous: <a href="#Packages" accesskey="p" rel="prev">Packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
667 </div>
668 <a name="Recipes-1"></a>
669 <h2 class="chapter">5 Recipes</h2>
670 <a name="index-recipes"></a>
672 <p>A recipe is a file telling qi what to do. Most often, the recipe tells
673 qi how to build a binary package from a source tarball.
674 </p>
675 <p>A recipe has two parts: a list of variable definitions and a list of
676 sections. By convention, the syntax of a section is:
677 </p>
678 <div class="example">
679 <pre class="example">section_name()
681 section lines
683 </pre></div>
685 <p>The section name is followed by parentheses, one newline and an opening
686 brace. The line finishing the section contains just a closing brace.
687 The section names or the function names currently recognized are
688 &lsquo;<samp>build</samp>&rsquo;.
689 </p>
690 <p>The &lsquo;<samp>build</samp>&rsquo; section is an augmented shell script. This is the main
691 section (or <strong>shell function</strong>) which contains the instructions to
692 build and produce a package.
693 </p>
694 <a name="Variables"></a>
695 <h3 class="section">5.1 Variables</h3>
696 <a name="index-variables"></a>
698 <p>A &quot;variable&quot; is a <strong>shell variable</strong> defined either in <samp>qirc</samp>
699 or in a recipe to represent a string of text, called the variable&rsquo;s
700 &quot;value&quot;. These values are substituted by explicit request in the
701 definitions of other variables or in calls to external commands.
702 </p>
703 <p>Variables can represent lists of file names, options to pass to
704 compilers, programs to run, directories to look in for source files,
705 directories to write output to, or anything else you can imagine.
706 </p>
707 <p>Definitions of variables in qi have four levels of precedence.
708 Options which define variables from the command-line override those
709 specified in the <samp>qirc</samp> file, while variables defined in the recipe
710 override those specified in <samp>qirc</samp>, taking priority over those
711 variables set by command-line options. Finally, the variables have
712 default values if they are not defined anywhere.
713 </p>
714 <p>Options that set variables through the command-line can only reference
715 variables defined in <samp>qirc</samp> and variables with default values.
716 </p>
717 <p>Definitions of variables in <samp>qirc</samp> can only reference variables
718 previously defined in <samp>qirc</samp> and variables with default values.
719 </p>
720 <p>Definitions of variables in the recipe can only reference variables
721 set by the command-line, variables previously defined in the recipe,
722 variables defined in <samp>qirc</samp>, and variables with default values.
723 </p>
724 <a name="Special-variables"></a>
725 <h3 class="section">5.2 Special variables</h3>
726 <a name="index-special-variables"></a>
728 <p>There are variables which can only be set using the command line options or
729 via <samp>qirc</samp>, there are other special variables which can be defined or
730 redefined in a recipe. See the following definitions:
731 </p>
732 <p>&lsquo;<samp>outdir</samp>&rsquo; is the directory where the packages produced are written.
733 This variable can be redefined per-recipe. Default sets to
734 &lsquo;<samp>/var/cache/qi/packages</samp>&rsquo;.
735 </p>
736 <p>&lsquo;<samp>worktree</samp>&rsquo; is the working tree where archives, patches, and recipes
737 are expected. This variable can not be redefined in the recipe. Default
738 sets to &lsquo;<samp>/usr/src/qi</samp>&rsquo;.
739 </p>
740 <p>&lsquo;<samp>tardir</samp>&rsquo; is defined in the recipe to the directory where the tarball
741 containing the source can be found. The full name of the tarball is
742 composed as &lsquo;<samp>${tardir}/$tarname</samp>&rsquo;. Its value is available in the
743 recipe as &lsquo;<samp>${tardir}</samp>&rsquo;; a value of . for &lsquo;<samp>tardir</samp>&rsquo; sets it to
744 the value of CWD (Current Working Directory), this is where the recipe
745 lives.
746 </p>
747 <p>&lsquo;<samp>arch</samp>&rsquo; is the architecture to compose the package name. Its value is
748 available in the recipe as &lsquo;<samp>${arch}</samp>&rsquo;. Default value is the output
749 of &lsquo;<samp>uname -m</samp>&rsquo;.
750 </p>
751 <p>&lsquo;<samp>jobs</samp>&rsquo; is the number of parallel jobs to pass to the compiler. Its
752 value is available in the recipe as &lsquo;<samp>${jobs}</samp>&rsquo;. The default value
753 is 1.
754 </p>
755 <p>The two variables &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; can be
756 set in the recipe, as any other variable, but if they are not, qi uses
757 default values for them when building a package.
758 </p>
759 <p>&lsquo;<samp>srcdir</samp>&rsquo; contains the source code to be compiled, and defaults to
760 &lsquo;<samp>${program}-${version}</samp>&rsquo;. &lsquo;<samp>destdir</samp>&rsquo; is the place where the
761 built package will be installed, and defaults to
762 &lsquo;<samp>${TMPDIR}/package-${program}</samp>&rsquo;.
763 </p>
764 <p>If &lsquo;<samp>pkgname</samp>&rsquo; is left undefined, the special variable &lsquo;<samp>program</samp>&rsquo;
765 is assigned by default. If &lsquo;<samp>pkgversion</samp>&rsquo; is left undefined, the
766 special variable &lsquo;<samp>version</samp>&rsquo; is assigned by default.
767 </p>
768 <p>&lsquo;<samp>pkgname</samp>&rsquo; and &lsquo;<samp>pkgversion</samp>&rsquo; along with: &lsquo;<samp>version</samp>&rsquo;, &lsquo;<samp>arch</samp>&rsquo;,
769 &lsquo;<samp>release</samp>&rsquo;, and (optionally) &lsquo;<samp>pkgcategory</samp>&rsquo; are used to produce the
770 package name in the form:
771 &lsquo;<samp>${pkgname}-${pkgversion}-${arch}+${release}[@${pkgcategory}].tlz</samp>&rsquo;
772 </p>
773 <p>&lsquo;<samp>pkgcategory</samp>&rsquo; is an optional special variable that can be defined on the
774 recipe to categorize the package name. If it is defined, then the
775 package output will be composed as
776 &lsquo;<samp>${pkgname}-${pkgversion}-${arch}+${release}@${pkgcategory}.tlz</samp>&rsquo;.
777 Automatically, the value of &lsquo;<samp>pkgcategory</samp>&rsquo; will be prefixed using the
778 &lsquo;<samp>@</samp>&rsquo; character.
779 </p>
780 <p>A special variable called &lsquo;<samp>replace</samp>&rsquo; can be used to declare package names
781 that will be replaced at installation time.
782 </p>
783 <p>A typical recipe contains the following variables:
784 </p>
785 <ul>
786 <li> &lsquo;<samp>program</samp>&rsquo;: Software name.
788 <p>It matches the source name. It is also used to compose the name of the
789 package if &lsquo;<samp>${pkgname}</samp>&rsquo; is not specified.
790 </p>
791 </li><li> &lsquo;<samp>version</samp>&rsquo;: Software version.
793 <p>It matches the source name. It is also used to compose the version of the
794 package if &lsquo;<samp>${pkgversion}</samp>&rsquo; is not specified.
795 </p>
796 </li><li> &lsquo;<samp>arch</samp>&rsquo;: Software architecture.
798 <p>It is used to compose the architecture of the package in which it is
799 build.
800 </p>
801 </li><li> &lsquo;<samp>release</samp>&rsquo;: Release number.
803 <p>This is used to reflect the release number of the package. It is
804 recommended to increase this number after any significant change in
805 the recipe or post-install script.
806 </p>
807 </li><li> &lsquo;<samp>pkgcategory</samp>&rsquo;: Package category.
809 <p>Optional but recommended variable to categorize the package name when it is
810 created.
811 </p></li></ul>
813 <p>Obtaining sources over the network must be declared in the recipe using
814 the &lsquo;<samp>fetch</samp>&rsquo; variable.
815 </p>
816 <p>The variables &lsquo;<samp>netget</samp>&rsquo; and &lsquo;<samp>rsync</samp>&rsquo; can be defined in <samp>qirc</samp>
817 to establish a network downloader in order to get the sources. If they
818 are not defined, qi uses default values:
819 </p>
820 <p>&lsquo;<samp>netget</samp>&rsquo; is the general network downloader tool, defaults sets to
821 &lsquo;<samp>wget -c -w1 -t3 --no-check-certificate</samp>&rsquo;.
822 </p>
823 <p>&lsquo;<samp>rsync</samp>&rsquo; is the network tool for sources containing the prefix for
824 the RSYNC protocol, default sets to
825 &lsquo;<samp>rsync -v -a -L -z -i --progress</samp>&rsquo;.
826 </p>
827 <p>The variable &lsquo;<samp>description</samp>&rsquo; is used to print the package description
828 when a package is installed.
829 </p>
830 <p>A description has two parts: a brief description, and a long description.
831 By convention, the syntax of &lsquo;<samp>description</samp>&rsquo; is:
832 </p>
833 <div class="example">
834 <pre class="example">description=&quot;
835 Brief description.
837 Long description.
838 &quot;
839 </pre></div>
841 <p>The first line of the value represented is a brief description of the
842 software (called &quot;blurb&quot;). A blank line separates the <em>brief
843 description</em> from the <em>long description</em>, which should contain a more
844 descriptive description of the software.
845 </p>
846 <p>An example looks like:
847 </p>
848 <div class="example">
849 <pre class="example">description=&quot;
850 The GNU core utilities.
852 The GNU core utilities are the basic file, shell and text manipulation
853 utilities of the GNU operating system. These are the core utilities
854 which are expected to exist on every operating system.
855 &quot;
856 </pre></div>
858 <p>Please consider a length limit of 78 characters as maximum, because the same
859 one would be used on the meta file creation. See
860 <a href="#Recipes">The meta file</a> section.
861 </p>
862 <p>The &lsquo;<samp>homepage</samp>&rsquo; variable is used to declare the main site or home page:
863 </p>
864 <div class="example">
865 <pre class="example">homepage=http://www.gnu.org/software/gcc
866 </pre></div>
868 <p>The variable &lsquo;<samp>license</samp>&rsquo; is used for license information<a name="DOCF3" href="#FOOT3"><sup>3</sup></a>.
869 Some code in the program can be covered by license A, license B, or
870 license C. For &quot;separate licensing&quot; or &quot;heterogeneous licensing&quot;, we
871 suggest using <strong>|</strong> for a disjunction, <strong>&amp;</strong> for a conjunction
872 (if that ever happens in a significant way), and comma for heterogeneous
873 licensing. Comma would have lower precedence, plus added special terms.
874 </p>
875 <div class="example">
876 <pre class="example">license=&quot;LGPL, GPL | Artistic + added permission&quot;
877 </pre></div>
879 <a name="Writing-recipes"></a>
880 <h3 class="section">5.3 Writing recipes</h3>
881 <a name="index-writing-recipes"></a>
883 <p>Originally, Qi was designed for the version 3 of Dragora GNU/Linux; this
884 doesn&rsquo;t mean you can&rsquo;t use it in another distribution, just that if you do,
885 you&rsquo;ll have to try it out for yourself. To help with this, here are some
886 references to well-written recipes:
887 </p>
888 <ul>
889 <li> <a href="http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes</a>
890 </li><li> <a href="http://notabug.org/dragora/dragora/src/master/recipes">http://notabug.org/dragora/dragora/src/master/recipes</a>
891 </li></ul>
893 <a name="Building-packages"></a>
894 <h3 class="section">5.4 Building packages</h3>
895 <a name="index-package-build"></a>
897 <p>A recipe is any valid regular file. Qi sets priorities for reading a
898 recipe, the order in which qi looks for a recipe is:
899 </p>
900 <ol>
901 <li> Current working directory.
903 </li><li> If the specified path name does not contain &quot;recipe&quot; as the last
904 component. Qi will complete it by adding &quot;recipe&quot; to the path name.
906 </li><li> If the recipe is not in the current working directory, it will be
907 searched under &lsquo;<samp>${worktree}/recipes</samp>&rsquo;. The last component will be
908 completed adding &quot;recipe&quot; to the specified path name.
909 </li></ol>
911 <p>To build a single package, type:
912 </p>
913 <div class="example">
914 <pre class="example">qi -b x-apps/xterm
915 </pre></div>
917 <p>Multiple jobs can be passed to the compiler to speed up the build process:
918 </p>
919 <div class="example">
920 <pre class="example">qi -b -j3 x-apps/xterm
921 </pre></div>
923 <p>Update or install the package produced (if it is not already installed)
924 when finish:
925 </p>
926 <div class="example">
927 <pre class="example">qi -b -j3 -u x-apps/xterm
928 </pre></div>
930 <p>Only process a recipe but do not create the binary package:
931 </p>
932 <div class="example">
933 <pre class="example">qi -b -n dict/aspell
934 </pre></div>
936 <p>The options -i or -u have no effect when -n is given.
937 </p>
938 <p>This can be useful to inspect the build process of recipe:
939 </p>
940 <p>qi -b -k -n dict/aspell 2&gt;&amp;1 | tee aspell-buildlog.txt
941 </p>
942 <p>The -k option could preserve the source directory and the destination
943 directory for later inspection. A log file of the build process will be
944 created redirecting both, standard error and standard output to tee(1).
945 </p>
946 <a name="Variables-from-the-environment"></a>
947 <h3 class="section">5.5 Variables from the environment</h3>
948 <a name="index-environment-variables"></a>
950 <p>Qi has environment variables which can be used at build time:
951 </p>
952 <p>The variable <code>TMPDIR</code> sets the temporary directory for sources, which is
953 used for package extractions (see <a href="#Examining-packages">Examining packages</a>) and is
954 prepended to the value of &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; in
955 build mode. By convention its default value is equal to
956 &lsquo;<samp>/usr/src/qi/build</samp>&rsquo;.
957 </p>
958 <p>The variables <code>QICFLAGS</code>, <code>QICXXFLAGS</code>, and <code>QILDFLAGS</code> have
959 no effect by default. The environment variables such as <code>CFLAGS</code>,
960 <code>CXXFLAGS</code>, and <code>LDFLAGS</code> are unset at compile time:
961 </p>
962 <p>Recommended practice is to set variables in the command line of
963 &lsquo;<samp>configure</samp>&rsquo; or <em>make(1)</em> instead of exporting to the
964 environment. As follows:
965 </p>
966 <p><a href="http://www.gnu.org/software/make/manual/html_node/Environment.html">http://www.gnu.org/software/make/manual/html_node/Environment.html</a>
967 </p><blockquote>
968 <p>It is not wise for makefiles to depend for their functioning on environment
969 variables set up outside their control, since this would cause different
970 users to get different results from the same makefile. This is against the
971 whole purpose of most makefiles.
972 </p></blockquote>
974 <p>Setting environment variables for configure is deprecated because running
975 configure in varying environments can be dangerous.
976 </p>
977 <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>
978 </p><blockquote>
979 <p>Variables not defined in a site shell script can be set in the environment
980 passed to configure. However, some packages may run configure again
981 during the build, and the customized values of these variables may be
982 lost. In order to avoid this problem, you should set them in the
983 configure command line, using &lsquo;<samp>VAR=value</samp>&rsquo;. For example:
984 </p>
985 <p><code>./configure CC=/usr/local2/bin/gcc</code>
986 </p></blockquote>
988 <p><a href="http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</a>
989 </p><blockquote>
990 <p>If for instance the user runs &lsquo;<samp>CC=bizarre-cc ./configure</samp>&rsquo;, then the cache,
991 config.h, and many other output files depend upon bizarre-cc being the C
992 compiler. If for some reason the user runs ./configure again, or if it is
993 run via &lsquo;<samp>./config.status --recheck</samp>&rsquo;, (See Automatic Remaking, and see
994 config.status Invocation), then the configuration can be inconsistent,
995 composed of results depending upon two different compilers.
996 [...]
997 Indeed, while configure can notice the definition of CC in &lsquo;<samp>./configure
998 CC=bizarre-cc</samp>&rsquo;, it is impossible to notice it in &lsquo;<samp>CC=bizarre-cc
999 ./configure</samp>&rsquo;, which, unfortunately, is what most users do.
1000 [...]
1001 configure: error: changes in the environment can compromise the build.
1002 </p></blockquote>
1004 <a name="The-meta-file"></a>
1005 <h3 class="section">5.6 The meta file</h3>
1006 <a name="index-the-meta-file"></a>
1008 <p>The &quot;meta file&quot; is a regular file created during the build mode, it
1009 contains information about the package such as package name, package
1010 version, architecture, release, fetch address, description, and other
1011 minor data extracted from processed recipes. The name of the file is
1012 generated as &lsquo;<samp>${full_pkgname}.tlz.txt</samp>&rsquo;, and its purpose is to
1013 reflect essential information to the user without having to look inside
1014 the package content. The file format is also intended to be used by
1015 other scripts or by common Unix tools.
1016 </p>
1017 <p>The content of a meta file looks like:
1018 </p>
1019 <div class="example">
1020 <pre class="example">#
1021 # Pattern scanning and processing language.
1023 # The awk utility interprets a special-purpose programming language
1024 # that makes it possible to handle simple data-reformatting jobs
1025 # with just a few lines of code. It is a free version of 'awk'.
1027 # GNU awk implements the AWK utility which is part of
1028 # IEEE Std 1003.1 Shell and Utilities (XCU).
1031 QICFLAGS=&quot;-g0 -Os&quot;
1032 QICXXFLAGS=&quot;-g0 -Os&quot;
1033 QILDFLAGS=&quot;-s&quot;
1034 pkgname=gawk
1035 pkgversion=5.0.1
1036 arch=x86_64
1037 release=1
1038 pkgcategory=@tools
1039 full_pkgname=gawk-5.0.1-x86_64+1@tools
1040 blurb=&quot;Pattern scanning and processing language.&quot;
1041 homepage=&quot;http://www.gnu.org/software/gawk&quot;
1042 license=&quot;GPLv3+&quot;
1043 fetch=&quot;http://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz&quot;
1044 replace=&quot;&quot;
1045 </pre></div>
1047 <p>Package descriptions are extracted from the variable &lsquo;<samp>description</samp>&rsquo;
1048 where each line is interpreted literally and pre-formatted to fit in
1049 (exactly) <strong>80 columns</strong>, plus the character &lsquo;<samp>#</samp>&rsquo; and a blank
1050 space is prefixed to every line (shell comments).
1051 </p>
1052 <p>In addition to the Special variables, there are implicit variables such as
1053 &lsquo;<samp>blurb</samp>&rsquo;:
1054 </p>
1055 <p>The &lsquo;<samp>blurb</samp>&rsquo; variable is related to the special variable
1056 &lsquo;<samp>description</samp>&rsquo;. Its value is made from the first (substantial)
1057 line of &lsquo;<samp>description</samp>&rsquo;, mentioned as the &quot;brief description&quot;.
1058 </p>
1060 <hr>
1061 <a name="Order-files"></a>
1062 <div class="header">
1064 Next: <a href="#Creating-packages" accesskey="n" rel="next">Creating packages</a>, Previous: <a href="#Recipes" accesskey="p" rel="prev">Recipes</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
1065 </div>
1066 <a name="Order-files-1"></a>
1067 <h2 class="chapter">6 Order files</h2>
1068 <a name="index-handling-build-order"></a>
1070 <p>The order mode has the purpose of resolving the build order through
1071 .order files. An order file contains a list of recipe names, by default
1072 does not perform any action other than to print a resolved list in
1073 descending order. For example, if <strong>a</strong> depends on <strong>b</strong> and
1074 <strong>c</strong>, and <strong>c</strong> depends on <strong>b</strong> as well, the file might
1075 look like:
1076 </p>
1077 <div class="example">
1078 <pre class="example">a: c b
1080 c: b
1081 </pre></div>
1083 <p>Each letter represents a recipe name, complete dependencies for
1084 the first recipe name are listed in descending order, which is
1085 printed from right to left, and removed from left to right:
1086 </p>
1087 <p><small>OUTPUT</small>
1088 </p>
1089 <div class="example">
1090 <pre class="example">b
1093 </pre></div>
1095 <p>Blank lines, colons and parentheses are simply ignored. Comment lines
1096 beginning with &lsquo;<samp>#</samp>&rsquo; are allowed.
1097 </p>
1098 <p>An order file could be used to build a series of packages, for example,
1099 if the content is:
1100 </p>
1101 <div class="example">
1102 <pre class="example"># Image handling libraries
1104 libs/libjpeg-turbo: devel/nasm
1105 x-libs/jasper: libs/libjpeg-turbo
1106 libs/tiff: libs/libjpeg-turbo
1107 </pre></div>
1109 <p>To proceed with each recipe, we can type:
1110 </p>
1111 <div class="example">
1112 <pre class="example">qi -o imglibs.order | qi -b -i -
1113 </pre></div>
1115 <p>The output of &lsquo;<samp>qi -o imglibs.order</samp>&rsquo; tells to qi in which order it
1116 should build the recipes:
1117 </p>
1118 <div class="example">
1119 <pre class="example">devel/nasm
1120 libs/libjpeg-turbo
1121 x-libs/jasper
1122 libs/tiff
1123 </pre></div>
1126 <hr>
1127 <a name="Creating-packages"></a>
1128 <div class="header">
1130 Next: <a href="#Examining-packages" accesskey="n" rel="next">Examining packages</a>, Previous: <a href="#Order-files" accesskey="p" rel="prev">Order files</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
1131 </div>
1132 <a name="Creating-packages-1"></a>
1133 <h2 class="chapter">7 Creating packages</h2>
1134 <a name="index-package-creation"></a>
1136 <p>The &quot;creation mode&quot; is an internal function of qi to make new Qi compatible
1137 compatible packages, the creation mode is selected by the -c option.
1138 A package is produced using the contents of the Current Directory, and
1139 the package file is written out.
1140 </p>
1141 <div class="example">
1142 <pre class="example">Usage: qi -c [<var>Output/PackageName.tlz</var>]...
1143 </pre></div>
1145 <p>The argument for the file name to be written must contain a fully
1146 qualified named directory as the output directory where the package
1147 produced will be written. The file name should be composed using the
1148 full name: name-version-architecture+release.tlz
1149 </p>
1150 <p><small>EXAMPLE</small>
1151 </p>
1152 <div class="example">
1153 <pre class="example">cd /usr/pkg
1154 cd claws-mail-3.17.1-x86_64+1
1155 qi -c /var/cache/qi/packages/claws-mail-3.17.1-x86_64+1.tlz
1156 </pre></div>
1158 <p>In this case, the package &quot;claws-mail-3.17.1-x86_64+1.tlz&quot; will be written
1159 into &lsquo;<samp>/var/cache/qi/packages/</samp>&rsquo;.
1160 </p>
1161 <p>All packages produced are complemented by a checksum file (.sha256).
1162 </p>
1164 <hr>
1165 <a name="Examining-packages"></a>
1166 <div class="header">
1168 Next: <a href="#Exit-status" accesskey="n" rel="next">Exit status</a>, Previous: <a href="#Creating-packages" accesskey="p" rel="prev">Creating packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
1169 </div>
1170 <a name="Examining-packages-1"></a>
1171 <h2 class="chapter">8 Examining packages</h2>
1172 <a name="index-package-examination"></a>
1174 <p>The &quot;extraction mode&quot; serves to examine binary packages for debugging
1175 purposes. The extraction mode is selected by the -x option. It
1176 decompresses a package into a single directory, verifying its integrity
1177 and preserving its properties.
1178 </p>
1179 <div class="example">
1180 <pre class="example">Usage: qi -x [<var>packagename.tlz</var>]...
1181 </pre></div>
1183 <p><small>EXAMPLE</small>
1184 </p>
1185 <div class="example">
1186 <pre class="example">qi -x mksh-R56c-x86_64+1.tlz
1187 </pre></div>
1189 <p>This action will put the content of &quot;mksh-R56c-x86_64+1.tlz&quot; into a
1190 single directory, this will be a private directory for the user who
1191 </p>
1192 <p>requested the action, creation mode will be equal to <strong>u=rwx,g=,o=
1193 (0700)</strong>. The package content will reside on this location, default
1194 mask to deploy the content will be equal to
1195 <strong>u=rwx,g=rwx,o=rwx (0000)</strong>.
1196 </p>
1197 <p>The creation of the custom directory is influenced by the value of the
1198 <code>TMPDIR</code> variable.
1199 </p>
1201 <hr>
1202 <a name="Exit-status"></a>
1203 <div class="header">
1205 Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Examining-packages" accesskey="p" rel="prev">Examining packages</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
1206 </div>
1207 <a name="Exit-status-1"></a>
1208 <h2 class="chapter">9 Exit status</h2>
1209 <a name="index-exit-codes"></a>
1211 <p>All the exit codes are described in this chapter.
1212 </p>
1213 <dl compact="compact">
1214 <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
1215 <dd><p>Successful completion (no errors).
1216 </p>
1217 </dd>
1218 <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
1219 <dd><p>Minor common errors:
1220 </p>
1221 <ul>
1222 <li> Help usage on illegal options or required arguments.
1224 </li><li> Program needed by qi (prerequisite) is not available.
1225 </li></ul>
1227 </dd>
1228 <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
1229 <dd><p>Command execution error:
1230 </p>
1231 <p>This code is used to return the evaluation of external commands and shell
1232 arguments in case of error.
1233 </p>
1234 </dd>
1235 <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
1236 <dd><p>Integrity check error for compressed files.
1237 </p>
1238 <p>Compressed files means:
1239 </p>
1240 <ul>
1241 <li> Tarball files from tar(1).
1242 Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
1243 .tar.xz, .txz
1245 </li><li> Tarball files from tarlz(1).
1246 Supported extensions: .tar.lz, .tlz
1248 </li><li> Zip files from unzip(1).
1249 Supported extensions: .zip, .ZIP
1251 </li><li> Gzip files from gzip(1).
1252 Supported extensions: .gz, .Z
1254 </li><li> Bzip2 files from bzip2(1).
1255 Supported extension: .bz2
1257 </li><li> Lzip files from lzip(1).
1258 Supported extension: .lz
1260 </li><li> Xz files from xz(1).
1261 Supported extension: .xz
1262 </li></ul>
1264 </dd>
1265 <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
1266 <dd><p>File empty, not regular, or expected.
1267 </p>
1268 <p>Commonly, it is expected:
1269 </p>
1270 <ul>
1271 <li> An argument for the mode of operation.
1273 </li><li> A readable file or directory.
1275 </li><li> A binary package (.tlz).
1277 </li><li> A valid recipe.
1279 </li><li> An order file (.order).
1281 </li><li> A protocol supported by the network downloader tool.
1283 </li><li> A checksum file (.sha256).
1284 </li></ul>
1286 </dd>
1287 <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
1288 <dd><p>Empty or not defined variable:
1289 </p>
1290 <p>This code is used to report empty or undefined variables; usually,
1291 variables coming from a recipe or assigned arrays that are tested.
1292 </p>
1293 </dd>
1294 <dt>&lsquo;<samp>6</samp>&rsquo;</dt>
1295 <dd><p>Package already installed:
1296 </p>
1297 <p>The package directory for an incoming .tlz package already exists.
1298 </p>
1299 </dd>
1300 <dt>&lsquo;<samp>10</samp>&rsquo;</dt>
1301 <dd><p>Network manager error:
1302 </p>
1303 <p>This code is used if the network downloader tool fails for some reason.
1304 </p></dd>
1305 </dl>
1308 <hr>
1309 <a name="Index"></a>
1310 <div class="header">
1312 Previous: <a href="#Exit-status" accesskey="p" rel="prev">Exit status</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Index" title="Index" rel="index">Index</a>]</p>
1313 </div>
1314 <a name="Index-1"></a>
1315 <h2 class="unnumbered">Index</h2>
1317 <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
1318 &nbsp;
1319 <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
1320 &nbsp;
1321 <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
1322 &nbsp;
1323 <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
1324 &nbsp;
1325 <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
1326 &nbsp;
1327 <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
1328 &nbsp;
1329 <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
1330 &nbsp;
1331 <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
1332 &nbsp;
1333 <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
1334 &nbsp;
1335 <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
1336 &nbsp;
1337 <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
1338 &nbsp;
1339 </td></tr></table>
1340 <table class="index-cp" border="0">
1341 <tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
1342 <tr><td colspan="4"> <hr></td></tr>
1343 <tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr>
1344 <tr><td></td><td valign="top"><a href="#index-configuration-file">configuration file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#The-qirc-file">The qirc file</a></td></tr>
1345 <tr><td colspan="4"> <hr></td></tr>
1346 <tr><th><a name="Index_cp_letter-E">E</a></th><td></td><td></td></tr>
1347 <tr><td></td><td valign="top"><a href="#index-environment-variables">environment variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
1348 <tr><td></td><td valign="top"><a href="#index-exit-codes">exit codes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Exit-status">Exit status</a></td></tr>
1349 <tr><td colspan="4"> <hr></td></tr>
1350 <tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr>
1351 <tr><td></td><td valign="top"><a href="#index-handling-build-order">handling build order</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Order-files">Order files</a></td></tr>
1352 <tr><td colspan="4"> <hr></td></tr>
1353 <tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr>
1354 <tr><td></td><td valign="top"><a href="#index-introduction">introduction</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Introduction">Introduction</a></td></tr>
1355 <tr><td></td><td valign="top"><a href="#index-invocation">invocation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Invoking-qi">Invoking qi</a></td></tr>
1356 <tr><td colspan="4"> <hr></td></tr>
1357 <tr><th><a name="Index_cp_letter-M">M</a></th><td></td><td></td></tr>
1358 <tr><td></td><td valign="top"><a href="#index-managing-packages">managing packages</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
1359 <tr><td colspan="4"> <hr></td></tr>
1360 <tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr>
1361 <tr><td></td><td valign="top"><a href="#index-package-blacklist">package blacklist</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
1362 <tr><td></td><td valign="top"><a href="#index-package-build">package build</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
1363 <tr><td></td><td valign="top"><a href="#index-package-conflicts">package conflicts</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
1364 <tr><td></td><td valign="top"><a href="#index-package-creation">package creation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Creating-packages">Creating packages</a></td></tr>
1365 <tr><td></td><td valign="top"><a href="#index-package-de_002dinstallation">package de-installation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
1366 <tr><td></td><td valign="top"><a href="#index-package-examination">package examination</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Examining-packages">Examining packages</a></td></tr>
1367 <tr><td></td><td valign="top"><a href="#index-package-installation">package installation</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
1368 <tr><td></td><td valign="top"><a href="#index-package-upgrade">package upgrade</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Packages">Packages</a></td></tr>
1369 <tr><td colspan="4"> <hr></td></tr>
1370 <tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr>
1371 <tr><td></td><td valign="top"><a href="#index-recipes">recipes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
1372 <tr><td colspan="4"> <hr></td></tr>
1373 <tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr>
1374 <tr><td></td><td valign="top"><a href="#index-special-variables">special variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
1375 <tr><td colspan="4"> <hr></td></tr>
1376 <tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr>
1377 <tr><td></td><td valign="top"><a href="#index-the-meta-file">the meta file</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
1378 <tr><td colspan="4"> <hr></td></tr>
1379 <tr><th><a name="Index_cp_letter-V">V</a></th><td></td><td></td></tr>
1380 <tr><td></td><td valign="top"><a href="#index-variables">variables</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
1381 <tr><td colspan="4"> <hr></td></tr>
1382 <tr><th><a name="Index_cp_letter-W">W</a></th><td></td><td></td></tr>
1383 <tr><td></td><td valign="top"><a href="#index-writing-recipes">writing recipes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Recipes">Recipes</a></td></tr>
1384 <tr><td colspan="4"> <hr></td></tr>
1385 </table>
1386 <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
1387 &nbsp;
1388 <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
1389 &nbsp;
1390 <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
1391 &nbsp;
1392 <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
1393 &nbsp;
1394 <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
1395 &nbsp;
1396 <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
1397 &nbsp;
1398 <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
1399 &nbsp;
1400 <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
1401 &nbsp;
1402 <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
1403 &nbsp;
1404 <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
1405 &nbsp;
1406 <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
1407 &nbsp;
1408 </td></tr></table>
1410 <div class="footnote">
1411 <hr>
1412 <h4 class="footnotes-heading">Footnotes</h4>
1414 <h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
1415 <p>For more details about the lzip format, visit
1416 <a href="https://www.nongnu.org/lzip/">https://www.nongnu.org/lzip/</a>.</p>
1417 <h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
1418 <p>The official guide for Graft can be found at
1419 <a href="http://peters.gormand.com.au/Home/tools/graft/graft.html">http://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>
1420 <h3><a name="FOOT3" href="#DOCF3">(3)</a></h3>
1421 <p>The proposal for &lsquo;<samp>license</samp>&rsquo; was made by Richard M. Stallman at
1422 <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>
1423 </div>
1424 <hr>
1428 </body>
1429 </html>