recipes: compressors/xz: Upgraded to version 5.6.2
[dragora.git] / qi / doc / qi.html
blob711214fe774a139f5abc702c11937ce894b25a9e
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <!-- Copyright (C) 2019-2024 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, no Front-Cover Texts, and no Back-Cover Texts. -->
13 <title>Qi user guide</title>
15 <meta name="description" content="Qi user guide">
16 <meta name="keywords" content="Qi user guide">
17 <meta name="resource-type" content="document">
18 <meta name="distribution" content="global">
19 <meta name="Generator" content="makeinfo">
20 <meta name="viewport" content="width=device-width,initial-scale=1">
22 <link href="#Top" rel="start" title="Top">
23 <link href="#Index" rel="index" title="Index">
24 <link href="#Introduction-to-Qi" rel="next" title="Introduction to Qi">
25 <style type="text/css">
26 <!--
27 a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
28 a.summary-letter {text-decoration: none}
29 blockquote.indentedblock {margin-right: 0em}
30 div.display {margin-left: 3.2em}
31 div.example {margin-left: 3.2em}
32 kbd {font-style: oblique}
33 pre.display {font-family: inherit}
34 pre.format {font-family: inherit}
35 pre.menu-comment {font-family: serif}
36 pre.menu-preformatted {font-family: serif}
37 span.nolinebreak {white-space: nowrap}
38 span.roman {font-family: initial; font-weight: normal}
39 span.sansserif {font-family: sans-serif; font-weight: normal}
40 span:hover a.copiable-anchor {visibility: visible}
41 ul.no-bullet {list-style: none}
42 -->
43 </style>
46 </head>
48 <body lang="en">
49 <h1 class="settitle" align="center">Qi user guide</h1>
55 <div class="top" id="Top">
56 <div class="header">
57 <p>
58 Next: <a href="#Introduction-to-Qi" accesskey="n" rel="next">Introduction to Qi</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
59 </div>
60 <span id="SEC_Top"></span>
61 <p>This user guide is for Qi (version 2.12,
62 04 Apr 2024).
63 </p>
65 <br>
66 <p>Copyright &copy; 2019-2024 Matias Andres Fonzo, Santiago del Estero,
67 Argentina.
68 </p>
69 <p>Permission is granted to copy, distribute and/or modify this document
70 under the terms of the GNU Free Documentation License, Version 1.3 or
71 any later version published by the Free Software Foundation; with no
72 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
73 </p>
75 <ul class="section-toc">
76 <li><a href="#Introduction-to-Qi" accesskey="1">Introduction to Qi</a></li>
77 <li><a href="#Invoking-qi" accesskey="2">Invoking qi</a></li>
78 <li><a href="#The-qirc-file" accesskey="3">The qirc file</a></li>
79 <li><a href="#Packages" accesskey="4">Packages</a></li>
80 <li><a href="#Recipes" accesskey="5">Recipes</a></li>
81 <li><a href="#Order-files" accesskey="6">Order files</a></li>
82 <li><a href="#Creating-packages" accesskey="7">Creating packages</a></li>
83 <li><a href="#Examining-packages" accesskey="8">Examining packages</a></li>
84 <li><a href="#Qi-exit-status" accesskey="9">Qi exit status</a></li>
85 <li><a href="#Index">Index</a></li>
86 </ul>
87 <hr>
88 <div class="chapter" id="Introduction-to-Qi">
89 <div class="header">
90 <p>
91 Next: <a href="#Invoking-qi" accesskey="n" rel="next">Invoking qi</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
92 </div>
93 <span id="Introduction-to-Qi-1"></span><h2 class="chapter">1 Introduction to Qi</h2>
94 <span id="index-introduction-to-qi"></span>
96 <p>Qi is a simple but well-integrated package manager. It can create,
97 install, remove, and upgrade software packages. Qi produces binary
98 packages using recipes, which are files containing specific instructions
99 to build each package from source. Qi can manage multiple packages
100 under a single directory hierarchy. This method allows to maintain a set
101 of packages and multiple versions of them. This means that Qi could be
102 used as the main package manager or complement the existing one.
103 </p>
104 <p>Qi offers a friendly command line interface, a global configuration
105 file, a simple recipe layout to deploy software packages; also works
106 with binary packages in parallel, speeding up installations and packages
107 in production. The format used for packages is a simplified and safer
108 variant of POSIX pax archive compressed in lzip format.
109 </p>
110 <p>Qi is a modern (POSIX-compliant) shell script released under the
111 terms of the GNU General Public License. There are only two major
112 dependencies for the magic: graft(1) and tarlz(1), the rest is expected
113 to be found in any Unix-like system.
114 </p>
115 <hr>
116 </div>
117 <div class="chapter" id="Invoking-qi">
118 <div class="header">
120 Next: <a href="#The-qirc-file" accesskey="n" rel="next">The qirc file</a>, Previous: <a href="#Introduction-to-Qi" accesskey="p" rel="prev">Introduction to Qi</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
121 </div>
122 <span id="Invoking-qi-1"></span><h2 class="chapter">2 Invoking qi</h2>
123 <span id="index-invocation"></span>
125 <p>This chapter describes the synopsis for invoking Qi.
126 </p>
127 <div class="example">
128 <pre class="example">Usage: qi COMMAND [<var>OPTION</var>...] [<var>FILE</var>]...
129 </pre></div>
131 <p>One mandatory command specifies the operation that &lsquo;<samp>qi</samp>&rsquo; should
132 perform, options are meant to detail how this operation should be
133 performed during or after the process.
134 </p>
135 <p>Qi supports the following commands:
136 </p>
137 <dl compact="compact">
138 <dt><span><code>warn</code></span></dt>
139 <dd><p>Warn about files that will be installed.
140 </p>
141 </dd>
142 <dt><span><code>install</code></span></dt>
143 <dd><p>Install packages.
144 </p>
145 </dd>
146 <dt><span><code>remove</code></span></dt>
147 <dd><p>Remove packages.
148 </p>
149 </dd>
150 <dt><span><code>upgrade</code></span></dt>
151 <dd><p>Upgrade packages.
152 </p>
153 </dd>
154 <dt><span><code>extract</code></span></dt>
155 <dd><p>Extract packages for debugging purposes.
156 </p>
157 </dd>
158 <dt><span><code>create</code></span></dt>
159 <dd><p>Create a .tlz package from directory.
160 </p>
161 </dd>
162 <dt><span><code>build</code></span></dt>
163 <dd><p>Build packages using recipe names.
164 </p>
165 </dd>
166 <dt><span><code>order</code></span></dt>
167 <dd><p>Resolve build order through .order files
168 </p></dd>
169 </dl>
171 <p>Options when installing, removing, or upgrading software packages:
172 </p>
173 <dl compact="compact">
174 <dt><span><code>-f</code></span></dt>
175 <dt><span><code>--force</code></span></dt>
176 <dd><p>Force upgrade of pre-existing packages.
177 </p>
178 </dd>
179 <dt><span><code>-k</code></span></dt>
180 <dt><span><code>--keep</code></span></dt>
181 <dd><p>Keep directories when build/remove/upgrade.
182 </p>
183 <p>Keep (don&rsquo;t delete) the package directory when using remove/upgrade command.
184 </p>
185 <p>This will also try to preserve the directories &lsquo;<samp>${srcdir}</samp>&rsquo; and
186 &lsquo;<samp>${destdir}</samp>&rsquo; when using build command. Its effect is available in
187 recipes as &lsquo;<samp>${keep_srcdir}</samp>&rsquo; and &lsquo;<samp>${keep_destdir}</samp>&rsquo;. See
188 <a href="#Recipes">Special variables</a> for details.
189 </p>
190 </dd>
191 <dt><span><code>-p</code></span></dt>
192 <dt><span><code>--prune</code></span></dt>
193 <dd><p>Prune conflicts.
194 </p>
195 </dd>
196 <dt><span><code>-P</code></span></dt>
197 <dt><span><code>--packagedir=&lt;dir&gt;</code></span></dt>
198 <dd><p>Set directory for package installations.
199 </p>
200 </dd>
201 <dt><span><code>-t</code></span></dt>
202 <dt><span><code>--targetdir=&lt;dir&gt;</code></span></dt>
203 <dd><p>Set target directory for symbolic links.
204 </p>
205 </dd>
206 <dt><span><code>-r</code></span></dt>
207 <dt><span><code>--rootdir=&lt;dir&gt;</code></span></dt>
208 <dd><p>Use the fully qualified named directory as the root directory for all qi
209 operations.
210 </p>
211 <p>Note: the target directory and the package directory will be
212 relative to the specified directory, excepting the graft log file.
213 </p></dd>
214 </dl>
216 <p>Options when building software packages using recipes:
217 </p>
218 <dl compact="compact">
219 <dt><span><code>-a</code></span></dt>
220 <dt><span><code>--architecture</code></span></dt>
221 <dd><p>Set architecture name for the package.
222 </p>
223 </dd>
224 <dt><span><code>-j</code></span></dt>
225 <dt><span><code>--jobs</code></span></dt>
226 <dd><p>Parallel jobs for the compiler.
227 </p>
228 <p>This option sets the variable &lsquo;<samp>${jobs}</samp>&rsquo;. If not specified, default
229 sets to 1.
230 </p>
231 </dd>
232 <dt><span><code>-S</code></span></dt>
233 <dt><span><code>--skip-questions</code></span></dt>
234 <dd><p>Skip questions on completed recipes.
235 </p>
236 </dd>
237 <dt><span><code>-1</code></span></dt>
238 <dt><span><code>--increment</code></span></dt>
239 <dd><p>Increment release number (&lsquo;<samp>${release}</samp>&rsquo; + 1).
240 </p>
241 <p>The effect of this option will be omitted if &ndash;no-package is being used.
242 </p>
243 </dd>
244 <dt><span><code>-n</code></span></dt>
245 <dt><span><code>--no-package</code></span></dt>
246 <dd><p>Do not create a .tlz package.
247 </p>
248 </dd>
249 <dt><span><code>-i</code></span></dt>
250 <dt><span><code>--install</code></span></dt>
251 <dd><p>Install package after the build.
252 </p>
253 </dd>
254 <dt><span><code>-u</code></span></dt>
255 <dt><span><code>--upgrade</code></span></dt>
256 <dd><p>Upgrade package after the build.
257 </p>
258 </dd>
259 <dt><span><code>-o</code></span></dt>
260 <dt><span><code>--outdir=&lt;dir&gt;</code></span></dt>
261 <dd><p>Where the packages produced will be written.
262 </p>
263 <p>This option sets the variable &lsquo;<samp>${outdir}</samp>&rsquo;.
264 </p>
265 </dd>
266 <dt><span><code>-w</code></span></dt>
267 <dt><span><code>--worktree=&lt;dir&gt;</code></span></dt>
268 <dd><p>Where archives, patches, recipes are expected.
269 </p>
270 <p>This option sets the variable &lsquo;<samp>${worktree}</samp>&rsquo;.
271 </p>
272 </dd>
273 <dt><span><code>-s</code></span></dt>
274 <dt><span><code>--sourcedir=&lt;dir&gt;</code></span></dt>
275 <dd><p>Where compressed sources will be found.
276 </p>
277 <p>This option sets the variable &lsquo;<samp>${tardir}</samp>&rsquo;.
278 </p></dd>
279 </dl>
281 <p>Other options:
282 </p>
283 <dl compact="compact">
284 <dt><span><code>-v</code></span></dt>
285 <dt><span><code>--verbose</code></span></dt>
286 <dd><p>Be verbose (an extra -v gives more).
287 </p>
288 <p>It sets the verbosity level, default sets to 0.
289 </p>
290 <p>The value 1 is used for more verbosity while the value 2 is too detailed.
291 Although at the moment it is limited to graft(1) verbosity.
292 </p>
293 </dd>
294 <dt><span><code>-N</code></span></dt>
295 <dt><span><code>--no-rc</code></span></dt>
296 <dd><p>Do not read the configuration file.
297 </p>
298 <p>This will ignore reading the qirc file.
299 </p>
300 </dd>
301 <dt><span><code>-L</code></span></dt>
302 <dt><span><code>--show-location</code></span></dt>
303 <dd><p>Print default directory locations and exit.
304 </p>
305 <p>This will print the target directory, package directory, working tree,
306 the directory for sources, and the output directory for the packages
307 produced. The output will appear on STDOUT as follows:
308 </p>
309 <div class="example">
310 <pre class="example">QI_TARGETDIR=/usr/local
311 QI_PACKAGEDIR=/usr/local/pkgs
312 QI_WORKTREE=/usr/src/qi
313 QI_TARDIR=/usr/src/qi/sources
314 QI_OUTDIR=/var/cache/qi/packages
315 </pre></div>
317 <p>You can set these environment variables using one of the following methods:
318 </p>
319 <p><code>eval &quot;$(qi -L)&quot;</code>
320 </p>
321 <p>This will display the default locations taking into account the values set
322 from the qirc configuration file. You can deny the influence of the
323 configuration file by setting the option &lsquo;<samp>-N</samp>&rsquo;.
324 </p>
325 <p><code>eval &quot;$(qi -N -L)&quot;</code>
326 </p>
327 <p>Or you can adjust the new locations using the command-line options, e.g:
328 </p>
329 <p><code>eval &quot;$(qi -N --targetdir=/directory -L)&quot;</code>
330 </p>
331 </dd>
332 <dt><span><code>-h</code></span></dt>
333 <dt><span><code>--help</code></span></dt>
334 <dd><p>Display the usage and exit.
335 </p>
336 </dd>
337 <dt><span><code>-V</code></span></dt>
338 <dt><span><code>--version</code></span></dt>
339 <dd>
340 <p>This will print the (short) version information and then exit.
341 </p>
342 <p>The same can be achieved if Qi is invoked as &lsquo;<samp>qi version</samp>&rsquo;.
343 </p></dd>
344 </dl>
346 <p>When FILE is -, qi can read from the standard input. See examples from
347 the <a href="#Packages">Packages</a> section.
348 </p>
349 <p>Exit status: 0 for a normal exit, 1 for minor common errors (help usage,
350 support not available, etc), 2 to indicate a command execution error;
351 3 for integrity check error on compressed files, 4 for empty, not
352 regular, or expected files, 5 for empty or not defined variables,
353 6 when a package already exist, 10 for network manager errors.
354 For more details, see the <a href="#Qi-exit-status">Qi exit status</a> section.
355 </p>
357 <hr>
358 </div>
359 <div class="chapter" id="The-qirc-file">
360 <div class="header">
362 Next: <a href="#Packages" accesskey="n" rel="next">Packages</a>, Previous: <a href="#Invoking-qi" accesskey="p" rel="prev">Invoking qi</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
363 </div>
364 <span id="The-qirc-file-1"></span><h2 class="chapter">3 The qirc file</h2>
365 <span id="index-configuration-file"></span>
367 <p>The global <samp>qirc</samp> file offers a way to define variables and tools
368 (such as a download manager) for default use. This file is used by qi
369 at runtime, e.g., to build, install, remove or upgrade packages.
370 </p>
371 <p>Variables and their possible values must be declared as any other
372 variable in the shell.
373 </p>
374 <p>The command line options related to the package directory and target
375 directory and some of the command line options used for the build command,
376 have the power to override the values declared on <samp>qirc</samp>.
377 See <a href="#Invoking-qi">Invoking qi</a>.
378 </p>
379 <p>The order in which qi looks for this file is:
380 </p>
381 <ol>
382 <li> <code>${HOME}/.qirc</code>
383 Effective user.
385 </li><li> &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo;
386 System-wide.
387 </li></ol>
389 <p>If you intend to run qi as effective user, the file
390 &lsquo;<samp>${sysconfdir}/qirc</samp>&rsquo; could be copied to <code>${HOME}/.qirc</code>
391 setting the paths for &lsquo;<samp>${packagedir}</samp>&rsquo; and &lsquo;<samp>${targetdir}</samp>&rsquo;
392 according to the <code>$HOME</code>.
393 </p>
395 <hr>
396 </div>
397 <div class="chapter" id="Packages">
398 <div class="header">
400 Next: <a href="#Recipes" accesskey="n" rel="next">Recipes</a>, Previous: <a href="#The-qirc-file" accesskey="p" rel="prev">The qirc file</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
401 </div>
402 <span id="Packages-1"></span><h2 class="chapter">4 Packages</h2>
403 <span id="index-managing-packages"></span>
405 <p>A package is a suite of programs usually distributed in binary form
406 which may also contain manual pages, documentation, or any other file
407 associated to a specific software.
408 </p>
409 <p>The package format used by qi is a simplified POSIX pax archive
410 compressed using lzip<a id="DOCF1" href="#FOOT1"><sup>1</sup></a>. The
411 file extension for packages ends in &lsquo;<samp>.tlz</samp>&rsquo;.
412 </p>
413 <p>Both package installation and package de-installation are managed using
414 two important (internal) variables: &lsquo;<samp>${packagedir}</samp>&rsquo; and
415 &lsquo;<samp>${targetdir}</samp>&rsquo;, these values can be changed in the
416 configuration file or via options.
417 </p>
418 <p>&lsquo;<samp>${packagedir}</samp>&rsquo; is a common directory tree where the package
419 contents will be decompressed (will reside).
420 </p>
421 <p>&lsquo;<samp>${targetdir}</samp>&rsquo; is a target directory where the links will be
422 made by graft(1) taking &lsquo;<samp>${packagedir}/package_name</samp>&rsquo; into account.
423 </p>
424 <p>Packages are installed in self-contained directory trees and symbolic
425 links from a common area are made to the package files. This allows
426 multiple versions of the same package to coexist on the same system.
427 </p>
428 <ul class="section-toc">
429 <li><a href="#Package-conflicts" accesskey="1">Package conflicts</a></li>
430 <li><a href="#Installing-packages" accesskey="2">Installing packages</a></li>
431 <li><a href="#Removing-packages" accesskey="3">Removing packages</a></li>
432 <li><a href="#Upgrading-packages" accesskey="4">Upgrading packages</a></li>
433 </ul>
434 <div class="section" id="Package-conflicts">
435 <h3 class="section">4.1 Package conflicts</h3>
436 <span id="index-package-conflicts"></span>
438 <p>All the links to install or remove a package are handled by graft(1).
439 Since multiple packages can be installed or removed at the same time,
440 certain conflicts may arise between the packages.
441 </p>
442 <p>graft<a id="DOCF2" href="#FOOT2"><sup>2</sup></a>
443 defines a CONFLICT as one of the following conditions:
444 </p>
445 <ul>
446 <li> If the package object is a directory and the target object exists but is
447 not a directory.
449 </li><li> If the package object is not a directory and the target object exists
450 and is not a symbolic link.
452 </li><li> If the package object is not a directory and the target object exists
453 and is a symbolic link to something other than the package object.
454 </li></ul>
456 <p>The default behavior of qi for an incoming package is to ABORT if a
457 conflict arises. When a package is going to be deleted, qi tells to
458 graft(1) to remove those parts that are not in conflict, leaving the
459 links to the belonging package. This behavior can be forced if the
460 &ndash;prune option is given.
461 </p>
462 </div>
463 <div class="section" id="Installing-packages">
464 <h3 class="section">4.2 Installing packages</h3>
465 <span id="index-package-installation"></span>
467 <p>To install a single package, simply type:
468 </p>
469 <div class="example">
470 <pre class="example">qi install coreutils_8.30_i586-1@tools.tlz
471 </pre></div>
473 <p>To install multiple packages at once, type:
474 </p>
475 <div class="example">
476 <pre class="example">qi install gcc_8.3.0_i586-1@devel.tlz rafaela_2.2_i586-1@legacy.tlz ...
477 </pre></div>
479 <p>Warn about the files that will be linked:
480 </p>
481 <div class="example">
482 <pre class="example">qi warn bash_5.0_i586-1@shells.tlz
483 </pre></div>
485 <p>This is to verify the content of a package before installing it.
486 </p>
487 <p>See the process of an installation:
488 </p>
489 <div class="example">
490 <pre class="example">qi install --verbose mariana_3.0_i586-1@woman.tlz
491 </pre></div>
493 <p>A second &ndash;verbose or -v option gives more (very verbose).
494 </p>
495 <p>Installing package in a different location:
496 </p>
497 <div class="example">
498 <pre class="example">qi install --rootdir=/media/floppy lzip_1.21_i586-1@compressors.tlz
499 </pre></div>
501 <p>Important: the &ndash;rootdir option assumes &lsquo;<samp>${targetdir}</samp>&rsquo; and
502 &lsquo;<samp>${packagedir}</samp>&rsquo;. See the following example:
503 </p>
504 <div class="example">
505 <pre class="example">qi install --rootdir=/home/selk lzip_1.21_i586-1@compressors.tlz
506 </pre></div>
508 <p>The content of &quot;lzip_1.21_i586-1@compressors.tlz&quot; will be decompressed
509 into &lsquo;<samp>/home/selk/pkgs/lzip_1.21_i586-1@compressors</samp>&rsquo;.
510 Assuming that the main binary for lzip is under
511 &lsquo;<samp>/home/selk/pkgs/lzip_1.21_i586-1@compressors/usr/bin/</samp>&rsquo;
512 the target for &quot;usr/bin&quot; will be created at &lsquo;<samp>/home/selk</samp>&rsquo;. Considering
513 that you have exported the <code>PATH</code> as &lsquo;<samp>${HOME}/usr/bin</samp>&rsquo;, now the
514 system is able to see the recent lzip command.
515 </p>
516 <p>Installing from a list of packages using standard input:
517 </p>
518 <div class="example">
519 <pre class="example">qi install - &lt; PACKAGELIST.txt
520 </pre></div>
522 <p>Or in combination with another tool:
523 </p><div class="example">
524 <pre class="example">sort -u PACKAGELIST.txt | qi install -
525 </pre></div>
527 <p>The sort command will read and sorts the list of declared packages,
528 while trying to have unique entries for each statement. The output
529 produced is captured by Qi to install each package.
530 </p>
531 <p>An example of a list containing package names is:
532 </p><div class="example">
533 <pre class="example">/var/cache/qi/packages/amd64/tcl_8.6.9_amd64-1@devel.tlz
534 /var/cache/qi/packages/amd64/tk_8.6.9.1_amd64-1@devel.tlz
535 /var/cache/qi/packages/amd64/vala_0.42.3_amd64-1@devel.tlz
536 </pre></div>
538 </div>
539 <div class="section" id="Removing-packages">
540 <h3 class="section">4.3 Removing packages</h3>
541 <span id="index-package-de_002dinstallation"></span>
543 <p>To remove a package, simply type:
544 </p>
545 <div class="example">
546 <pre class="example">qi remove xz_5.2.4_i586-1@compressors.tlz
547 </pre></div>
549 <p>Remove command will match the package name using &lsquo;<samp>${packagedir}</samp>&rsquo; as
550 prefix. For example, if the value of &lsquo;<samp>${packagedir}</samp>&rsquo; has been
551 set to /usr/pkg, this will be equal to:
552 </p>
553 <div class="example">
554 <pre class="example">qi remove /usr/pkg/xz_5.2.4_i586-1@compressors
555 </pre></div>
557 <p>Detailed output:
558 </p>
559 <div class="example">
560 <pre class="example">qi remove --verbose /usr/pkg/xz_5.2.4_i586-1@compressors
561 </pre></div>
563 <p>A second &ndash;verbose or -v option gives more (very verbose).
564 </p>
565 <p>By default the remove command does not preserve a package directory after
566 removing its links from &lsquo;<samp>${targetdir}</samp>&rsquo;, but this behavior can be
567 changed if the &ndash;keep option is passed:
568 </p>
569 <div class="example">
570 <pre class="example">qi remove --keep /usr/pkg/lzip_1.21_i586-1@compressors
571 </pre></div>
573 <p>This means that the links to the package can be reactivated, later:
574 </p>
575 <div class="example">
576 <pre class="example">cd /usr/pkg &amp;&amp; graft -i lzip_1.21_i586-1@compressors
577 </pre></div>
579 <p>Removing package from a different location:
580 </p>
581 <div class="example">
582 <pre class="example">qi remove --rootdir=/home/cthulhu xz_5.2.4_i586-1@compressors
583 </pre></div>
585 <p>Removing a package using standard input:
586 </p>
587 <div class="example">
588 <pre class="example">echo vala_0.42.3_amd64-1@devel | qi remove -
589 </pre></div>
591 <p>This will match with the package directory.
592 </p>
593 </div>
594 <div class="section" id="Upgrading-packages">
595 <h3 class="section">4.4 Upgrading packages</h3>
596 <span id="index-package-upgrade"></span>
598 <p>The upgrade command inherits the properties of the installation and removal
599 process. To make sure that a package is updated, the package is installed
600 in a temporary directory taking &lsquo;<samp>${packagedir}</samp>&rsquo; into account. Once
601 the incoming package is pre-installed, qi can proceed to search and delete
602 packages that have the same name (considered as previous ones). Finally,
603 the package is re-installed at its final location and the temporary
604 directory is removed.
605 </p>
606 <p>Since updating a package can be crucial and so to perform a successful
607 upgrade, from start to finish, you will want to ignore some important
608 system signals during the upgrade process, those signals are SIGHUP,
609 SIGINT, SIGQUIT, SIGABRT, and SIGTERM.
610 </p>
611 <p>To upgrade a package, just type:
612 </p>
613 <div class="example">
614 <pre class="example">qi upgrade gcc_9.0.1_i586-1@devel.tlz
615 </pre></div>
617 <p>This will proceed to upgrade &quot;gcc_9.0.1_i586-1@devel&quot; removing any other
618 version of &quot;gcc&quot; (if any).
619 </p>
620 <p>If you want to keep the package directories of versions found during the
621 upgrade process, just pass:
622 </p>
623 <div class="example">
624 <pre class="example">qi upgrade --keep gcc_9.0.1_i586-1@devel.tlz
625 </pre></div>
627 <p>To see the upgrade process:
628 </p>
629 <div class="example">
630 <pre class="example">qi upgrade --verbose gcc_9.0.1_i586-1@devel.tlz
631 </pre></div>
633 <p>A second &ndash;verbose or -v option gives more (very verbose).
634 </p>
635 <p>To force the upgrade of an existing package:
636 </p>
637 <div class="example">
638 <pre class="example">qi upgrade --force gcc_9.0.1_i586-1@devel.tlz
639 </pre></div>
641 <ul class="section-toc">
642 <li><a href="#Package-blacklist" accesskey="1">Package blacklist</a></li>
643 </ul>
644 <div class="subsection" id="Package-blacklist">
645 <h4 class="subsection">4.4.1 Package blacklist</h4>
646 <span id="index-package-blacklist"></span>
648 <p>To implement general package facilities, either to install, remove or
649 maintain the hierarchy of packages in a clean manner, qi makes use of the
650 pruning operation via graft(1) by default:
651 </p>
652 <p>There is a risk if those are crucial packages for the proper functioning
653 of the system, because it implies the deactivation of symbolic from the
654 target directory, <em>especially</em> when transitioning an incoming package
655 into its final location during an upgrade.
656 </p>
657 <p>A blacklist of package names has been devised for the case where
658 a user decides to upgrade all the packages in the system, or
659 just the crucial ones, such as the C library.
660 </p>
661 <p>The blacklist is related to the upgrade command only, consists in installing
662 a package instead of updating it or removing previous versions of it;
663 the content of the package will be updated over the existing content at
664 &lsquo;<samp>${packagedir}</samp>&rsquo;, while the existing links from
665 &lsquo;<samp>${targetdir}</samp>&rsquo; will be preserved. A pruning of links will be
666 carried out in order to re-link possible differences with the recent
667 content, this helps to avoid leaving dead links in the target directory.
668 </p>
669 <p>Package names for the blacklist to be declared must be set from the
670 configuration file. By default, it is declared using the package name,
671 which is more than enough for critical system packages, but if you want to
672 be more specific, you can declare a package using:
673 &lsquo;<samp>${pkgname}_${pkgversion}_${arch}-${release}</samp>&rsquo; where
674 the package category is avoided for common matching. See
675 <a href="#Recipes">Special variables</a> for a description of these variables.
676 </p>
677 <hr>
678 </div>
679 </div>
680 </div>
681 <div class="chapter" id="Recipes">
682 <div class="header">
684 Next: <a href="#Order-files" accesskey="n" rel="next">Order files</a>, Previous: <a href="#Packages" accesskey="p" rel="prev">Packages</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
685 </div>
686 <span id="Recipes-1"></span><h2 class="chapter">5 Recipes</h2>
687 <span id="index-recipes"></span>
689 <p>A recipe is a file telling qi what to do. Most often, the recipe tells
690 qi how to build a binary package from a source tarball.
691 </p>
692 <p>A recipe has two parts: a list of variable definitions and a list of
693 sections. By convention, the syntax of a section is:
694 </p>
695 <div class="example">
696 <pre class="example">section_name()
698 section lines
700 </pre></div>
702 <p>The section name is followed by parentheses, one newline and an opening
703 brace. The line finishing the section contains just a closing brace.
704 The section names or the function names currently recognized are
705 &lsquo;<samp>build</samp>&rsquo;.
706 </p>
707 <p>The &lsquo;<samp>build</samp>&rsquo; section (or <strong>shell function</strong>) is an augmented
708 shell script that contains the main instructions to build software
709 from source.
710 </p>
711 <p>If there are other functions defined by the packager, Qi detects them
712 for later execution.
713 </p>
714 <ul class="section-toc">
715 <li><a href="#Variables" accesskey="1">Variables</a></li>
716 <li><a href="#Special-variables" accesskey="2">Special variables</a></li>
717 <li><a href="#Writing-recipes" accesskey="3">Writing recipes</a></li>
718 <li><a href="#Building-packages" accesskey="4">Building packages</a></li>
719 <li><a href="#Variables-from-the-environment" accesskey="5">Variables from the environment</a></li>
720 <li><a href="#The-meta-file" accesskey="6">The meta file</a></li>
721 </ul>
722 <div class="section" id="Variables">
723 <h3 class="section">5.1 Variables</h3>
724 <span id="index-variables"></span>
726 <p>A &quot;variable&quot; is a <strong>shell variable</strong> defined either in <samp>qirc</samp>
727 or in a recipe to represent a string of text, called the variable&rsquo;s
728 &quot;value&quot;. These values are substituted by explicit request in the
729 definitions of other variables or in calls to external commands.
730 </p>
731 <p>Variables can represent lists of file names, options to pass to
732 compilers, programs to run, directories to look in for source files,
733 directories to write output to, or anything else you can imagine.
734 </p>
735 <p>Definitions of variables in qi have four levels of precedence.
736 Options which define variables from the command-line override those
737 specified in the <samp>qirc</samp> file, while variables defined in the recipe
738 override those specified in <samp>qirc</samp>, taking priority over those
739 variables set by command-line options. Finally, the variables have
740 default values if they are not defined anywhere.
741 </p>
742 <p>Options that set variables through the command-line can only reference
743 variables defined in <samp>qirc</samp> and variables with default values.
744 </p>
745 <p>Definitions of variables in <samp>qirc</samp> can only reference variables
746 previously defined in <samp>qirc</samp> and variables with default values.
747 </p>
748 <p>Definitions of variables in the recipe can only reference variables
749 set by the command-line, variables previously defined in the recipe,
750 variables defined in <samp>qirc</samp>, and variables with default values.
751 </p>
752 </div>
753 <div class="section" id="Special-variables">
754 <h3 class="section">5.2 Special variables</h3>
755 <span id="index-special-variables"></span>
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 -v keep_srcdir keep_destdir
831 </pre></div>
833 <p>This will leave the &rsquo;keep_srcdir&rsquo; and &rsquo;keep_destdir&rsquo; variables blank to
834 continue with the rest of the recipes.
835 </p>
836 <p>The special variable &lsquo;<samp>opt_skiprecipe</samp>&rsquo; is available when you need to
837 ignore a recipe cleanly, continuing with the next recipe. May you add a
838 conditional test then set it as &lsquo;<samp>opt_skiprecipe=opt_skiprecipe</samp>&rsquo;.
839 </p>
840 <p>The variable &lsquo;<samp>tarlz_compression_options</samp>&rsquo; can be used to change the
841 default compression options in tarlz(1), default sets to &lsquo;<samp>-9 --solid</samp>&rsquo;.
842 For example if the variable is declared as:
843 </p>
844 <div class="example">
845 <pre class="example">tarlz_compression_options=&quot;-0 --bsolid&quot;
846 </pre></div>
848 <p>It will change the granularity of tarlz(1) by using the &lsquo;<samp>--bsolid</samp>&rsquo;
849 option <a id="DOCF3" href="#FOOT3"><sup>3</sup></a>,
850 as well as increasing the compression speed by lowering the compression
851 level with &lsquo;<samp>-0</samp>&rsquo;.
852 </p>
853 <p>This is only recommended for recipes where testing, or faster processing is
854 desired to create the packaged file more quickly. It is not recommended for
855 production or general distribution of binary packages.
856 </p>
857 <p>A typical recipe contains the following variables:
858 </p>
859 <ul>
860 <li> &lsquo;<samp>program</samp>&rsquo;: Software name.
862 <p>It matches the source name. It is also used to compose the name of the
863 package if &lsquo;<samp>${pkgname}</samp>&rsquo; is not specified.
864 </p>
865 </li><li> &lsquo;<samp>version</samp>&rsquo;: Software version.
867 <p>It matches the source name. It is also used to compose the version of the
868 package if &lsquo;<samp>${pkgversion}</samp>&rsquo; is not specified.
869 </p>
870 </li><li> &lsquo;<samp>arch</samp>&rsquo;: Software architecture.
872 <p>It is used to compose the architecture of the package in which it is
873 build.
874 </p>
875 </li><li> &lsquo;<samp>release</samp>&rsquo;: Release number.
877 <p>This is used to reflect the release number of the package. It is
878 recommended to increase this number after any significant change in
879 the recipe or post-install script.
880 </p>
881 </li><li> &lsquo;<samp>pkgcategory</samp>&rsquo;: Package category.
883 <p>Optional but recommended variable to categorize the package name when it is
884 created.
885 </p></li></ul>
887 <p>Obtaining sources over the network must be declared in the recipe using
888 the &lsquo;<samp>fetch</samp>&rsquo; variable.
889 </p>
890 <p>The variables &lsquo;<samp>netget</samp>&rsquo; and &lsquo;<samp>rsync</samp>&rsquo; can be defined in <samp>qirc</samp>
891 to establish a network downloader in order to get the sources. If they
892 are not defined, qi uses default values:
893 </p>
894 <p>&lsquo;<samp>netget</samp>&rsquo; is the general network downloader tool, defaults sets to
895 &lsquo;<samp>wget2 -c -w1 -t3 --no-check-certificate</samp>&rsquo;.
896 </p>
897 <p>&lsquo;<samp>rsync</samp>&rsquo; is the network tool for sources containing the prefix for
898 the RSYNC protocol, default sets to
899 &lsquo;<samp>rsync -v -a -L -z -i --progress</samp>&rsquo;.
900 </p>
901 <p>The variable &lsquo;<samp>description</samp>&rsquo; is used to print the package description
902 when a package is installed.
903 </p>
904 <p>A description has two parts: a brief description, and a long description.
905 By convention, the syntax of &lsquo;<samp>description</samp>&rsquo; is:
906 </p>
907 <div class="example">
908 <pre class="example">description=&quot;
909 Brief description.
911 Long description.
912 &quot;
913 </pre></div>
915 <p>The first line of the value represented is a brief description of the
916 software (called &quot;blurb&quot;). A blank line separates the <em>brief
917 description</em> from the <em>long description</em>, which should contain a more
918 descriptive description of the software.
919 </p>
920 <p>An example looks like:
921 </p>
922 <div class="example">
923 <pre class="example">description=&quot;
924 The GNU core utilities.
926 The GNU core utilities are the basic file, shell and text manipulation
927 utilities of the GNU operating system. These are the core utilities
928 which are expected to exist on every operating system.
929 &quot;
930 </pre></div>
932 <p>Please consider a length limit of 78 characters as maximum, because the same
933 one would be used on the meta file creation. See
934 <a href="#Recipes">The meta file</a> section.
935 </p>
936 <p>The &lsquo;<samp>homepage</samp>&rsquo; variable is used to declare the main site or home page:
937 </p>
938 <div class="example">
939 <pre class="example">homepage=https://www.gnu.org/software/gcc
940 </pre></div>
942 <p>The variable &lsquo;<samp>license</samp>&rsquo; is used for license information<a id="DOCF4" href="#FOOT4"><sup>4</sup></a>.
943 Some code in the program can be covered by license A, license B, or
944 license C. For &quot;separate licensing&quot; or &quot;heterogeneous licensing&quot;, we
945 suggest using <strong>|</strong> for a disjunction, <strong>&amp;</strong> for a conjunction
946 (if that ever happens in a significant way), and comma for heterogeneous
947 licensing. Comma would have lower precedence, plus added special terms.
948 </p>
949 <div class="example">
950 <pre class="example">license=&quot;LGPL, GPL | Artistic - added permission&quot;
951 </pre></div>
953 </div>
954 <div class="section" id="Writing-recipes">
955 <h3 class="section">5.3 Writing recipes</h3>
956 <span id="index-writing-recipes"></span>
958 <p>Originally, Qi was designed for the series of Dragora GNU/Linux-Libre 3;
959 this doesn&rsquo;t mean you can&rsquo;t use it in another distribution, just that if
960 you do, you&rsquo;ll have to try it out for yourself. To help with this, here
961 are some references to well-written recipes:
962 </p>
963 <ul>
964 <li> <a href="https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes</a>
965 </li><li> <a href="https://notabug.org/dragora/dragora/src/master/recipes">https://notabug.org/dragora/dragora/src/master/recipes</a>
966 </li><li> <a href="https://notabug.org/dragora/dragora-extras/src/master/recipes">https://notabug.org/dragora/dragora-extras/src/master/recipes</a>
967 </li><li> <a href="https://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes">https://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes</a>
968 </li></ul>
970 </div>
971 <div class="section" id="Building-packages">
972 <h3 class="section">5.4 Building packages</h3>
973 <span id="index-package-build"></span>
975 <p>A recipe is any valid regular file. Qi sets priorities for reading a
976 recipe, the order in which qi looks for a recipe is:
977 </p>
978 <ol>
979 <li> Current working directory.
981 </li><li> If the specified path name does not contain &quot;recipe&quot; as the last
982 component. Qi will complete it by adding &quot;recipe&quot; to the path name.
984 </li><li> If the recipe is not in the current working directory, it will be
985 searched under &lsquo;<samp>${worktree}/recipes</samp>&rsquo;. The last component will be
986 completed adding &quot;recipe&quot; to the specified path name.
987 </li></ol>
989 <p>To build a single package, type:
990 </p>
991 <div class="example">
992 <pre class="example">qi build x-apps/xterm
993 </pre></div>
995 <p>Multiple jobs can be passed to the compiler to speed up the build process:
996 </p>
997 <div class="example">
998 <pre class="example">qi build --jobs 3 x-apps/xterm
999 </pre></div>
1001 <p>Update or install the produced package (if not already installed) when the
1002 build command ends:
1003 </p>
1004 <div class="example">
1005 <pre class="example">qi build -j3 --upgrade x-apps/xterm
1006 </pre></div>
1008 <p>Only process a recipe but do not create the binary package:
1009 </p>
1010 <div class="example">
1011 <pre class="example">qi build --no-package dict/aspell
1012 </pre></div>
1014 <p>The options &ndash;install or &ndash;upgrade have no effect when &ndash;no-package
1015 is given.
1016 </p>
1017 <p>This is useful to inspect the build process of the above recipe:
1018 </p>
1019 <p>qi build &ndash;keep &ndash;no-package dict/aspell 2&gt;&amp;1 | tee aspell-log.txt
1020 </p>
1021 <p>The &ndash;keep option could preserve the source directory and the destination
1022 directory for later inspection. A log file of the build process will be
1023 created redirecting both, standard error and standard output to tee(1).
1024 </p>
1025 </div>
1026 <div class="section" id="Variables-from-the-environment">
1027 <h3 class="section">5.5 Variables from the environment</h3>
1028 <span id="index-environment-variables"></span>
1030 <p>Qi has environment variables which can be used at build time:
1031 </p>
1032 <p>The variable <code>TMPDIR</code> sets the temporary directory for sources, which is
1033 used for package extractions (see <a href="#Examining-packages">Examining packages</a>) and is
1034 prepended to the value of &lsquo;<samp>${srcdir}</samp>&rsquo; and &lsquo;<samp>${destdir}</samp>&rsquo; in
1035 build command. By convention its default value is equal to
1036 &lsquo;<samp>/usr/src/qi/build</samp>&rsquo;.
1037 </p>
1038 <p>The variables <code>QICFLAGS</code>, <code>QICXXFLAGS</code>, <code>QILDFLAGS</code>, and
1039 <code>QICPPFLAGS</code> have no effect by default. The environment variables
1040 such as <code>CFLAGS</code>, <code>CXXFLAGS</code>, <code>LDFLAGS</code>, and <code>CPPFLAGS</code>
1041 are unset at compile time:
1042 </p>
1043 <p>Recommended practice is to set variables in the command line of
1044 &lsquo;<samp>configure</samp>&rsquo; or <em>make(1)</em> instead of exporting to the
1045 environment. As follows:
1046 </p>
1047 <p><a href="https://www.gnu.org/software/make/manual/html_node/Environment.html">https://www.gnu.org/software/make/manual/html_node/Environment.html</a>
1048 </p><blockquote>
1049 <p>It is not wise for makefiles to depend for their functioning on environment
1050 variables set up outside their control, since this would cause different
1051 users to get different results from the same makefile. This is against the
1052 whole purpose of most makefiles.
1053 </p></blockquote>
1055 <p>Setting environment variables for configure is deprecated because running
1056 configure in varying environments can be dangerous.
1057 </p>
1058 <p><a href="https://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html">https://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html</a>
1059 </p><blockquote>
1060 <p>Variables not defined in a site shell script can be set in the environment
1061 passed to configure. However, some packages may run configure again
1062 during the build, and the customized values of these variables may be
1063 lost. In order to avoid this problem, you should set them in the
1064 configure command line, using &lsquo;<samp>VAR=value</samp>&rsquo;. For example:
1065 </p>
1066 <p><code>./configure CC=/usr/local2/bin/gcc</code>
1067 </p></blockquote>
1069 <p><a href="https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html">https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html</a>
1070 </p><blockquote>
1071 <p>If for instance the user runs &lsquo;<samp>CC=bizarre-cc ./configure</samp>&rsquo;, then the cache,
1072 config.h, and many other output files depend upon bizarre-cc being the C
1073 compiler. If for some reason the user runs ./configure again, or if it is
1074 run via &lsquo;<samp>./config.status --recheck</samp>&rsquo;, (See Automatic Remaking, and see
1075 config.status Invocation), then the configuration can be inconsistent,
1076 composed of results depending upon two different compilers.
1077 [...]
1078 Indeed, while configure can notice the definition of CC in &lsquo;<samp>./configure
1079 CC=bizarre-cc</samp>&rsquo;, it is impossible to notice it in &lsquo;<samp>CC=bizarre-cc
1080 ./configure</samp>&rsquo;, which, unfortunately, is what most users do.
1081 [...]
1082 configure: error: changes in the environment can compromise the build.
1083 </p></blockquote>
1085 <p>If the <code>SOURCE_DATE_EPOCH</code> environment variable is set to a UNIX timestamp
1086 (defined as the number of seconds, excluding leap seconds, since 01 Jan 1970
1087 00:00:00 UTC.); then the given timestamp will be used to overwrite any newer
1088 timestamps on the package contents (when it is created). More information
1089 about this can be found at
1090 <a href="https://reproducible-builds.org/specs/source-date-epoch/">https://reproducible-builds.org/specs/source-date-epoch/</a>.
1091 </p>
1092 </div>
1093 <div class="section" id="The-meta-file">
1094 <h3 class="section">5.6 The meta file</h3>
1095 <span id="index-the-meta-file"></span>
1097 <p>The &quot;meta file&quot; is a regular file created during the build process, it
1098 contains information about the package such as package name, package
1099 version, architecture, release, fetch address, description, and other
1100 minor data extracted from processed recipes. The name of the file is
1101 generated as &lsquo;<samp>${full_pkgname}.tlz.txt</samp>&rsquo;, and its purpose is to
1102 reflect essential information to the user without having to look inside
1103 the package content. The file format is also intended to be used by
1104 other scripts or by common Unix tools.
1105 </p>
1106 <p>The content of a meta file looks like:
1107 </p>
1108 <div class="example">
1109 <pre class="example">#
1110 # Pattern scanning and processing language.
1112 # The awk utility interprets a special-purpose programming language
1113 # that makes it possible to handle simple data-reformatting jobs
1114 # with just a few lines of code. It is a free version of 'awk'.
1116 # GNU awk implements the AWK utility which is part of
1117 # IEEE Std 1003.1 Shell and Utilities (XCU).
1120 QICFLAGS=&quot;-O2&quot;
1121 QICXXFLAGS=&quot;-O2&quot;
1122 QILDFLAGS=&quot;&quot;
1123 QICPPFLAGS=&quot;&quot;
1124 pkgname=gawk
1125 pkgversion=5.0.1
1126 arch=amd64
1127 release=1
1128 pkgcategory=&quot;tools&quot;
1129 full_pkgname=gawk_5.0.1_amd64-1@tools
1130 blurb=&quot;Pattern scanning and processing language.&quot;
1131 homepage=&quot;https://www.gnu.org/software/gawk&quot;
1132 license=&quot;GPLv3+&quot;
1133 fetch=&quot;https://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz&quot;
1134 replace=&quot;&quot;
1135 </pre></div>
1137 <p>A package descriptions is extracted from the variable &lsquo;<samp>description</samp>&rsquo;
1138 where each line is interpreted literally and pre-formatted to fit in
1139 (exactly) <strong>80 columns</strong>, plus the character &lsquo;<samp>#</samp>&rsquo; and a blank
1140 space is prefixed to every line (shell comments).
1141 </p>
1142 <p>In addition to the Special variables, there are implicit variables such as
1143 &lsquo;<samp>blurb</samp>&rsquo;:
1144 </p>
1145 <p>The &lsquo;<samp>blurb</samp>&rsquo; variable is related to the special variable
1146 &lsquo;<samp>description</samp>&rsquo;. Its value is made from the first (substantial)
1147 line of &lsquo;<samp>description</samp>&rsquo;, mentioned as the &quot;brief description&quot;.
1148 </p>
1149 <p>The build flags such as &lsquo;<samp>QICFLAGS</samp>&rsquo;, &lsquo;<samp>QICXXFLAGS</samp>&rsquo;,
1150 &lsquo;<samp>QILDFLAGS</samp>&rsquo;, and &lsquo;<samp>QICPPFLAGS</samp>&rsquo; are only added to the meta file
1151 if the declared variable &lsquo;<samp>arch</samp>&rsquo; is not equal to the &quot;noarch&quot; value.
1152 </p>
1153 <hr>
1154 </div>
1155 </div>
1156 <div class="chapter" id="Order-files">
1157 <div class="header">
1159 Next: <a href="#Creating-packages" accesskey="n" rel="next">Creating packages</a>, Previous: <a href="#Recipes" accesskey="p" rel="prev">Recipes</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
1160 </div>
1161 <span id="Order-files-1"></span><h2 class="chapter">6 Order files</h2>
1162 <span id="index-handling-build-order"></span>
1164 <p>The order command has the purpose of resolving the build order through
1165 .order files. An order file contains a list of recipe names, by default
1166 does not perform any action other than to print a resolved list in
1167 descending order. For example, if <strong>a</strong> depends on <strong>b</strong> and
1168 <strong>c</strong>, and <strong>c</strong> depends on <strong>b</strong> as well, the file might
1169 look like:
1170 </p>
1171 <div class="example">
1172 <pre class="example">a: c b
1174 c: b
1175 </pre></div>
1177 <p>Each letter represents a recipe name, complete dependencies for
1178 the first recipe name are listed in descending order, which is
1179 printed from right to left, and removed from left to right:
1180 </p>
1181 <p><small>OUTPUT</small>
1182 </p>
1183 <div class="example">
1184 <pre class="example">b
1187 </pre></div>
1189 <p>Blank lines, colons and parentheses are simply ignored. Comment lines
1190 beginning with &lsquo;<samp>#</samp>&rsquo; are allowed.
1191 </p>
1192 <p>An order file could be used to build a series of packages, for example,
1193 if the content is:
1194 </p>
1195 <div class="example">
1196 <pre class="example"># Image handling libraries
1198 libs/libjpeg-turbo: devel/nasm
1199 x-libs/jasper: libs/libjpeg-turbo
1200 libs/tiff: libs/libjpeg-turbo
1201 </pre></div>
1203 <p>To proceed with each recipe, we can type:
1204 </p>
1205 <div class="example">
1206 <pre class="example">qi order imglibs.order | qi build --install -
1207 </pre></div>
1209 <p>The output of &lsquo;<samp>qi order imglibs.order</samp>&rsquo; tells to qi in which order it
1210 should build the recipes:
1211 </p>
1212 <div class="example">
1213 <pre class="example">devel/nasm
1214 libs/libjpeg-turbo
1215 x-libs/jasper
1216 libs/tiff
1217 </pre></div>
1220 <hr>
1221 </div>
1222 <div class="chapter" id="Creating-packages">
1223 <div class="header">
1225 Next: <a href="#Examining-packages" accesskey="n" rel="next">Examining packages</a>, Previous: <a href="#Order-files" accesskey="p" rel="prev">Order files</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
1226 </div>
1227 <span id="Creating-packages-1"></span><h2 class="chapter">7 Creating packages</h2>
1228 <span id="index-package-creation"></span>
1230 <p>The creation command is an internal function of qi to make new Qi
1231 compatible packages. A package is produced using the contents of
1232 the Current Working Directory and the package file is written out.
1233 </p>
1234 <div class="example">
1235 <pre class="example">Usage: qi create [<var>Output/PackageName.tlz</var>]...
1236 </pre></div>
1238 <p>The argument for the file name to be written must contain a fully
1239 qualified named directory as the output directory where the package
1240 produced will be written. The file name should be composed using the
1241 full name: name-version-architecture-release[@pkgcategory].tlz
1242 </p>
1243 <p><small>EXAMPLE</small>
1244 </p>
1245 <div class="example">
1246 <pre class="example">cd /usr/pkg
1247 cd claws-mail_3.17.1_amd64-1@x-apps
1248 qi create /var/cache/qi/packages/claws-mail_3.17.1_amd64-1@x-apps
1249 </pre></div>
1251 <p>In this case, the package &quot;claws-mail_3.17.1_amd64-1@x-apps&quot; will be
1252 written into &lsquo;<samp>/var/cache/qi/packages/</samp>&rsquo;.
1253 </p>
1254 <p>All packages produced are complemented by a checksum file (.sha256).
1255 </p>
1257 <hr>
1258 </div>
1259 <div class="chapter" id="Examining-packages">
1260 <div class="header">
1262 Next: <a href="#Qi-exit-status" accesskey="n" rel="next">Qi exit status</a>, Previous: <a href="#Creating-packages" accesskey="p" rel="prev">Creating packages</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
1263 </div>
1264 <span id="Examining-packages-1"></span><h2 class="chapter">8 Examining packages</h2>
1265 <span id="index-package-examination"></span>
1267 <p>The extraction command serves to examine binary packages for debugging
1268 purposes. It decompresses a package into a single directory, verifying
1269 its integrity and preserving all of its properties (owner and permissions).
1270 </p>
1271 <div class="example">
1272 <pre class="example">Usage: qi extract [<var>packagename.tlz</var>]...
1273 </pre></div>
1275 <p><small>EXAMPLE</small>
1276 </p>
1277 <div class="example">
1278 <pre class="example">qi extract mksh_R56c_amd64-1@shells.tlz
1279 </pre></div>
1281 <p>This action will put the content of &quot;mksh_R56c_amd64-1@shells.tlz&quot; into a
1282 single directory, this is a private directory for the user who requested
1283 the action, creation operation will be equal to <strong>u=rwx,g=,o= (0700)</strong>.
1284 The package content will reside on this location, default mask to deploy
1285 the content will be equal to <strong>u=rwx,g=rwx,o=rwx (0000)</strong>.
1286 </p>
1287 <p>Note: the creation of the custom directory is influenced by the value
1288 of the <code>TMPDIR</code> variable.
1289 </p>
1291 <hr>
1292 </div>
1293 <div class="chapter" id="Qi-exit-status">
1294 <div class="header">
1296 Next: <a href="#Index" accesskey="n" rel="next">Index</a>, Previous: <a href="#Examining-packages" accesskey="p" rel="prev">Examining packages</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
1297 </div>
1298 <span id="Qi-exit-status-1"></span><h2 class="chapter">9 Qi exit status</h2>
1299 <span id="index-exit-codes"></span>
1301 <p>All the exit codes are described in this chapter.
1302 </p>
1303 <dl compact="compact">
1304 <dt><span>&lsquo;<samp>0</samp>&rsquo;</span></dt>
1305 <dd><p>Successful completion (no errors).
1306 </p>
1307 </dd>
1308 <dt><span>&lsquo;<samp>1</samp>&rsquo;</span></dt>
1309 <dd><p>Minor common errors:
1310 </p>
1311 <ul>
1312 <li> Help usage on invalid options or required arguments.
1314 </li><li> Program needed by qi (prerequisite) is not available.
1315 </li></ul>
1317 </dd>
1318 <dt><span>&lsquo;<samp>2</samp>&rsquo;</span></dt>
1319 <dd><p>Command execution error:
1320 </p>
1321 <p>This code is used to return the evaluation of an external command or shell
1322 arguments in case of failure.
1323 </p>
1324 </dd>
1325 <dt><span>&lsquo;<samp>3</samp>&rsquo;</span></dt>
1326 <dd><p>Integrity check error for compressed files.
1327 </p>
1328 <p>Compressed files means:
1329 </p>
1330 <ul>
1331 <li> A tarball file from tar(1), typically handled by the GNU tar implementation.
1332 Supported extensions: .tar, .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz,
1333 .tar.xz, .txz, .tar.zst, .tzst
1335 </li><li> A tarball file from tarlz(1).
1336 Supported extensions: .tar.lz, .tlz
1338 </li><li> Zip files from unzip(1).
1339 Supported extensions: .zip, .ZIP
1341 </li><li> Gzip files from gzip(1).
1342 Supported extensions: .gz, .Z
1344 </li><li> Bzip2 files from bzip2(1).
1345 Supported extension: .bz2
1347 </li><li> Lzip files from lzip(1).
1348 Supported extension: .lz
1350 </li><li> Xz files from xz(1).
1351 Supported extension: .xz
1353 </li><li> Zstd files from zstd(1).
1354 Supported extension: .zst
1355 </li></ul>
1357 </dd>
1358 <dt><span>&lsquo;<samp>4</samp>&rsquo;</span></dt>
1359 <dd><p>File empty, not regular, or expected.
1360 </p>
1361 <p>It&rsquo;s commonly expected:
1362 </p>
1363 <ul>
1364 <li> An argument for giving commands.
1366 </li><li> A regular file or readable directory.
1368 </li><li> An expected extension: .tlz, .sha256, .order.
1370 </li><li> A protocol supported by the network downloader tool.
1371 </li></ul>
1373 </dd>
1374 <dt><span>&lsquo;<samp>5</samp>&rsquo;</span></dt>
1375 <dd><p>Empty or not defined variable:
1376 </p>
1377 <p>This code is used to report empty or undefined variables (usually
1378 variables coming from a recipe or assigned arrays that are tested).
1379 </p>
1380 </dd>
1381 <dt><span>&lsquo;<samp>6</samp>&rsquo;</span></dt>
1382 <dd><p>Package already installed:
1383 </p>
1384 <p>The package directory for an incoming .tlz package already exists.
1385 </p>
1386 </dd>
1387 <dt><span>&lsquo;<samp>10</samp>&rsquo;</span></dt>
1388 <dd><p>Network manager error:
1389 </p>
1390 <p>This code is used if the network downloader tool fails for some reason.
1391 </p></dd>
1392 </dl>
1395 <hr>
1396 </div>
1397 <div class="unnumbered" id="Index">
1398 <div class="header">
1400 Previous: <a href="#Qi-exit-status" accesskey="p" rel="prev">Qi exit status</a> &nbsp; [<a href="#Index" title="Index" rel="index">Index</a>]</p>
1401 </div>
1402 <span id="Index-1"></span><h2 class="unnumbered">Index</h2>
1404 <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
1405 &nbsp;
1406 <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
1407 &nbsp;
1408 <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
1409 &nbsp;
1410 <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
1411 &nbsp;
1412 <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
1413 &nbsp;
1414 <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
1415 &nbsp;
1416 <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
1417 &nbsp;
1418 <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
1419 &nbsp;
1420 <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
1421 &nbsp;
1422 <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
1423 &nbsp;
1424 <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
1425 &nbsp;
1426 </td></tr></table>
1427 <table class="index-cp" border="0">
1428 <tr><td></td><th align="left">Index Entry</th><td>&nbsp;</td><th align="left"> Section</th></tr>
1429 <tr><td colspan="4"> <hr></td></tr>
1430 <tr><th id="Index_cp_letter-C">C</th><td></td><td></td></tr>
1431 <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>
1432 <tr><td colspan="4"> <hr></td></tr>
1433 <tr><th id="Index_cp_letter-E">E</th><td></td><td></td></tr>
1434 <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>
1435 <tr><td></td><td valign="top"><a href="#index-exit-codes">exit codes</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Qi-exit-status">Qi exit status</a></td></tr>
1436 <tr><td colspan="4"> <hr></td></tr>
1437 <tr><th id="Index_cp_letter-H">H</th><td></td><td></td></tr>
1438 <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>
1439 <tr><td colspan="4"> <hr></td></tr>
1440 <tr><th id="Index_cp_letter-I">I</th><td></td><td></td></tr>
1441 <tr><td></td><td valign="top"><a href="#index-introduction-to-qi">introduction to qi</a>:</td><td>&nbsp;</td><td valign="top"><a href="#Introduction-to-Qi">Introduction to Qi</a></td></tr>
1442 <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>
1443 <tr><td colspan="4"> <hr></td></tr>
1444 <tr><th id="Index_cp_letter-M">M</th><td></td><td></td></tr>
1445 <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>
1446 <tr><td colspan="4"> <hr></td></tr>
1447 <tr><th id="Index_cp_letter-P">P</th><td></td><td></td></tr>
1448 <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>
1449 <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>
1450 <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>
1451 <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>
1452 <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>
1453 <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>
1454 <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>
1455 <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>
1456 <tr><td colspan="4"> <hr></td></tr>
1457 <tr><th id="Index_cp_letter-R">R</th><td></td><td></td></tr>
1458 <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>
1459 <tr><td colspan="4"> <hr></td></tr>
1460 <tr><th id="Index_cp_letter-S">S</th><td></td><td></td></tr>
1461 <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>
1462 <tr><td colspan="4"> <hr></td></tr>
1463 <tr><th id="Index_cp_letter-T">T</th><td></td><td></td></tr>
1464 <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>
1465 <tr><td colspan="4"> <hr></td></tr>
1466 <tr><th id="Index_cp_letter-V">V</th><td></td><td></td></tr>
1467 <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>
1468 <tr><td colspan="4"> <hr></td></tr>
1469 <tr><th id="Index_cp_letter-W">W</th><td></td><td></td></tr>
1470 <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>
1471 <tr><td colspan="4"> <hr></td></tr>
1472 </table>
1473 <table><tr><th valign="top">Jump to: &nbsp; </th><td><a class="summary-letter" href="#Index_cp_letter-C"><b>C</b></a>
1474 &nbsp;
1475 <a class="summary-letter" href="#Index_cp_letter-E"><b>E</b></a>
1476 &nbsp;
1477 <a class="summary-letter" href="#Index_cp_letter-H"><b>H</b></a>
1478 &nbsp;
1479 <a class="summary-letter" href="#Index_cp_letter-I"><b>I</b></a>
1480 &nbsp;
1481 <a class="summary-letter" href="#Index_cp_letter-M"><b>M</b></a>
1482 &nbsp;
1483 <a class="summary-letter" href="#Index_cp_letter-P"><b>P</b></a>
1484 &nbsp;
1485 <a class="summary-letter" href="#Index_cp_letter-R"><b>R</b></a>
1486 &nbsp;
1487 <a class="summary-letter" href="#Index_cp_letter-S"><b>S</b></a>
1488 &nbsp;
1489 <a class="summary-letter" href="#Index_cp_letter-T"><b>T</b></a>
1490 &nbsp;
1491 <a class="summary-letter" href="#Index_cp_letter-V"><b>V</b></a>
1492 &nbsp;
1493 <a class="summary-letter" href="#Index_cp_letter-W"><b>W</b></a>
1494 &nbsp;
1495 </td></tr></table>
1497 </div>
1498 </div>
1499 <div class="footnote">
1500 <hr>
1501 <h4 class="footnotes-heading">Footnotes</h4>
1503 <h5><a id="FOOT1" href="#DOCF1">(1)</a></h5>
1504 <p>For more details about tarlz and the
1505 lzip format, visit <a href="https://lzip.nongnu.org/tarlz.html">https://lzip.nongnu.org/tarlz.html</a>.</p>
1506 <h5><a id="FOOT2" href="#DOCF2">(2)</a></h5>
1507 <p>The official guide for Graft can be found at
1508 <a href="https://peters.gormand.com.au/Home/tools/graft/graft.html">https://peters.gormand.com.au/Home/tools/graft/graft.html</a>.</p>
1509 <h5><a id="FOOT3" href="#DOCF3">(3)</a></h5>
1510 <p>About the &lsquo;<samp>--bsolid</samp>&rsquo; granularity option of tarlz(1),
1511 <a href="https://www.nongnu.org/lzip/manual/tarlz_manual.html#g_t_002d_002dbsolid">https://www.nongnu.org/lzip/manual/tarlz_manual.html#g_t_002d_002dbsolid</a>.</p>
1512 <h5><a id="FOOT4" href="#DOCF4">(4)</a></h5>
1513 <p>The proposal for &lsquo;<samp>license</samp>&rsquo; was made by Richard M. Stallman at
1514 <a href="https://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html">https://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html</a>.</p>
1515 </div>
1519 </body>
1520 </html>