qi: Bump to version 2.0 (Release Candidate 12)
[dragora.git] / qi / doc / qi.html
blobfc01ccd09437e6c2d59060917d4325a3aab6600a
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 2.0rc12,
4 18 Jul 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 2.0rc12,
112 18 Jul 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 for invoking Qi.
183 </p>
184 <div class="example">
185 <pre class="example">Usage: qi COMMAND [<var>OPTION</var>...] [<var>FILE</var>]...
186 </pre></div>
188 <p>One mandatory command specifies the operation that &lsquo;<samp>qi</samp>&rsquo; should
189 perform, options are meant to detail how this operation should be
190 performed during or after the process.
191 </p>
192 <p>Qi supports the following commands:
193 </p>
194 <dl compact="compact">
195 <dt><code>warn</code></dt>
196 <dd><p>Warn about files that will be installed.
197 </p>
198 </dd>
199 <dt><code>install</code></dt>
200 <dd><p>Install packages.
201 </p>
202 </dd>
203 <dt><code>remove</code></dt>
204 <dd><p>Remove packages.
205 </p>
206 </dd>
207 <dt><code>upgrade</code></dt>
208 <dd><p>Upgrade packages.
209 </p>
210 </dd>
211 <dt><code>extract</code></dt>
212 <dd><p>Extract packages for debugging purposes.
213 </p>
214 </dd>
215 <dt><code>create</code></dt>
216 <dd><p>Create a .tlz package from directory.
217 </p>
218 </dd>
219 <dt><code>build</code></dt>
220 <dd><p>Build packages using recipe names.
221 </p>
222 </dd>
223 <dt><code>order</code></dt>
224 <dd><p>Resolve build order through .order files
225 </p></dd>
226 </dl>
228 <p>Options when installing, removing, or upgrading software packages:
229 </p>
230 <dl compact="compact">
231 <dt><code>-f</code></dt>
232 <dt><code>--force</code></dt>
233 <dd><p>Force upgrade of pre-existing packages.
234 </p>
235 </dd>
236 <dt><code>-k</code></dt>
237 <dt><code>--keep</code></dt>
238 <dd><p>Keep directories when build/remove/upgrade.
239 </p>
240 <p>Keep (don&rsquo;t delete) the package directory when using remove/upgrade command.
241 </p>
242 <p>This will also try to preserve the directories &lsquo;<samp>${srcdir}</samp>&rsquo; and
243 &lsquo;<samp>${destdir}</samp>&rsquo; when using build command. Its effect is available in
244 recipes as &lsquo;<samp>${keep_srcdir}</samp>&rsquo; and &lsquo;<samp>${keep_destdir}</samp>&rsquo;. See
245 <a href="#Recipes">Special variables</a> for details.
246 </p>
247 </dd>
248 <dt><code>-p</code></dt>
249 <dt><code>--prune</code></dt>
250 <dd><p>Prune conflicts.
251 </p>
252 </dd>
253 <dt><code>-P</code></dt>
254 <dt><code>--packagedir=&lt;dir&gt;</code></dt>
255 <dd><p>Set directory for package installations.
256 </p>
257 </dd>
258 <dt><code>-t</code></dt>
259 <dt><code>--targetdir=&lt;dir&gt;</code></dt>
260 <dd><p>Set target directory for symbolic links.
261 </p>
262 </dd>
263 <dt><code>-r</code></dt>
264 <dt><code>--rootdir=&lt;dir&gt;</code></dt>
265 <dd><p>Use the fully qualified named directory as the root directory for all qi
266 operations.
267 </p>
268 <p>Note: the target directory and the package directory will be
269 relative to the specified directory, excepting the graft log file.
270 </p></dd>
271 </dl>
273 <p>Options when building software packages using recipes:
274 </p>
275 <dl compact="compact">
276 <dt><code>-a</code></dt>
277 <dt><code>--architecture</code></dt>
278 <dd><p>Set architecture name for the package.
279 </p>
280 </dd>
281 <dt><code>-j</code></dt>
282 <dt><code>--jobs</code></dt>
283 <dd><p>Parallel jobs for the compiler.
284 </p>
285 <p>This option sets the variable &lsquo;<samp>${jobs}</samp>&rsquo;. If not specified, default
286 sets to 1.
287 </p>
288 </dd>
289 <dt><code>-S</code></dt>
290 <dt><code>--skip-questions</code></dt>
291 <dd><p>Skip questions on completed recipes.
292 </p>
293 </dd>
294 <dt><code>-1</code></dt>
295 <dt><code>--increment</code></dt>
296 <dd><p>Increment release number (&lsquo;<samp>${release}</samp>&rsquo; + 1).
297 </p>
298 <p>The effect of this option will be omitted if &ndash;no-package is being used.
299 </p>
300 </dd>
301 <dt><code>-n</code></dt>
302 <dt><code>--no-package</code></dt>
303 <dd><p>Do not create a .tlz package.
304 </p>
305 </dd>
306 <dt><code>-i</code></dt>
307 <dt><code>--install</code></dt>
308 <dd><p>Install package after the build.
309 </p>
310 </dd>
311 <dt><code>-u</code></dt>
312 <dt><code>--upgrade</code></dt>
313 <dd><p>Upgrade package after the build.
314 </p>
315 </dd>
316 <dt><code>-o</code></dt>
317 <dt><code>--outdir=&lt;dir&gt;</code></dt>
318 <dd><p>Where the packages produced will be written.
319 </p>
320 <p>This option sets the variable &lsquo;<samp>${outdir}</samp>&rsquo;.
321 </p>
322 </dd>
323 <dt><code>-w</code></dt>
324 <dt><code>--worktree=&lt;dir&gt;</code></dt>
325 <dd><p>Where archives, patches, recipes are expected.
326 </p>
327 <p>This option sets the variable &lsquo;<samp>${worktree}</samp>&rsquo;.
328 </p>
329 </dd>
330 <dt><code>-s</code></dt>
331 <dt><code>--sourcedir=&lt;dir&gt;</code></dt>
332 <dd><p>Where compressed sources will be found.
333 </p>
334 <p>This option sets the variable &lsquo;<samp>${tardir}</samp>&rsquo;.
335 </p></dd>
336 </dl>
338 <p>Other options:
339 </p>
340 <dl compact="compact">
341 <dt><code>-v</code></dt>
342 <dt><code>--verbose</code></dt>
343 <dd><p>Be verbose (an extra -v gives more).
344 </p>
345 <p>It sets the verbosity level, default sets to 0.
346 </p>
347 <p>The value 1 is used for more verbosity while the value 2 is too detailed.
348 Although at the moment it is limited to graft(1) verbosity.
349 </p>
350 </dd>
351 <dt><code>-N</code></dt>
352 <dt><code>--no-rc</code></dt>
353 <dd><p>Do not read the configuration file.
354 </p>
355 <p>This will ignore reading the qirc file.
356 </p>
357 </dd>
358 <dt><code>-L</code></dt>
359 <dt><code>--show-location</code></dt>
360 <dd><p>Print default directory locations and exit.
361 </p>
362 <p>This will print the target directory, package directory, working tree,
363 the directory for sources, and the output directory for the packages
364 produced.
365 </p>
366 </dd>
367 <dt><code>-h</code></dt>
368 <dt><code>--help</code></dt>
369 <dd><p>Display the usage and exit.
370 </p>
371 </dd>
372 <dt><code>-V</code></dt>
373 <dt><code>--version</code></dt>
374 <dd>
375 <p>This will print the (short) version information and then exit.
376 </p>
377 <p>The same can be achieved if Qi is invoked as &lsquo;<samp>qi version</samp>&rsquo;.
378 </p></dd>
379 </dl>
381 <p>When FILE is -, qi can read from the standard input. See examples from
382 the <a href="#Packages">Packages</a> section.
383 </p>
384 <p>Exit status: 0 for a normal exit, 1 for minor common errors (help usage,
385 support not available, etc), 2 to indicate a command execution error;
386 3 for integrity check error on compressed files, 4 for empty, not
387 regular, or expected files, 5 for empty or not defined variables,
388 6 when a package already exist, 10 for network manager errors.
389 For more details, see the <a href="#Exit-status">Exit status</a> section.
390 </p>
392 <hr>
393 <a name="The-qirc-file"></a>
394 <div class="header">
396 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>
397 </div>
398 <a name="The-qirc-file-1"></a>
399 <h2 class="chapter">3 The qirc file</h2>
400 <a name="index-configuration-file"></a>
402 <p>The global <samp>qirc</samp> file offers a way to define variables and tools
403 (such as a download manager) for default use. This file is used by qi
404 at runtime, e.g., to build, install, remove or upgrade packages.
405 </p>
406 <p>Variables and their possible values must be declared as any other
407 variable in the shell.
408 </p>
409 <p>The command line options related to the package directory and target
410 directory and some of the command line options used for the build command,
411 have the power to override the values declared on <samp>qirc</samp>.
412 See <a href="#Invoking-qi">Invoking qi</a>.
413 </p>
414 <p>The order in which qi looks for this file is:
415 </p>
416 <ol>
417 <li> <code>${HOME}/.qirc</code>
418 Effective user.
420 </li><li> &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo;
421 System-wide.
422 </li></ol>
424 <p>If you intend to run qi as effective user, the file
425 &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo; could be copied to <code>${HOME}/.qirc</code>
426 setting the paths for &lsquo;<samp>${packagedir}</samp>&rsquo; and &lsquo;<samp>${targetdir}</samp>&rsquo;
427 according to the <code>$HOME</code>.
428 </p>
430 <hr>
431 <a name="Packages"></a>
432 <div class="header">
434 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>
435 </div>
436 <a name="Packages-1"></a>
437 <h2 class="chapter">4 Packages</h2>
438 <a name="index-managing-packages"></a>
440 <p>A package is a suite of programs usually distributed in binary form
441 which may also contain manual pages, documentation, or any other file
442 associated to a specific software.
443 </p>
444 <p>The package format used by qi is a simplified POSIX pax archive
445 compressed using lzip<a name="DOCF1" href="#FOOT1"><sup>1</sup></a>. The
446 file extension for packages ends in &lsquo;<samp>.tlz</samp>&rsquo;.
447 </p>
448 <p>Both package installation and package de-installation are managed using
449 two important (internal) variables: &lsquo;<samp>${packagedir}</samp>&rsquo; and
450 &lsquo;<samp>${targetdir}</samp>&rsquo;, these values can be changed in the
451 configuration file or via options.
452 </p>
453 <p>&lsquo;<samp>${packagedir}</samp>&rsquo; is a common directory tree where the package
454 contents will be decompressed (will reside).
455 </p>
456 <p>&lsquo;<samp>${targetdir}</samp>&rsquo; is a target directory where the links will be
457 made by graft(1) taking &lsquo;<samp>${packagedir}/package_name</samp>&rsquo; into account.
458 </p>
459 <p>Packages are installed in self-contained directory trees and symbolic
460 links from a common area are made to the package files. This allows
461 multiple versions of the same package to coexist on the same system.
462 </p>
463 <a name="Package-conflicts"></a>
464 <h3 class="section">4.1 Package conflicts</h3>
465 <a name="index-package-conflicts"></a>
467 <p>All the links to install or remove a package are handled by graft(1).
468 Since multiple packages can be installed or removed at the same time,
469 certain conflicts may arise between the packages.
470 </p>
471 <p>graft<a name="DOCF2" href="#FOOT2"><sup>2</sup></a>
472 defines a CONFLICT as one of the following conditions:
473 </p>
474 <ul>
475 <li> If the package object is a directory and the target object exists but is
476 not a directory.
478 </li><li> If the package object is not a directory and the target object exists
479 and is not a symbolic link.
481 </li><li> If the package object is not a directory and the target object exists
482 and is a symbolic link to something other than the package object.
483 </li></ul>
485 <p>The default behavior of qi for an incoming package is to ABORT if a
486 conflict arises. When a package is going to be deleted, qi tells to
487 graft(1) to remove those parts that are not in conflict, leaving the
488 links to the belonging package. This behavior can be forced if the
489 &ndash;prune option is given.
490 </p>
491 <a name="Installing-packages"></a>
492 <h3 class="section">4.2 Installing packages</h3>
493 <a name="index-package-installation"></a>
495 <p>To install a single package, simply type:
496 </p>
497 <div class="example">
498 <pre class="example">qi install coreutils_8.30_i586-1@tools.tlz
499 </pre></div>
501 <p>To install multiple packages at once, type:
502 </p>
503 <div class="example">
504 <pre class="example">qi install gcc_8.3.0_i586-1@devel.tlz rafaela_2.2_i586-1@legacy.tlz ...
505 </pre></div>
507 <p>Warn about the files that will be linked:
508 </p>
509 <div class="example">
510 <pre class="example">qi warn bash_5.0_i586-1@shells.tlz
511 </pre></div>
513 <p>This is to verify the content of a package before installing it.
514 </p>
515 <p>See the process of an installation:
516 </p>
517 <div class="example">
518 <pre class="example">qi install --verbose mariana_3.0_i586-1@woman.tlz
519 </pre></div>
521 <p>A second &ndash;verbose or -v option gives more (very verbose).
522 </p>
523 <p>Installing package in a different location:
524 </p>
525 <div class="example">
526 <pre class="example">qi install --rootdir=/media/floppy lzip_1.21_i586-1@compressors.tlz
527 </pre></div>
529 <p>Important: the &ndash;rootdir option assumes &lsquo;<samp>${targetdir}</samp>&rsquo; and
530 &lsquo;<samp>${packagedir}</samp>&rsquo;. See the following example:
531 </p>
532 <div class="example">
533 <pre class="example">qi install --rootdir=/home/selk lzip_1.21_i586-1@compressors.tlz
534 </pre></div>
536 <p>The content of &quot;lzip_1.21_i586-1@compressors.tlz&quot; will be decompressed
537 into &lsquo;<samp>/home/selk/pkgs/lzip_1.21_i586-1@compressors</samp>&rsquo;.
538 Assuming that the main binary for lzip is under
539 &lsquo;<samp>/home/selk/pkgs/lzip_1.21_i586-1@compressors/usr/bin/</samp>&rsquo;
540 the target for &quot;usr/bin&quot; will be created at &lsquo;<samp>/home/selk</samp>&rsquo;. Considering
541 that you have exported the <code>PATH</code> as &lsquo;<samp>${HOME}/usr/bin</samp>&rsquo;, now the
542 system is able to see the recent lzip command.
543 </p>
544 <p>Installing from a list of packages using standard input:
545 </p>
546 <div class="example">
547 <pre class="example">qi install - &lt; PACKAGELIST.txt
548 </pre></div>
550 <p>Or in combination with another tool:
551 </p><div class="example">
552 <pre class="example">sort -u PACKAGELIST.txt | qi install -
553 </pre></div>
555 <p>The sort command will read and sorts the list of declared packages,
556 while trying to have unique entries for each statement. The output
557 produced is captured by Qi to install each package.
558 </p>
559 <p>An example of a list containing package names is:
560 </p><div class="example">
561 <pre class="example">/var/cache/qi/packages/amd64/tcl_8.6.9_amd64-1@devel.tlz
562 /var/cache/qi/packages/amd64/tk_8.6.9.1_amd64-1@devel.tlz
563 /var/cache/qi/packages/amd64/vala_0.42.3_amd64-1@devel.tlz
564 </pre></div>
566 <a name="Removing-packages"></a>
567 <h3 class="section">4.3 Removing packages</h3>
568 <a name="index-package-de_002dinstallation"></a>
570 <p>To remove a package, simply type:
571 </p>
572 <div class="example">
573 <pre class="example">qi remove xz_5.2.4_i586-1@compressors.tlz
574 </pre></div>
576 <p>Remove command will match the package name using &lsquo;<samp>${packagedir}</samp>&rsquo; as
577 prefix. For example, if the value of &lsquo;<samp>${packagedir}</samp>&rsquo; has been
578 set to /usr/pkg, this will be equal to:
579 </p>
580 <div class="example">
581 <pre class="example">qi remove /usr/pkg/xz_5.2.4_i586-1@compressors
582 </pre></div>
584 <p>Detailed output:
585 </p>
586 <div class="example">
587 <pre class="example">qi remove --verbose /usr/pkg/xz_5.2.4_i586-1@compressors
588 </pre></div>
590 <p>A second &ndash;verbose or -v option gives more (very verbose).
591 </p>
592 <p>By default the remove command does not preserve a package directory after
593 removing its links from &lsquo;<samp>${targetdir}</samp>&rsquo;, but this behavior can be
594 changed if the &ndash;keep option is passed:
595 </p>
596 <div class="example">
597 <pre class="example">qi remove --keep /usr/pkg/lzip_1.21_i586-1@compressors
598 </pre></div>
600 <p>This means that the links to the package can be reactivated, later:
601 </p>
602 <div class="example">
603 <pre class="example">cd /usr/pkg &amp;&amp; graft -i lzip_1.21_i586-1@compressors
604 </pre></div>
606 <p>Removing package from a different location:
607 </p>
608 <div class="example">
609 <pre class="example">qi remove --rootdir=/home/cthulhu xz_5.2.4_i586-1@compressors
610 </pre></div>
612 <p>Removing a package using standard input:
613 </p>
614 <div class="example">
615 <pre class="example">echo vala_0.42.3_amd64-1@devel | qi remove -
616 </pre></div>
618 <p>This will match with the package directory.
619 </p>
620 <a name="Upgrading-packages"></a>
621 <h3 class="section">4.4 Upgrading packages</h3>
622 <a name="index-package-upgrade"></a>
624 <p>The upgrade command inherits the properties of the installation and removal
625 process. To make sure that a package is updated, the package is installed
626 in a temporary directory taking &lsquo;<samp>${packagedir}</samp>&rsquo; into account. Once
627 the incoming package is pre-installed, qi can proceed to search and delete
628 packages that have the same name (considered as previous ones). Finally,
629 the package is re-installed at its final location and the temporary
630 directory is removed.
631 </p>
632 <p>To upgrade a package, just type:
633 </p>
634 <div class="example">
635 <pre class="example">qi upgrade gcc_9.0.1_i586-1@devel.tlz
636 </pre></div>
638 <p>This will proceed to upgrade &quot;gcc_9.0.1_i586-1@devel&quot; removing any other
639 version of &quot;gcc&quot; (if any).
640 </p>
641 <p>If you want to keep the package directories of versions found during the
642 upgrade process, just pass:
643 </p>
644 <div class="example">
645 <pre class="example">qi upgrade --keep gcc_9.0.1_i586-1@devel.tlz
646 </pre></div>
648 <p>To see the upgrade process:
649 </p>
650 <div class="example">
651 <pre class="example">qi upgrade --verbose gcc_9.0.1_i586-1@devel.tlz
652 </pre></div>
654 <p>A second &ndash;verbose or -v option gives more (very verbose).
655 </p>
656 <p>To force the upgrade of an existing package:
657 </p>
658 <div class="example">
659 <pre class="example">qi upgrade --force gcc_9.0.1_i586-1@devel.tlz
660 </pre></div>
662 <a name="Package-blacklist"></a>
663 <h4 class="subsection">4.4.1 Package blacklist</h4>
664 <a name="index-package-blacklist"></a>
666 <p>To implement general package facilities, either to install, remove or
667 maintain the hierarchy of packages in a clean manner, qi makes use of the
668 pruning operation via graft(1) by default:
669 </p>
670 <p>There is a risk if those are crucial packages for the proper functioning
671 of the system, because it implies the deactivation of symbolic from the
672 target directory, <em>especially</em> when transitioning an incoming package
673 into its final location during an upgrade.
674 </p>
675 <p>A blacklist of package names has been devised for the case where
676 a user decides to upgrade all the packages in the system, or
677 just the crucial ones, such as the C library.
678 </p>
679 <p>The blacklist is related to the upgrade command only, consists in installing
680 a package instead of updating it or removing previous versions of it;
681 the content of the package will be updated over the existing content at
682 &lsquo;<samp>${packagedir}</samp>&rsquo;, while the existing links from
683 &lsquo;<samp>${targetdir}</samp>&rsquo; will be preserved. A pruning of links will be
684 carried out in order to re-link possible differences with the recent
685 content, this helps to avoid leaving dead links in the target directory.
686 </p>
687 <p>Package names for the blacklist to be declared must be set from the
688 configuration file.
689 </p>
691 <hr>
692 <a name="Recipes"></a>
693 <div class="header">
695 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>
696 </div>
697 <a name="Recipes-1"></a>
698 <h2 class="chapter">5 Recipes</h2>
699 <a name="index-recipes"></a>
701 <p>A recipe is a file telling qi what to do. Most often, the recipe tells
702 qi how to build a binary package from a source tarball.
703 </p>
704 <p>A recipe has two parts: a list of variable definitions and a list of
705 sections. By convention, the syntax of a section is:
706 </p>
707 <div class="example">
708 <pre class="example">section_name()
710 section lines
712 </pre></div>
714 <p>The section name is followed by parentheses, one newline and an opening
715 brace. The line finishing the section contains just a closing brace.
716 The section names or the function names currently recognized are
717 &lsquo;<samp>build</samp>&rsquo;.
718 </p>
719 <p>The &lsquo;<samp>build</samp>&rsquo; section (or <strong>shell function</strong>) is an augmented
720 shell script that contains the main instructions for building a software
721 source.
722 </p>
723 <a name="Variables"></a>
724 <h3 class="section">5.1 Variables</h3>
725 <a name="index-variables"></a>
727 <p>A &quot;variable&quot; is a <strong>shell variable</strong> defined either in <samp>qirc</samp>
728 or in a recipe to represent a string of text, called the variable&rsquo;s
729 &quot;value&quot;. These values are substituted by explicit request in the
730 definitions of other variables or in calls to external commands.
731 </p>
732 <p>Variables can represent lists of file names, options to pass to
733 compilers, programs to run, directories to look in for source files,
734 directories to write output to, or anything else you can imagine.
735 </p>
736 <p>Definitions of variables in qi have four levels of precedence.
737 Options which define variables from the command-line override those
738 specified in the <samp>qirc</samp> file, while variables defined in the recipe
739 override those specified in <samp>qirc</samp>, taking priority over those
740 variables set by command-line options. Finally, the variables have
741 default values if they are not defined anywhere.
742 </p>
743 <p>Options that set variables through the command-line can only reference
744 variables defined in <samp>qirc</samp> and variables with default values.
745 </p>
746 <p>Definitions of variables in <samp>qirc</samp> can only reference variables
747 previously defined in <samp>qirc</samp> and variables with default values.
748 </p>
749 <p>Definitions of variables in the recipe can only reference variables
750 set by the command-line, variables previously defined in the recipe,
751 variables defined in <samp>qirc</samp>, and variables with default values.
752 </p>
753 <a name="Special-variables"></a>
754 <h3 class="section">5.2 Special variables</h3>
755 <a name="index-special-variables"></a>
757 <p>There are variables which can only be set using the command line options or
758 via <samp>qirc</samp>, there are other special variables which can be defined or
759 redefined in a recipe. See the following definitions:
760 </p>
761 <p>&lsquo;<samp>outdir</samp>&rsquo; is the directory where the packages produced are written.
762 This variable can be redefined per-recipe. Default sets to
763 &lsquo;<samp>/var/cache/qi/packages</samp>&rsquo;.
764 </p>
765 <p>&lsquo;<samp>worktree</samp>&rsquo; is the working tree where archives, patches, and recipes
766 are expected. This variable can not be redefined in the recipe. Default
767 sets to &lsquo;<samp>/usr/src/qi</samp>&rsquo;.
768 </p>
769 <p>&lsquo;<samp>tardir</samp>&rsquo; is defined in the recipe to the directory where the tarball
770 containing the source can be found. The full name of the tarball is
771 composed as &lsquo;<samp>${tardir}/$tarname</samp>&rsquo;. Its value is available in the
772 recipe as &lsquo;<samp>${tardir}</samp>&rsquo;; a value of . for &lsquo;<samp>tardir</samp>&rsquo; sets it to
773 the value of CWD (Current Working Directory), this is where the recipe
774 lives.
775 </p>
776 <p>&lsquo;<samp>arch</samp>&rsquo; is the architecture to compose the package name. Its value is
777 available in the recipe as &lsquo;<samp>${arch}</samp>&rsquo;. Default value is the one
778 that was set in the Qi configuration.
779 </p>
780 <p>&lsquo;<samp>jobs</samp>&rsquo; is the number of parallel jobs to pass to the compiler. Its
781 value is available in the recipe as &lsquo;<samp>${jobs}</samp>&rsquo;. The default value
782 is 1.
783 </p>
784 <p>The two variables &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; can be
785 set in the recipe, as any other variable, but if they are not, qi uses
786 default values for them when building a package.
787 </p>
788 <p>&lsquo;<samp>srcdir</samp>&rsquo; contains the source code to be compiled, and defaults to
789 &lsquo;<samp>${program}-${version}</samp>&rsquo;. &lsquo;<samp>destdir</samp>&rsquo; is the place where the
790 built package will be installed, and defaults to
791 &lsquo;<samp>${TMPDIR}/package-${program}</samp>&rsquo;.
792 </p>
793 <p>If &lsquo;<samp>pkgname</samp>&rsquo; is left undefined, the special variable &lsquo;<samp>program</samp>&rsquo;
794 is assigned by default. If &lsquo;<samp>pkgversion</samp>&rsquo; is left undefined, the
795 special variable &lsquo;<samp>version</samp>&rsquo; is assigned by default.
796 </p>
797 <p>&lsquo;<samp>pkgname</samp>&rsquo; and &lsquo;<samp>pkgversion</samp>&rsquo; along with: &lsquo;<samp>version</samp>&rsquo;, &lsquo;<samp>arch</samp>&rsquo;,
798 &lsquo;<samp>release</samp>&rsquo;, and (optionally) &lsquo;<samp>pkgcategory</samp>&rsquo; are used to produce the
799 package name in the form:
800 &lsquo;<samp>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}].tlz</samp>&rsquo;
801 </p>
802 <p>&lsquo;<samp>pkgcategory</samp>&rsquo; is an optional special variable that can be defined on the
803 recipe to categorize the package name. If it is defined, then the
804 package output will be composed as
805 &lsquo;<samp>${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}.tlz</samp>&rsquo;.
806 Automatically, the value of &lsquo;<samp>pkgcategory</samp>&rsquo; will be prefixed using the
807 &lsquo;<samp>@</samp>&rsquo; (at) symbol which will be added to the last part of the package name.
808 </p>
809 <p>A special variable called &lsquo;<samp>replace</samp>&rsquo; can be used to declare package names
810 that will be replaced at installation time.
811 </p>
812 <p>The special variables &lsquo;<samp>keep_srcdir</samp>&rsquo; and &lsquo;<samp>keep_destdir</samp>&rsquo; are provided
813 in order to preserve the directories &lsquo;<samp>${srcdir}</samp>&rsquo; or &lsquo;<samp>${destdir}</samp>&rsquo;,
814 if those exists as such. Note: The declaration of these variables are subject
815 to manual deactivation; its purpose in recipes is to preserve the directories
816 that relate to the package&rsquo;s build (source) and destination directory, that is
817 so that another recipe can get a new package (or meta package) from there. For
818 example, the declarations can be done as:
819 </p>
820 <div class="example">
821 <pre class="example">keep_srcdir=keep_srcdir
822 keep_destdir=keep_destdir
823 </pre></div>
825 <p>Then from another recipe you would proceed to copy the necessary files that
826 will compose the meta package, from the main function you must deactivate
827 the variables at the end:
828 </p>
829 <div class="example">
830 <pre class="example">unset keep_srcdir
831 unset keep_destdir
832 </pre></div>
834 <p>This will leave the &rsquo;keep_srcdir&rsquo; and &rsquo;keep_destdir&rsquo; variables blank to
835 continue with the rest of the recipes.
836 </p>
837 <p>A typical recipe contains the following variables:
838 </p>
839 <ul>
840 <li> &lsquo;<samp>program</samp>&rsquo;: Software name.
842 <p>It matches the source name. It is also used to compose the name of the
843 package if &lsquo;<samp>${pkgname}</samp>&rsquo; is not specified.
844 </p>
845 </li><li> &lsquo;<samp>version</samp>&rsquo;: Software version.
847 <p>It matches the source name. It is also used to compose the version of the
848 package if &lsquo;<samp>${pkgversion}</samp>&rsquo; is not specified.
849 </p>
850 </li><li> &lsquo;<samp>arch</samp>&rsquo;: Software architecture.
852 <p>It is used to compose the architecture of the package in which it is
853 build.
854 </p>
855 </li><li> &lsquo;<samp>release</samp>&rsquo;: Release number.
857 <p>This is used to reflect the release number of the package. It is
858 recommended to increase this number after any significant change in
859 the recipe or post-install script.
860 </p>
861 </li><li> &lsquo;<samp>pkgcategory</samp>&rsquo;: Package category.
863 <p>Optional but recommended variable to categorize the package name when it is
864 created.
865 </p></li></ul>
867 <p>Obtaining sources over the network must be declared in the recipe using
868 the &lsquo;<samp>fetch</samp>&rsquo; variable.
869 </p>
870 <p>The variables &lsquo;<samp>netget</samp>&rsquo; and &lsquo;<samp>rsync</samp>&rsquo; can be defined in <samp>qirc</samp>
871 to establish a network downloader in order to get the sources. If they
872 are not defined, qi uses default values:
873 </p>
874 <p>&lsquo;<samp>netget</samp>&rsquo; is the general network downloader tool, defaults sets to
875 &lsquo;<samp>wget -c -w1 -t3 --no-check-certificate</samp>&rsquo;.
876 </p>
877 <p>&lsquo;<samp>rsync</samp>&rsquo; is the network tool for sources containing the prefix for
878 the RSYNC protocol, default sets to
879 &lsquo;<samp>rsync -v -a -L -z -i --progress</samp>&rsquo;.
880 </p>
881 <p>The variable &lsquo;<samp>description</samp>&rsquo; is used to print the package description
882 when a package is installed.
883 </p>
884 <p>A description has two parts: a brief description, and a long description.
885 By convention, the syntax of &lsquo;<samp>description</samp>&rsquo; is:
886 </p>
887 <div class="example">
888 <pre class="example">description=&quot;
889 Brief description.
891 Long description.
892 &quot;
893 </pre></div>
895 <p>The first line of the value represented is a brief description of the
896 software (called &quot;blurb&quot;). A blank line separates the <em>brief
897 description</em> from the <em>long description</em>, which should contain a more
898 descriptive description of the software.
899 </p>
900 <p>An example looks like:
901 </p>
902 <div class="example">
903 <pre class="example">description=&quot;
904 The GNU core utilities.
906 The GNU core utilities are the basic file, shell and text manipulation
907 utilities of the GNU operating system. These are the core utilities
908 which are expected to exist on every operating system.
909 &quot;
910 </pre></div>
912 <p>Please consider a length limit of 78 characters as maximum, because the same
913 one would be used on the meta file creation. See
914 <a href="#Recipes">The meta file</a> section.
915 </p>
916 <p>The &lsquo;<samp>homepage</samp>&rsquo; variable is used to declare the main site or home page:
917 </p>
918 <div class="example">
919 <pre class="example">homepage=http://www.gnu.org/software/gcc
920 </pre></div>
922 <p>The variable &lsquo;<samp>license</samp>&rsquo; is used for license information<a name="DOCF3" href="#FOOT3"><sup>3</sup></a>.
923 Some code in the program can be covered by license A, license B, or
924 license C. For &quot;separate licensing&quot; or &quot;heterogeneous licensing&quot;, we
925 suggest using <strong>|</strong> for a disjunction, <strong>&amp;</strong> for a conjunction
926 (if that ever happens in a significant way), and comma for heterogeneous
927 licensing. Comma would have lower precedence, plus added special terms.
928 </p>
929 <div class="example">
930 <pre class="example">license=&quot;LGPL, GPL | Artistic - added permission&quot;
931 </pre></div>
933 <a name="Writing-recipes"></a>
934 <h3 class="section">5.3 Writing recipes</h3>
935 <a name="index-writing-recipes"></a>
937 <p>Originally, Qi was designed for the version 3 of Dragora GNU/Linux; this
938 doesn&rsquo;t mean you can&rsquo;t use it in another distribution, just that if you do,
939 you&rsquo;ll have to try it out for yourself. To help with this, here are some
940 references to well-written recipes:
941 </p>
942 <ul>
943 <li> <a href="http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes</a>
944 </li><li> <a href="http://notabug.org/dragora/dragora/src/master/recipes">http://notabug.org/dragora/dragora/src/master/recipes</a>
945 </li></ul>
947 <a name="Building-packages"></a>
948 <h3 class="section">5.4 Building packages</h3>
949 <a name="index-package-build"></a>
951 <p>A recipe is any valid regular file. Qi sets priorities for reading a
952 recipe, the order in which qi looks for a recipe is:
953 </p>
954 <ol>
955 <li> Current working directory.
957 </li><li> If the specified path name does not contain &quot;recipe&quot; as the last
958 component. Qi will complete it by adding &quot;recipe&quot; to the path name.
960 </li><li> If the recipe is not in the current working directory, it will be
961 searched under &lsquo;<samp>${worktree}/recipes</samp>&rsquo;. The last component will be
962 completed adding &quot;recipe&quot; to the specified path name.
963 </li></ol>
965 <p>To build a single package, type:
966 </p>
967 <div class="example">
968 <pre class="example">qi build x-apps/xterm
969 </pre></div>
971 <p>Multiple jobs can be passed to the compiler to speed up the build process:
972 </p>
973 <div class="example">
974 <pre class="example">qi build --jobs 3 x-apps/xterm
975 </pre></div>
977 <p>Update or install the produced package (if not already installed) when the
978 build command ends:
979 </p>
980 <div class="example">
981 <pre class="example">qi build -j3 --upgrade x-apps/xterm
982 </pre></div>
984 <p>Only process a recipe but do not create the binary package:
985 </p>
986 <div class="example">
987 <pre class="example">qi build --no-package dict/aspell
988 </pre></div>
990 <p>The options &ndash;install or &ndash;upgrade have no effect when &ndash;no-package
991 is given.
992 </p>
993 <p>This can be useful to inspect the build process of recipe:
994 </p>
995 <p>qi build &ndash;keep &ndash;no-package dict/aspell 2&gt;&amp;1 | tee aspell-log.txt
996 </p>
997 <p>The &ndash;keep option could preserve the source directory and the destination
998 directory for later inspection. A log file of the build process will be
999 created redirecting both, standard error and standard output to tee(1).
1000 </p>
1001 <a name="Variables-from-the-environment"></a>
1002 <h3 class="section">5.5 Variables from the environment</h3>
1003 <a name="index-environment-variables"></a>
1005 <p>Qi has environment variables which can be used at build time:
1006 </p>
1007 <p>The variable <code>TMPDIR</code> sets the temporary directory for sources, which is
1008 used for package extractions (see <a href="#Examining-packages">Examining packages</a>) and is
1009 prepended to the value of &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; in
1010 build command. By convention its default value is equal to
1011 &lsquo;<samp>/usr/src/qi/build</samp>&rsquo;.
1012 </p>
1013 <p>The variables <code>QICFLAGS</code>, <code>QICXXFLAGS</code>, and <code>QILDFLAGS</code> have
1014 no effect by default. The environment variables such as <code>CFLAGS</code>,
1015 <code>CXXFLAGS</code>, and <code>LDFLAGS</code> are unset at compile time:
1016 </p>
1017 <p>Recommended practice is to set variables in the command line of
1018 &lsquo;<samp>configure</samp>&rsquo; or <em>make(1)</em> instead of exporting to the
1019 environment. As follows:
1020 </p>
1021 <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>
1022 </p><blockquote>
1023 <p>It is not wise for makefiles to depend for their functioning on environment
1024 variables set up outside their control, since this would cause different
1025 users to get different results from the same makefile. This is against the
1026 whole purpose of most makefiles.
1027 </p></blockquote>
1029 <p>Setting environment variables for configure is deprecated because running
1030 configure in varying environments can be dangerous.
1031 </p>
1032 <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>
1033 </p><blockquote>
1034 <p>Variables not defined in a site shell script can be set in the environment
1035 passed to configure. However, some packages may run configure again
1036 during the build, and the customized values of these variables may be
1037 lost. In order to avoid this problem, you should set them in the
1038 configure command line, using &lsquo;<samp>VAR=value</samp>&rsquo;. For example:
1039 </p>
1040 <p><code>./configure CC=/usr/local2/bin/gcc</code>
1041 </p></blockquote>
1043 <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>
1044 </p><blockquote>
1045 <p>If for instance the user runs &lsquo;<samp>CC=bizarre-cc ./configure</samp>&rsquo;, then the cache,
1046 config.h, and many other output files depend upon bizarre-cc being the C
1047 compiler. If for some reason the user runs ./configure again, or if it is
1048 run via &lsquo;<samp>./config.status --recheck</samp>&rsquo;, (See Automatic Remaking, and see
1049 config.status Invocation), then the configuration can be inconsistent,
1050 composed of results depending upon two different compilers.
1051 [...]
1052 Indeed, while configure can notice the definition of CC in &lsquo;<samp>./configure
1053 CC=bizarre-cc</samp>&rsquo;, it is impossible to notice it in &lsquo;<samp>CC=bizarre-cc
1054 ./configure</samp>&rsquo;, which, unfortunately, is what most users do.
1055 [...]
1056 configure: error: changes in the environment can compromise the build.
1057 </p></blockquote>
1059 <a name="The-meta-file"></a>
1060 <h3 class="section">5.6 The meta file</h3>
1061 <a name="index-the-meta-file"></a>
1063 <p>The &quot;meta file&quot; is a regular file created during the build command, it
1064 contains information about the package such as package name, package
1065 version, architecture, release, fetch address, description, and other
1066 minor data extracted from processed recipes. The name of the file is
1067 generated as &lsquo;<samp>${full_pkgname}.tlz.txt</samp>&rsquo;, and its purpose is to
1068 reflect essential information to the user without having to look inside
1069 the package content. The file format is also intended to be used by
1070 other scripts or by common Unix tools.
1071 </p>
1072 <p>The content of a meta file looks like:
1073 </p>
1074 <div class="example">
1075 <pre class="example">#
1076 # Pattern scanning and processing language.
1078 # The awk utility interprets a special-purpose programming language
1079 # that makes it possible to handle simple data-reformatting jobs
1080 # with just a few lines of code. It is a free version of 'awk'.
1082 # GNU awk implements the AWK utility which is part of
1083 # IEEE Std 1003.1 Shell and Utilities (XCU).
1086 QICFLAGS=&quot;-g0 -Os&quot;
1087 QICXXFLAGS=&quot;-g0 -Os&quot;
1088 QILDFLAGS=&quot;-s&quot;
1089 pkgname=gawk
1090 pkgversion=5.0.1
1091 arch=amd64
1092 release=1
1093 pkgcategory=&quot;tools&quot;
1094 full_pkgname=gawk_5.0.1_amd64-1@tools
1095 blurb=&quot;Pattern scanning and processing language.&quot;
1096 homepage=&quot;http://www.gnu.org/software/gawk&quot;
1097 license=&quot;GPLv3+&quot;
1098 fetch=&quot;http://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz&quot;
1099 replace=&quot;&quot;
1100 </pre></div>
1102 <p>Package descriptions are extracted from the variable &lsquo;<samp>description</samp>&rsquo;
1103 where each line is interpreted literally and pre-formatted to fit in
1104 (exactly) <strong>80 columns</strong>, plus the character &lsquo;<samp>#</samp>&rsquo; and a blank
1105 space is prefixed to every line (shell comments).
1106 </p>
1107 <p>In addition to the Special variables, there are implicit variables such as
1108 &lsquo;<samp>blurb</samp>&rsquo;:
1109 </p>
1110 <p>The &lsquo;<samp>blurb</samp>&rsquo; variable is related to the special variable
1111 &lsquo;<samp>description</samp>&rsquo;. Its value is made from the first (substantial)
1112 line of &lsquo;<samp>description</samp>&rsquo;, mentioned as the &quot;brief description&quot;.
1113 </p>
1115 <hr>
1116 <a name="Order-files"></a>
1117 <div class="header">
1119 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>
1120 </div>
1121 <a name="Order-files-1"></a>
1122 <h2 class="chapter">6 Order files</h2>
1123 <a name="index-handling-build-order"></a>
1125 <p>The order command has the purpose of resolving the build order through
1126 .order files. An order file contains a list of recipe names, by default
1127 does not perform any action other than to print a resolved list in
1128 descending order. For example, if <strong>a</strong> depends on <strong>b</strong> and
1129 <strong>c</strong>, and <strong>c</strong> depends on <strong>b</strong> as well, the file might
1130 look like:
1131 </p>
1132 <div class="example">
1133 <pre class="example">a: c b
1135 c: b
1136 </pre></div>
1138 <p>Each letter represents a recipe name, complete dependencies for
1139 the first recipe name are listed in descending order, which is
1140 printed from right to left, and removed from left to right:
1141 </p>
1142 <p><small>OUTPUT</small>
1143 </p>
1144 <div class="example">
1145 <pre class="example">b
1148 </pre></div>
1150 <p>Blank lines, colons and parentheses are simply ignored. Comment lines
1151 beginning with &lsquo;<samp>#</samp>&rsquo; are allowed.
1152 </p>
1153 <p>An order file could be used to build a series of packages, for example,
1154 if the content is:
1155 </p>
1156 <div class="example">
1157 <pre class="example"># Image handling libraries
1159 libs/libjpeg-turbo: devel/nasm
1160 x-libs/jasper: libs/libjpeg-turbo
1161 libs/tiff: libs/libjpeg-turbo
1162 </pre></div>
1164 <p>To proceed with each recipe, we can type:
1165 </p>
1166 <div class="example">
1167 <pre class="example">qi order imglibs.order | qi build --install -
1168 </pre></div>
1170 <p>The output of &lsquo;<samp>qi order imglibs.order</samp>&rsquo; tells to qi in which order it
1171 should build the recipes:
1172 </p>
1173 <div class="example">
1174 <pre class="example">devel/nasm
1175 libs/libjpeg-turbo
1176 x-libs/jasper
1177 libs/tiff
1178 </pre></div>
1181 <hr>
1182 <a name="Creating-packages"></a>
1183 <div class="header">
1185 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>
1186 </div>
1187 <a name="Creating-packages-1"></a>
1188 <h2 class="chapter">7 Creating packages</h2>
1189 <a name="index-package-creation"></a>
1191 <p>The creation command is an internal function of qi to make new Qi
1192 compatible packages. A package is produced using the contents of
1193 the Current Working Directory and the package file is written out.
1194 </p>
1195 <div class="example">
1196 <pre class="example">Usage: qi create [<var>Output/PackageName.tlz</var>]...
1197 </pre></div>
1199 <p>The argument for the file name to be written must contain a fully
1200 qualified named directory as the output directory where the package
1201 produced will be written. The file name should be composed using the
1202 full name: name-version-architecture-release[@pkgcategory].tlz
1203 </p>
1204 <p><small>EXAMPLE</small>
1205 </p>
1206 <div class="example">
1207 <pre class="example">cd /usr/pkg
1208 cd claws-mail_3.17.1_amd64-1@x-apps
1209 qi create /var/cache/qi/packages/claws-mail_3.17.1_amd64-1@x-apps
1210 </pre></div>
1212 <p>In this case, the package &quot;claws-mail_3.17.1_amd64-1@x-apps&quot; will be
1213 written into &lsquo;<samp>/var/cache/qi/packages/</samp>&rsquo;.
1214 </p>
1215 <p>All packages produced are complemented by a checksum file (.sha256).
1216 </p>
1218 <hr>
1219 <a name="Examining-packages"></a>
1220 <div class="header">
1222 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>
1223 </div>
1224 <a name="Examining-packages-1"></a>
1225 <h2 class="chapter">8 Examining packages</h2>
1226 <a name="index-package-examination"></a>
1228 <p>The extraction command serves to examine binary packages for debugging
1229 purposes. It decompresses a package into a single directory, verifying
1230 its integrity and preserving all of it properties (owner and permission).
1231 </p>
1232 <div class="example">
1233 <pre class="example">Usage: qi extract [<var>packagename.tlz</var>]...
1234 </pre></div>
1236 <p><small>EXAMPLE</small>
1237 </p>
1238 <div class="example">
1239 <pre class="example">qi extract mksh_R56c_amd64-1@shells.tlz
1240 </pre></div>
1242 <p>This action will put the content of &quot;mksh_R56c_amd64-1@shells.tlz&quot; into a
1243 single directory, this is a private directory for the user who requested
1244 the action, creation operation will be equal to <strong>u=rwx,g=,o= (0700)</strong>.
1245 The package content will reside on this location, default mask to deploy
1246 the content will be equal to <strong>u=rwx,g=rwx,o=rwx (0000)</strong>.
1247 </p>
1248 <p>Note: the creation of the custom directory is influenced by the value
1249 of the <code>TMPDIR</code> variable.
1250 </p>
1252 <hr>
1253 <a name="Exit-status"></a>
1254 <div class="header">
1256 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>
1257 </div>
1258 <a name="Exit-status-1"></a>
1259 <h2 class="chapter">9 Exit status</h2>
1260 <a name="index-exit-codes"></a>
1262 <p>All the exit codes are described in this chapter.
1263 </p>
1264 <dl compact="compact">
1265 <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
1266 <dd><p>Successful completion (no errors).
1267 </p>
1268 </dd>
1269 <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
1270 <dd><p>Minor common errors:
1271 </p>
1272 <ul>
1273 <li> Help usage on illegal options or required arguments.
1275 </li><li> Program needed by qi (prerequisite) is not available.
1276 </li></ul>
1278 </dd>
1279 <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
1280 <dd><p>Command execution error:
1281 </p>
1282 <p>This code is used to return the evaluation of an external command or shell
1283 arguments in case of failure.
1284 </p>
1285 </dd>
1286 <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
1287 <dd><p>Integrity check error for compressed files.
1288 </p>
1289 <p>Compressed files means:
1290 </p>
1291 <ul>
1292 <li> A tarball file from tar(1).
1293 Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
1294 .tar.xz, .txz
1296 </li><li> A tarball file from tarlz(1).
1297 Supported extensions: .tar.lz, .tlz
1299 </li><li> Zip files from unzip(1).
1300 Supported extensions: .zip, .ZIP
1302 </li><li> Gzip files from gzip(1).
1303 Supported extensions: .gz, .Z
1305 </li><li> Bzip2 files from bzip2(1).
1306 Supported extension: .bz2
1308 </li><li> Lzip files from lzip(1).
1309 Supported extension: .lz
1311 </li><li> Xz files from xz(1).
1312 Supported extension: .xz
1313 </li></ul>
1315 </dd>
1316 <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
1317 <dd><p>File empty, not regular, or expected.
1318 </p>
1319 <p>It&rsquo;s commonly expected:
1320 </p>
1321 <ul>
1322 <li> An argument for giving commands.
1324 </li><li> A regular file or readable directory.
1326 </li><li> An expected extension: .tlz, .sha256, .order.
1328 </li><li> A protocol supported by the network downloader tool.
1329 </li></ul>
1331 </dd>
1332 <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
1333 <dd><p>Empty or not defined variable:
1334 </p>
1335 <p>This code is used to report empty or undefined variables (usually
1336 variables coming from a recipe or assigned arrays that are tested).
1337 </p>
1338 </dd>
1339 <dt>&lsquo;<samp>6</samp>&rsquo;</dt>
1340 <dd><p>Package already installed:
1341 </p>
1342 <p>The package directory for an incoming .tlz package already exists.
1343 </p>
1344 </dd>
1345 <dt>&lsquo;<samp>10</samp>&rsquo;</dt>
1346 <dd><p>Network manager error:
1347 </p>
1348 <p>This code is used if the network downloader tool fails for some reason.
1349 </p></dd>
1350 </dl>
1353 <hr>
1354 <a name="Index"></a>
1355 <div class="header">
1357 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>
1358 </div>
1359 <a name="Index-1"></a>
1360 <h2 class="unnumbered">Index</h2>
1362 <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
1363 &nbsp;
1364 <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
1365 &nbsp;
1366 <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
1367 &nbsp;
1368 <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
1369 &nbsp;
1370 <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
1371 &nbsp;
1372 <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
1373 &nbsp;
1374 <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
1375 &nbsp;
1376 <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
1377 &nbsp;
1378 <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
1379 &nbsp;
1380 <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
1381 &nbsp;
1382 <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
1383 &nbsp;
1384 </td></tr></table>
1385 <table class="index-cp" border="0">
1386 <tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
1387 <tr><td colspan="4"> <hr></td></tr>
1388 <tr><th><a name="Index_cp_letter-C">C</a></th><td></td><td></td></tr>
1389 <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>
1390 <tr><td colspan="4"> <hr></td></tr>
1391 <tr><th><a name="Index_cp_letter-E">E</a></th><td></td><td></td></tr>
1392 <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>
1393 <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>
1394 <tr><td colspan="4"> <hr></td></tr>
1395 <tr><th><a name="Index_cp_letter-H">H</a></th><td></td><td></td></tr>
1396 <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>
1397 <tr><td colspan="4"> <hr></td></tr>
1398 <tr><th><a name="Index_cp_letter-I">I</a></th><td></td><td></td></tr>
1399 <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>
1400 <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>
1401 <tr><td colspan="4"> <hr></td></tr>
1402 <tr><th><a name="Index_cp_letter-M">M</a></th><td></td><td></td></tr>
1403 <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>
1404 <tr><td colspan="4"> <hr></td></tr>
1405 <tr><th><a name="Index_cp_letter-P">P</a></th><td></td><td></td></tr>
1406 <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>
1407 <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>
1408 <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>
1409 <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>
1410 <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>
1411 <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>
1412 <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>
1413 <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>
1414 <tr><td colspan="4"> <hr></td></tr>
1415 <tr><th><a name="Index_cp_letter-R">R</a></th><td></td><td></td></tr>
1416 <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>
1417 <tr><td colspan="4"> <hr></td></tr>
1418 <tr><th><a name="Index_cp_letter-S">S</a></th><td></td><td></td></tr>
1419 <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>
1420 <tr><td colspan="4"> <hr></td></tr>
1421 <tr><th><a name="Index_cp_letter-T">T</a></th><td></td><td></td></tr>
1422 <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>
1423 <tr><td colspan="4"> <hr></td></tr>
1424 <tr><th><a name="Index_cp_letter-V">V</a></th><td></td><td></td></tr>
1425 <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>
1426 <tr><td colspan="4"> <hr></td></tr>
1427 <tr><th><a name="Index_cp_letter-W">W</a></th><td></td><td></td></tr>
1428 <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>
1429 <tr><td colspan="4"> <hr></td></tr>
1430 </table>
1431 <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
1432 &nbsp;
1433 <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
1434 &nbsp;
1435 <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
1436 &nbsp;
1437 <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
1438 &nbsp;
1439 <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
1440 &nbsp;
1441 <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
1442 &nbsp;
1443 <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
1444 &nbsp;
1445 <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
1446 &nbsp;
1447 <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
1448 &nbsp;
1449 <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
1450 &nbsp;
1451 <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
1452 &nbsp;
1453 </td></tr></table>
1455 <div class="footnote">
1456 <hr>
1457 <h4 class="footnotes-heading">Footnotes</h4>
1459 <h3><a name="FOOT1" href="#DOCF1">(1)</a></h3>
1460 <p>For more details about tarlz and the
1461 lzip format, visit <a href="https://lzip.nongnu.org/tarlz.html">https://lzip.nongnu.org/tarlz.html</a>.</p>
1462 <h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
1463 <p>The official guide for Graft can be found at
1464 <a href="http://peters.gormand.com.au/Home/tools/graft/graft.html">http://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>
1465 <h3><a name="FOOT3" href="#DOCF3">(3)</a></h3>
1466 <p>The proposal for &lsquo;<samp>license</samp>&rsquo; was made by Richard M. Stallman at
1467 <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>
1468 </div>
1469 <hr>
1473 </body>
1474 </html>