qi: Bump to version 2.4 (Release Candidate 5)
[dragora.git] / qi / doc / qi.info
blob3b231af701d737cb0b3a608780dc3531a8d3315a
1 This is qi.info, produced by makeinfo version 6.5 from qi-header.texi.
3 This user guide is for Qi (version 2.4-rc5, 16 Mar 2021), which is a
4 simple but well-integrated package manager.
6    Copyright © 2019-2021 Matias Andres Fonzo, Santiago del Estero,
7 Argentina.
9      Permission is granted to copy, distribute and/or modify this
10      document under the terms of the GNU Free Documentation License,
11      Version 1.3 or any later version published by the Free Software
12      Foundation; with no Invariant Sections, with no Front-Cover Texts,
13      and with no Back-Cover Texts.  A copy of the license is included in
14      the section entitled "GNU Free Documentation License".
15 INFO-DIR-SECTION Package management
16 START-INFO-DIR-ENTRY
17 * Qi: (qi).                   A user-friendly package manager.
18 END-INFO-DIR-ENTRY
20 \x1f
21 File: qi.info,  Node: Top,  Next: Introduction to Qi,  Up: (dir)
23 Qi user guide
24 *************
26 This user guide is for Qi (version 2.4-rc5, 16 Mar 2021).
28 * Menu:
30 * Introduction to Qi::        Description and features of qi
31 * Invoking qi::               Command-line options
32 * The qirc file::             Configuration file
33 * Packages::                  Managing packages
34 * Recipes::                   Building packages
35 * Order files::               Handling build order
36 * Creating packages::         Making Qi packages
37 * Examining packages::        Debugging purposes
38 * Qi exit status::            Exit codes
39 * Index::
42    Copyright (C) 2019-2021 Matias Fonzo.
44    Qi's home page can be found at <https://www.dragora.org>.
45 Send bug reports or suggestions to <dragora-users@nongnu.org>.
47 \x1f
48 File: qi.info,  Node: Introduction to Qi,  Next: Invoking qi,  Prev: Top,  Up: Top
50 1 Introduction to Qi
51 ********************
53 Qi is a simple but well-integrated package manager.  It can create,
54 install, remove, and upgrade software packages.  Qi produces binary
55 packages using recipes, which are files containing specific instructions
56 to build each package from source.  Qi can manage multiple packages
57 under a single directory hierarchy.  This method allows to maintain a
58 set of packages and multiple versions of them.  This means that Qi could
59 be used as the main package manager or complement the existing one.
61    Qi offers a friendly command line interface, a global configuration
62 file, a simple recipe layout to deploy software packages; also works
63 with binary packages in parallel, speeding up installations and packages
64 in production.  The format used for packages is a simplified but safe
65 POSIX pax archive compressed with lzip.
67    Qi is a modern (POSIX-compliant) shell script released under the
68 terms of the GNU General Public License.  There are only two major
69 dependencies for the magic: graft(1) and tarlz(1), the rest is expected
70 to be found in any Unix-like system.
72 \x1f
73 File: qi.info,  Node: Invoking qi,  Next: The qirc file,  Prev: Introduction to Qi,  Up: Top
75 2 Invoking qi
76 *************
78 This chapter describes the synopsis for invoking Qi.
80      Usage: qi COMMAND [OPTION...] [FILE]...
82 One mandatory command specifies the operation that 'qi' should perform,
83 options are meant to detail how this operation should be performed
84 during or after the process.
86 Qi supports the following commands:
88 'warn'
89      Warn about files that will be installed.
91 'install'
92      Install packages.
94 'remove'
95      Remove packages.
97 'upgrade'
98      Upgrade packages.
100 'extract'
101      Extract packages for debugging purposes.
103 'create'
104      Create a .tlz package from directory.
106 'build'
107      Build packages using recipe names.
109 'order'
110      Resolve build order through .order files
112 Options when installing, removing, or upgrading software packages:
114 '-f'
115 '--force'
116      Force upgrade of pre-existing packages.
118 '-k'
119 '--keep'
120      Keep directories when build/remove/upgrade.
122      Keep (don't delete) the package directory when using remove/upgrade
123      command.
125      This will also try to preserve the directories '${srcdir}' and
126      '${destdir}' when using build command.  Its effect is available in
127      recipes as '${keep_srcdir}' and '${keep_destdir}'.  See *note
128      Special variables: Recipes. for details.
130 '-p'
131 '--prune'
132      Prune conflicts.
134 '-P'
135 '--packagedir=<dir>'
136      Set directory for package installations.
138 '-t'
139 '--targetdir=<dir>'
140      Set target directory for symbolic links.
142 '-r'
143 '--rootdir=<dir>'
144      Use the fully qualified named directory as the root directory for
145      all qi operations.
147      Note: the target directory and the package directory will be
148      relative to the specified directory, excepting the graft log file.
150 Options when building software packages using recipes:
152 '-a'
153 '--architecture'
154      Set architecture name for the package.
156 '-j'
157 '--jobs'
158      Parallel jobs for the compiler.
160      This option sets the variable '${jobs}'.  If not specified, default
161      sets to 1.
163 '-S'
164 '--skip-questions'
165      Skip questions on completed recipes.
167 '-1'
168 '--increment'
169      Increment release number ('${release}' + 1).
171      The effect of this option will be omitted if -no-package is being
172      used.
174 '-n'
175 '--no-package'
176      Do not create a .tlz package.
178 '-i'
179 '--install'
180      Install package after the build.
182 '-u'
183 '--upgrade'
184      Upgrade package after the build.
186 '-o'
187 '--outdir=<dir>'
188      Where the packages produced will be written.
190      This option sets the variable '${outdir}'.
192 '-w'
193 '--worktree=<dir>'
194      Where archives, patches, recipes are expected.
196      This option sets the variable '${worktree}'.
198 '-s'
199 '--sourcedir=<dir>'
200      Where compressed sources will be found.
202      This option sets the variable '${tardir}'.
204 Other options:
206 '-v'
207 '--verbose'
208      Be verbose (an extra -v gives more).
210      It sets the verbosity level, default sets to 0.
212      The value 1 is used for more verbosity while the value 2 is too
213      detailed.  Although at the moment it is limited to graft(1)
214      verbosity.
216 '-N'
217 '--no-rc'
218      Do not read the configuration file.
220      This will ignore reading the qirc file.
222 '-L'
223 '--show-location'
224      Print default directory locations and exit.
226      This will print the target directory, package directory, working
227      tree, the directory for sources, and the output directory for the
228      packages produced.
230 '-h'
231 '--help'
232      Display the usage and exit.
234 '-V'
235 '--version'
237      This will print the (short) version information and then exit.
239      The same can be achieved if Qi is invoked as 'qi version'.
241    When FILE is -, qi can read from the standard input.  See examples
242 from the *note Packages:: section.
244    Exit status: 0 for a normal exit, 1 for minor common errors (help
245 usage, support not available, etc), 2 to indicate a command execution
246 error; 3 for integrity check error on compressed files, 4 for empty, not
247 regular, or expected files, 5 for empty or not defined variables, 6 when
248 a package already exist, 10 for network manager errors.  For more
249 details, see the *note Qi exit status:: section.
251 \x1f
252 File: qi.info,  Node: The qirc file,  Next: Packages,  Prev: Invoking qi,  Up: Top
254 3 The qirc file
255 ***************
257 The global 'qirc' file offers a way to define variables and tools (such
258 as a download manager) for default use.  This file is used by qi at
259 runtime, e.g., to build, install, remove or upgrade packages.
261    Variables and their possible values must be declared as any other
262 variable in the shell.
264 The command line options related to the package directory and target
265 directory and some of the command line options used for the build
266 command, have the power to override the values declared on 'qirc'.  See
267 *note Invoking qi::.
269 The order in which qi looks for this file is:
271   1. '${HOME}/.qirc' Effective user.
273   2. '${sysconfdir}/qirc' System-wide.
275    If you intend to run qi as effective user, the file
276 '${sysconfdir}/qirc' could be copied to '${HOME}/.qirc' setting the
277 paths for '${packagedir}' and '${targetdir}' according to the '$HOME'.
279 \x1f
280 File: qi.info,  Node: Packages,  Next: Recipes,  Prev: The qirc file,  Up: Top
282 4 Packages
283 **********
285 A package is a suite of programs usually distributed in binary form
286 which may also contain manual pages, documentation, or any other file
287 associated to a specific software.
289    The package format used by qi is a simplified POSIX pax archive
290 compressed using lzip(1).  The file extension for packages ends in
291 '.tlz'.
293 Both package installation and package de-installation are managed using
294 two important (internal) variables: '${packagedir}' and '${targetdir}',
295 these values can be changed in the configuration file or via options.
297    '${packagedir}' is a common directory tree where the package contents
298 will be decompressed (will reside).
300    '${targetdir}' is a target directory where the links will be made by
301 graft(1) taking '${packagedir}/package_name' into account.
303 Packages are installed in self-contained directory trees and symbolic
304 links from a common area are made to the package files.  This allows
305 multiple versions of the same package to coexist on the same system.
307 4.1 Package conflicts
308 =====================
310 All the links to install or remove a package are handled by graft(1).
311 Since multiple packages can be installed or removed at the same time,
312 certain conflicts may arise between the packages.
314 graft(2) defines a CONFLICT as one of the following conditions:
316    * If the package object is a directory and the target object exists
317      but is not a directory.
319    * If the package object is not a directory and the target object
320      exists and is not a symbolic link.
322    * If the package object is not a directory and the target object
323      exists and is a symbolic link to something other than the package
324      object.
326 The default behavior of qi for an incoming package is to ABORT if a
327 conflict arises.  When a package is going to be deleted, qi tells to
328 graft(1) to remove those parts that are not in conflict, leaving the
329 links to the belonging package.  This behavior can be forced if the
330 -prune option is given.
332 4.2 Installing packages
333 =======================
335 To install a single package, simply type:
337      qi install coreutils_8.30_i586-1@tools.tlz
339 To install multiple packages at once, type:
341      qi install gcc_8.3.0_i586-1@devel.tlz rafaela_2.2_i586-1@legacy.tlz ...
343 Warn about the files that will be linked:
345      qi warn bash_5.0_i586-1@shells.tlz
347    This is to verify the content of a package before installing it.
349 See the process of an installation:
351      qi install --verbose mariana_3.0_i586-1@woman.tlz
353    A second -verbose or -v option gives more (very verbose).
355 Installing package in a different location:
357      qi install --rootdir=/media/floppy lzip_1.21_i586-1@compressors.tlz
359    Important: the -rootdir option assumes '${targetdir}' and
360 '${packagedir}'.  See the following example:
362      qi install --rootdir=/home/selk lzip_1.21_i586-1@compressors.tlz
364    The content of "lzip_1.21_i586-1@compressors.tlz" will be
365 decompressed into '/home/selk/pkgs/lzip_1.21_i586-1@compressors'.
366 Assuming that the main binary for lzip is under
367 '/home/selk/pkgs/lzip_1.21_i586-1@compressors/usr/bin/' the target for
368 "usr/bin" will be created at '/home/selk'.  Considering that you have
369 exported the 'PATH' as '${HOME}/usr/bin', now the system is able to see
370 the recent lzip command.
372 Installing from a list of packages using standard input:
374      qi install - < PACKAGELIST.txt
376    Or in combination with another tool:
377      sort -u PACKAGELIST.txt | qi install -
379    The sort command will read and sorts the list of declared packages,
380 while trying to have unique entries for each statement.  The output
381 produced is captured by Qi to install each package.
383    An example of a list containing package names is:
384      /var/cache/qi/packages/amd64/tcl_8.6.9_amd64-1@devel.tlz
385      /var/cache/qi/packages/amd64/tk_8.6.9.1_amd64-1@devel.tlz
386      /var/cache/qi/packages/amd64/vala_0.42.3_amd64-1@devel.tlz
388 4.3 Removing packages
389 =====================
391 To remove a package, simply type:
393      qi remove xz_5.2.4_i586-1@compressors.tlz
395 Remove command will match the package name using '${packagedir}' as
396 prefix.  For example, if the value of '${packagedir}' has been set to
397 /usr/pkg, this will be equal to:
399      qi remove /usr/pkg/xz_5.2.4_i586-1@compressors
401 Detailed output:
403      qi remove --verbose /usr/pkg/xz_5.2.4_i586-1@compressors
405    A second -verbose or -v option gives more (very verbose).
407 By default the remove command does not preserve a package directory
408 after removing its links from '${targetdir}', but this behavior can be
409 changed if the -keep option is passed:
411      qi remove --keep /usr/pkg/lzip_1.21_i586-1@compressors
413    This means that the links to the package can be reactivated, later:
415      cd /usr/pkg && graft -i lzip_1.21_i586-1@compressors
417 Removing package from a different location:
419      qi remove --rootdir=/home/cthulhu xz_5.2.4_i586-1@compressors
421 Removing a package using standard input:
423      echo vala_0.42.3_amd64-1@devel | qi remove -
425    This will match with the package directory.
427 4.4 Upgrading packages
428 ======================
430 The upgrade command inherits the properties of the installation and
431 removal process.  To make sure that a package is updated, the package is
432 installed in a temporary directory taking '${packagedir}' into account.
433 Once the incoming package is pre-installed, qi can proceed to search and
434 delete packages that have the same name (considered as previous ones).
435 Finally, the package is re-installed at its final location and the
436 temporary directory is removed.
438    Since updating a package can be crucial and so to perform a
439 successful upgrade, from start to finish, you will want to ignore some
440 important system signals during the upgrade process, those signals are
441 SIGHUP, SIGINT, SIGQUIT, SIGABRT, and SIGTERM.
443 To upgrade a package, just type:
445      qi upgrade gcc_9.0.1_i586-1@devel.tlz
447    This will proceed to upgrade "gcc_9.0.1_i586-1@devel" removing any
448 other version of "gcc" (if any).
450 If you want to keep the package directories of versions found during the
451 upgrade process, just pass:
453      qi upgrade --keep gcc_9.0.1_i586-1@devel.tlz
455 To see the upgrade process:
457      qi upgrade --verbose gcc_9.0.1_i586-1@devel.tlz
459    A second -verbose or -v option gives more (very verbose).
461 To force the upgrade of an existing package:
463      qi upgrade --force gcc_9.0.1_i586-1@devel.tlz
465 4.4.1 Package blacklist
466 -----------------------
468 To implement general package facilities, either to install, remove or
469 maintain the hierarchy of packages in a clean manner, qi makes use of
470 the pruning operation via graft(1) by default:
472    There is a risk if those are crucial packages for the proper
473 functioning of the system, because it implies the deactivation of
474 symbolic from the target directory, _especially_ when transitioning an
475 incoming package into its final location during an upgrade.
477 A blacklist of package names has been devised for the case where a user
478 decides to upgrade all the packages in the system, or just the crucial
479 ones, such as the C library.
481    The blacklist is related to the upgrade command only, consists in
482 installing a package instead of updating it or removing previous
483 versions of it; the content of the package will be updated over the
484 existing content at '${packagedir}', while the existing links from
485 '${targetdir}' will be preserved.  A pruning of links will be carried
486 out in order to re-link possible differences with the recent content,
487 this helps to avoid leaving dead links in the target directory.
489 Package names for the blacklist to be declared must be set from the
490 configuration file.
492    ---------- Footnotes ----------
494    (1) For more details about tarlz and the lzip format, visit
495 <https://lzip.nongnu.org/tarlz.html>.
497    (2) The official guide for Graft can be found at
498 <http://peters.gormand.com.au/Home/tools/graft/graft.html>.
500 \x1f
501 File: qi.info,  Node: Recipes,  Next: Order files,  Prev: Packages,  Up: Top
503 5 Recipes
504 *********
506 A recipe is a file telling qi what to do.  Most often, the recipe tells
507 qi how to build a binary package from a source tarball.
509    A recipe has two parts: a list of variable definitions and a list of
510 sections.  By convention, the syntax of a section is:
512      section_name()
513      {
514          section lines
515      }
517    The section name is followed by parentheses, one newline and an
518 opening brace.  The line finishing the section contains just a closing
519 brace.  The section names or the function names currently recognized are
520 'build'.
522    The 'build' section (or *shell function*) is an augmented shell
523 script that contains the main instructions for building a software
524 source.
526 5.1 Variables
527 =============
529 A "variable" is a *shell variable* defined either in 'qirc' or in a
530 recipe to represent a string of text, called the variable's "value".
531 These values are substituted by explicit request in the definitions of
532 other variables or in calls to external commands.
534    Variables can represent lists of file names, options to pass to
535 compilers, programs to run, directories to look in for source files,
536 directories to write output to, or anything else you can imagine.
538    Definitions of variables in qi have four levels of precedence.
539 Options which define variables from the command-line override those
540 specified in the 'qirc' file, while variables defined in the recipe
541 override those specified in 'qirc', taking priority over those variables
542 set by command-line options.  Finally, the variables have default values
543 if they are not defined anywhere.
545    Options that set variables through the command-line can only
546 reference variables defined in 'qirc' and variables with default values.
548    Definitions of variables in 'qirc' can only reference variables
549 previously defined in 'qirc' and variables with default values.
551    Definitions of variables in the recipe can only reference variables
552 set by the command-line, variables previously defined in the recipe,
553 variables defined in 'qirc', and variables with default values.
555 5.2 Special variables
556 =====================
558 There are variables which can only be set using the command line options
559 or via 'qirc', there are other special variables which can be defined or
560 redefined in a recipe.  See the following definitions:
562    'outdir' is the directory where the packages produced are written.
563 This variable can be redefined per-recipe.  Default sets to
564 '/var/cache/qi/packages'.
566    'worktree' is the working tree where archives, patches, and recipes
567 are expected.  This variable can not be redefined in the recipe.
568 Default sets to '/usr/src/qi'.
570    'tardir' is defined in the recipe to the directory where the tarball
571 containing the source can be found.  The full name of the tarball is
572 composed as '${tardir}/$tarname'.  Its value is available in the recipe
573 as '${tardir}'; a value of .  for 'tardir' sets it to the value of CWD
574 (Current Working Directory), this is where the recipe lives.
576    'arch' is the architecture to compose the package name.  Its value is
577 available in the recipe as '${arch}'.  Default value is the one that was
578 set in the Qi configuration.
580    'jobs' is the number of parallel jobs to pass to the compiler.  Its
581 value is available in the recipe as '${jobs}'.  The default value is 1.
583    The two variables '${srcdir}' and '${destdir}' can be set in the
584 recipe, as any other variable, but if they are not, qi uses default
585 values for them when building a package.
587    'srcdir' contains the source code to be compiled, and defaults to
588 '${program}-${version}'.  'destdir' is the place where the built package
589 will be installed, and defaults to '${TMPDIR}/package-${program}'.
591    If 'pkgname' is left undefined, the special variable 'program' is
592 assigned by default.  If 'pkgversion' is left undefined, the special
593 variable 'version' is assigned by default.
595    'pkgname' and 'pkgversion' along with: 'version', 'arch', 'release',
596 and (optionally) 'pkgcategory' are used to produce the package name in
597 the form:
598 '${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}].tlz'
600    'pkgcategory' is an optional special variable that can be defined on
601 the recipe to categorize the package name.  If it is defined, then the
602 package output will be composed as
603 '${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}.tlz'.
604 Automatically, the value of 'pkgcategory' will be prefixed using the '@'
605 (at) symbol which will be added to the last part of the package name.
607    A special variable called 'replace' can be used to declare package
608 names that will be replaced at installation time.
610    The special variables 'keep_srcdir' and 'keep_destdir' are provided
611 in order to preserve the directories '${srcdir}' or '${destdir}', if
612 those exists as such.  Note: The declaration of these variables are
613 subject to manual deactivation; its purpose in recipes is to preserve
614 the directories that relate to the package's build (source) and
615 destination directory, that is so that another recipe can get a new
616 package (or meta package) from there.  For example, the declarations can
617 be done as:
619      keep_srcdir=keep_srcdir
620      keep_destdir=keep_destdir
622    Then from another recipe you would proceed to copy the necessary
623 files that will compose the meta package, from the main function you
624 must deactivate the variables at the end:
626      unset keep_srcdir
627      unset keep_destdir
629    This will leave the 'keep_srcdir' and 'keep_destdir' variables blank
630 to continue with the rest of the recipes.
632 A typical recipe contains the following variables:
634    * 'program': Software name.
636      It matches the source name.  It is also used to compose the name of
637      the package if '${pkgname}' is not specified.
639    * 'version': Software version.
641      It matches the source name.  It is also used to compose the version
642      of the package if '${pkgversion}' is not specified.
644    * 'arch': Software architecture.
646      It is used to compose the architecture of the package in which it
647      is build.
649    * 'release': Release number.
651      This is used to reflect the release number of the package.  It is
652      recommended to increase this number after any significant change in
653      the recipe or post-install script.
655    * 'pkgcategory': Package category.
657      Optional but recommended variable to categorize the package name
658      when it is created.
660 Obtaining sources over the network must be declared in the recipe using
661 the 'fetch' variable.
663    The variables 'netget' and 'rsync' can be defined in 'qirc' to
664 establish a network downloader in order to get the sources.  If they are
665 not defined, qi uses default values:
667    'netget' is the general network downloader tool, defaults sets to
668 'wget -c -w1 -t3 --no-check-certificate'.
670    'rsync' is the network tool for sources containing the prefix for the
671 RSYNC protocol, default sets to 'rsync -v -a -L -z -i --progress'.
673    The variable 'description' is used to print the package description
674 when a package is installed.
676    A description has two parts: a brief description, and a long
677 description.  By convention, the syntax of 'description' is:
679      description="
680      Brief description.
682      Long description.
683      "
685    The first line of the value represented is a brief description of the
686 software (called "blurb").  A blank line separates the _brief
687 description_ from the _long description_, which should contain a more
688 descriptive description of the software.
690 An example looks like:
692      description="
693      The GNU core utilities.
695      The GNU core utilities are the basic file, shell and text manipulation
696      utilities of the GNU operating system.  These are the core utilities
697      which are expected to exist on every operating system.
698      "
700    Please consider a length limit of 78 characters as maximum, because
701 the same one would be used on the meta file creation.  See *note The
702 meta file: Recipes. section.
704    The 'homepage' variable is used to declare the main site or home
705 page:
707      homepage=http://www.gnu.org/software/gcc
709    The variable 'license' is used for license information(1).  Some code
710 in the program can be covered by license A, license B, or license C. For
711 "separate licensing" or "heterogeneous licensing", we suggest using *|*
712 for a disjunction, *&* for a conjunction (if that ever happens in a
713 significant way), and comma for heterogeneous licensing.  Comma would
714 have lower precedence, plus added special terms.
716      license="LGPL, GPL | Artistic - added permission"
718 5.3 Writing recipes
719 ===================
721 Originally, Qi was designed for the version 3 of Dragora GNU/Linux; this
722 doesn't mean you can't use it in another distribution, just that if you
723 do, you'll have to try it out for yourself.  To help with this, here are
724 some references to well-written recipes:
726    * <http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes>
727    * <http://notabug.org/dragora/dragora/src/master/recipes>
728    * <http://notabug.org/dragora/dragora-extras/src/master/recipes>
729    * 
730      <http://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes>
732 5.4 Building packages
733 =====================
735 A recipe is any valid regular file.  Qi sets priorities for reading a
736 recipe, the order in which qi looks for a recipe is:
738   1. Current working directory.
740   2. If the specified path name does not contain "recipe" as the last
741      component.  Qi will complete it by adding "recipe" to the path
742      name.
744   3. If the recipe is not in the current working directory, it will be
745      searched under '${worktree}/recipes'.  The last component will be
746      completed adding "recipe" to the specified path name.
748 To build a single package, type:
750      qi build x-apps/xterm
752 Multiple jobs can be passed to the compiler to speed up the build
753 process:
755      qi build --jobs 3 x-apps/xterm
757 Update or install the produced package (if not already installed) when
758 the build command ends:
760      qi build -j3 --upgrade x-apps/xterm
762 Only process a recipe but do not create the binary package:
764      qi build --no-package dict/aspell
766    The options -install or -upgrade have no effect when -no-package is
767 given.
769 This is useful to inspect the build process of the above recipe:
771    qi build -keep -no-package dict/aspell 2>&1 | tee aspell-log.txt
773    The -keep option could preserve the source directory and the
774 destination directory for later inspection.  A log file of the build
775 process will be created redirecting both, standard error and standard
776 output to tee(1).
778 5.5 Variables from the environment
779 ==================================
781 Qi has environment variables which can be used at build time:
783    The variable 'TMPDIR' sets the temporary directory for sources, which
784 is used for package extractions (see *note Examining packages::) and is
785 prepended to the value of '${srcdir}' and '${destdir}' in build command.
786 By convention its default value is equal to '/usr/src/qi/build'.
788    The variables 'QICFLAGS', 'QICXXFLAGS', 'QILDFLAGS', and 'QICPPFLAGS'
789 have no effect by default.  The environment variables such as 'CFLAGS',
790 'CXXFLAGS', 'LDFLAGS', and 'CPPFLAGS' are unset at compile time:
792 Recommended practice is to set variables in the command line of
793 'configure' or _make(1)_ instead of exporting to the environment.  As
794 follows:
796    <http://www.gnu.org/software/make/manual/html_node/Environment.html>
797      It is not wise for makefiles to depend for their functioning on
798      environment variables set up outside their control, since this
799      would cause different users to get different results from the same
800      makefile.  This is against the whole purpose of most makefiles.
802    Setting environment variables for configure is deprecated because
803 running configure in varying environments can be dangerous.
805    <http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html>
806      Variables not defined in a site shell script can be set in the
807      environment passed to configure.  However, some packages may run
808      configure again during the build, and the customized values of
809      these variables may be lost.  In order to avoid this problem, you
810      should set them in the configure command line, using 'VAR=value'.
811      For example:
813      './configure CC=/usr/local2/bin/gcc'
815    <http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html>
816      If for instance the user runs 'CC=bizarre-cc ./configure', then the
817      cache, config.h, and many other output files depend upon bizarre-cc
818      being the C compiler.  If for some reason the user runs ./configure
819      again, or if it is run via './config.status --recheck', (See
820      Automatic Remaking, and see config.status Invocation), then the
821      configuration can be inconsistent, composed of results depending
822      upon two different compilers.  [...]  Indeed, while configure can
823      notice the definition of CC in './configure CC=bizarre-cc', it is
824      impossible to notice it in 'CC=bizarre-cc ./configure', which,
825      unfortunately, is what most users do.  [...]  configure: error:
826      changes in the environment can compromise the build.
828    If the 'SOURCE_DATE_EPOCH' environment variable is set to a UNIX
829 timestamp (defined as the number of seconds, excluding leap seconds,
830 since 01 Jan 1970 00:00:00 UTC.); then the given timestamp will be used
831 to overwrite any newer timestamps on the package contents (when it is
832 created).  More information about this can be found at
833 <https://reproducible-builds.org/specs/source-date-epoch/>.
835 5.6 The meta file
836 =================
838 The "meta file" is a regular file created during the build command, it
839 contains information about the package such as package name, package
840 version, architecture, release, fetch address, description, and other
841 minor data extracted from processed recipes.  The name of the file is
842 generated as '${full_pkgname}.tlz.txt', and its purpose is to reflect
843 essential information to the user without having to look inside the
844 package content.  The file format is also intended to be used by other
845 scripts or by common Unix tools.
847    The content of a meta file looks like:
849      #
850      # Pattern scanning and processing language.
851      #
852      # The awk utility interprets a special-purpose programming language
853      # that makes it possible to handle simple data-reformatting jobs
854      # with just a few lines of code.  It is a free version of 'awk'.
855      #
856      # GNU awk implements the AWK utility which is part of
857      # IEEE Std 1003.1 Shell and Utilities (XCU).
858      #
860      QICFLAGS="-O2"
861      QICXXFLAGS="-O2"
862      QILDFLAGS=""
863      pkgname=gawk
864      pkgversion=5.0.1
865      arch=amd64
866      release=1
867      pkgcategory="tools"
868      full_pkgname=gawk_5.0.1_amd64-1@tools
869      blurb="Pattern scanning and processing language."
870      homepage="http://www.gnu.org/software/gawk"
871      license="GPLv3+"
872      fetch="http://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz"
873      replace=""
875    Package descriptions are extracted from the variable 'description'
876 where each line is interpreted literally and pre-formatted to fit in
877 (exactly) *80 columns*, plus the character '#' and a blank space is
878 prefixed to every line (shell comments).
880 In addition to the Special variables, there are implicit variables such
881 as 'blurb':
883    The 'blurb' variable is related to the special variable
884 'description'.  Its value is made from the first (substantial) line of
885 'description', mentioned as the "brief description".
887    ---------- Footnotes ----------
889    (1) The proposal for 'license' was made by Richard M. Stallman at
890 <http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html>.
892 \x1f
893 File: qi.info,  Node: Order files,  Next: Creating packages,  Prev: Recipes,  Up: Top
895 6 Order files
896 *************
898 The order command has the purpose of resolving the build order through
899 .order files.  An order file contains a list of recipe names, by default
900 does not perform any action other than to print a resolved list in
901 descending order.  For example, if *a* depends on *b* and *c*, and *c*
902 depends on *b* as well, the file might look like:
904      a: c b
905      b:
906      c: b
908    Each letter represents a recipe name, complete dependencies for the
909 first recipe name are listed in descending order, which is printed from
910 right to left, and removed from left to right:
912    OUTPUT
914      b
915      c
916      a
918    Blank lines, colons and parentheses are simply ignored.  Comment
919 lines beginning with '#' are allowed.
921 An order file could be used to build a series of packages, for example,
922 if the content is:
924      # Image handling libraries
926      libs/libjpeg-turbo: devel/nasm
927      x-libs/jasper: libs/libjpeg-turbo
928      libs/tiff: libs/libjpeg-turbo
930    To proceed with each recipe, we can type:
932      qi order imglibs.order | qi build --install -
934    The output of 'qi order imglibs.order' tells to qi in which order it
935 should build the recipes:
937      devel/nasm
938      libs/libjpeg-turbo
939      x-libs/jasper
940      libs/tiff
942 \x1f
943 File: qi.info,  Node: Creating packages,  Next: Examining packages,  Prev: Order files,  Up: Top
945 7 Creating packages
946 *******************
948 The creation command is an internal function of qi to make new Qi
949 compatible packages.  A package is produced using the contents of the
950 Current Working Directory and the package file is written out.
952      Usage: qi create [OUTPUT/PACKAGENAME.TLZ]...
954    The argument for the file name to be written must contain a fully
955 qualified named directory as the output directory where the package
956 produced will be written.  The file name should be composed using the
957 full name: name-version-architecture-release[@pkgcategory].tlz
959    EXAMPLE
961      cd /usr/pkg
962      cd claws-mail_3.17.1_amd64-1@x-apps
963      qi create /var/cache/qi/packages/claws-mail_3.17.1_amd64-1@x-apps
965    In this case, the package "claws-mail_3.17.1_amd64-1@x-apps" will be
966 written into '/var/cache/qi/packages/'.
968 All packages produced are complemented by a checksum file (.sha256).
970 \x1f
971 File: qi.info,  Node: Examining packages,  Next: Qi exit status,  Prev: Creating packages,  Up: Top
973 8 Examining packages
974 ********************
976 The extraction command serves to examine binary packages for debugging
977 purposes.  It decompresses a package into a single directory, verifying
978 its integrity and preserving all of it properties (owner and
979 permission).
981      Usage: qi extract [PACKAGENAME.TLZ]...
983    EXAMPLE
985      qi extract mksh_R56c_amd64-1@shells.tlz
987    This action will put the content of "mksh_R56c_amd64-1@shells.tlz"
988 into a single directory, this is a private directory for the user who
989 requested the action, creation operation will be equal to *u=rwx,g=,o=
990 (0700)*.  The package content will reside on this location, default mask
991 to deploy the content will be equal to *u=rwx,g=rwx,o=rwx (0000)*.
993 Note: the creation of the custom directory is influenced by the value of
994 the 'TMPDIR' variable.
996 \x1f
997 File: qi.info,  Node: Qi exit status,  Next: Index,  Prev: Examining packages,  Up: Top
999 9 Qi exit status
1000 ****************
1002 All the exit codes are described in this chapter.
1005      Successful completion (no errors).
1008      Minor common errors:
1010         * Help usage on illegal options or required arguments.
1012         * Program needed by qi (prerequisite) is not available.
1015      Command execution error:
1017      This code is used to return the evaluation of an external command
1018      or shell arguments in case of failure.
1021      Integrity check error for compressed files.
1023      Compressed files means:
1025         * A tarball file from tar(1).  Supported extensions: .tar,
1026           .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz, .tar.xz, .txz
1028         * A tarball file from tarlz(1).  Supported extensions: .tar.lz,
1029           .tlz
1031         * Zip files from unzip(1).  Supported extensions: .zip, .ZIP
1033         * Gzip files from gzip(1).  Supported extensions: .gz, .Z
1035         * Bzip2 files from bzip2(1).  Supported extension: .bz2
1037         * Lzip files from lzip(1).  Supported extension: .lz
1039         * Xz files from xz(1).  Supported extension: .xz
1042      File empty, not regular, or expected.
1044      It's commonly expected:
1046         * An argument for giving commands.
1048         * A regular file or readable directory.
1050         * An expected extension: .tlz, .sha256, .order.
1052         * A protocol supported by the network downloader tool.
1055      Empty or not defined variable:
1057      This code is used to report empty or undefined variables (usually
1058      variables coming from a recipe or assigned arrays that are tested).
1061      Package already installed:
1063      The package directory for an incoming .tlz package already exists.
1065 '10'
1066      Network manager error:
1068      This code is used if the network downloader tool fails for some
1069      reason.
1071 \x1f
1072 File: qi.info,  Node: Index,  Prev: Qi exit status,  Up: Top
1074 Index
1075 *****
1077 \0\b[index\0\b]
1078 * Menu:
1080 * configuration file:                    The qirc file.       (line   6)
1081 * environment variables:                 Recipes.             (line 281)
1082 * exit codes:                            Qi exit status.      (line   6)
1083 * handling build order:                  Order files.         (line   6)
1084 * introduction to qi:                    Introduction to Qi.  (line   6)
1085 * invocation:                            Invoking qi.         (line   6)
1086 * managing packages:                     Packages.            (line   6)
1087 * package blacklist:                     Packages.            (line 189)
1088 * package build:                         Recipes.             (line 235)
1089 * package conflicts:                     Packages.            (line  31)
1090 * package creation:                      Creating packages.   (line   6)
1091 * package de-installation:               Packages.            (line 112)
1092 * package examination:                   Examining packages.  (line   6)
1093 * package installation:                  Packages.            (line  56)
1094 * package upgrade:                       Packages.            (line 151)
1095 * recipes:                               Recipes.             (line   6)
1096 * special variables:                     Recipes.             (line  58)
1097 * the meta file:                         Recipes.             (line 338)
1098 * variables:                             Recipes.             (line  29)
1099 * writing recipes:                       Recipes.             (line 221)
1102 \x1f
1103 Tag Table:
1104 Node: Top\x7f814
1105 Node: Introduction to Qi\x7f1605
1106 Node: Invoking qi\x7f2792
1107 Node: The qirc file\x7f6920
1108 Node: Packages\x7f7884
1109 Ref: Packages-Footnote-1\x7f15560
1110 Ref: Packages-Footnote-2\x7f15662
1111 Node: Recipes\x7f15775
1112 Ref: Recipes-Footnote-1\x7f31308
1113 Node: Order files\x7f31453
1114 Node: Creating packages\x7f32774
1115 Node: Examining packages\x7f33762
1116 Node: Qi exit status\x7f34678
1117 Node: Index\x7f36548
1118 \x1f
1119 End Tag Table
1121 \x1f
1122 Local Variables:
1123 coding: iso-8859-1
1124 End: