qi: Bump to version 2.0 (Release Candidate 12)
[dragora.git] / qi / doc / qi.info
blobba126a8a57ab5d6f7af9d80d2e5bd24a2f5adf59
1 This is qi.info, produced by makeinfo version 6.5 from qi.texi.
3 This user guide is for Qi (version 2.0rc12, 18 Jul 2020), which is a
4 simple but well-integrated package manager.
6    Copyright © 2019-2020 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,  Up: (dir)
23 Qi user guide
24 *************
26 This user guide is for Qi (version 2.0rc12, 18 Jul 2020).
28 * Menu:
30 * Introduction::              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 * Exit status::               Exit codes
39 * Index::
42    Copyright (C) 2019-2020 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,  Next: Invoking qi,  Prev: Top,  Up: Top
50 1 Introduction
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,  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 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 To upgrade a package, just type:
440      qi upgrade gcc_9.0.1_i586-1@devel.tlz
442    This will proceed to upgrade "gcc_9.0.1_i586-1@devel" removing any
443 other version of "gcc" (if any).
445 If you want to keep the package directories of versions found during the
446 upgrade process, just pass:
448      qi upgrade --keep gcc_9.0.1_i586-1@devel.tlz
450 To see the upgrade process:
452      qi upgrade --verbose gcc_9.0.1_i586-1@devel.tlz
454    A second -verbose or -v option gives more (very verbose).
456 To force the upgrade of an existing package:
458      qi upgrade --force gcc_9.0.1_i586-1@devel.tlz
460 4.4.1 Package blacklist
461 -----------------------
463 To implement general package facilities, either to install, remove or
464 maintain the hierarchy of packages in a clean manner, qi makes use of
465 the pruning operation via graft(1) by default:
467    There is a risk if those are crucial packages for the proper
468 functioning of the system, because it implies the deactivation of
469 symbolic from the target directory, _especially_ when transitioning an
470 incoming package into its final location during an upgrade.
472 A blacklist of package names has been devised for the case where a user
473 decides to upgrade all the packages in the system, or just the crucial
474 ones, such as the C library.
476    The blacklist is related to the upgrade command only, consists in
477 installing a package instead of updating it or removing previous
478 versions of it; the content of the package will be updated over the
479 existing content at '${packagedir}', while the existing links from
480 '${targetdir}' will be preserved.  A pruning of links will be carried
481 out in order to re-link possible differences with the recent content,
482 this helps to avoid leaving dead links in the target directory.
484 Package names for the blacklist to be declared must be set from the
485 configuration file.
487    ---------- Footnotes ----------
489    (1) For more details about tarlz and the lzip format, visit
490 <https://lzip.nongnu.org/tarlz.html>.
492    (2) The official guide for Graft can be found at
493 <http://peters.gormand.com.au/Home/tools/graft/graft.html>.
495 \x1f
496 File: qi.info,  Node: Recipes,  Next: Order files,  Prev: Packages,  Up: Top
498 5 Recipes
499 *********
501 A recipe is a file telling qi what to do.  Most often, the recipe tells
502 qi how to build a binary package from a source tarball.
504    A recipe has two parts: a list of variable definitions and a list of
505 sections.  By convention, the syntax of a section is:
507      section_name()
508      {
509          section lines
510      }
512    The section name is followed by parentheses, one newline and an
513 opening brace.  The line finishing the section contains just a closing
514 brace.  The section names or the function names currently recognized are
515 'build'.
517    The 'build' section (or *shell function*) is an augmented shell
518 script that contains the main instructions for building a software
519 source.
521 5.1 Variables
522 =============
524 A "variable" is a *shell variable* defined either in 'qirc' or in a
525 recipe to represent a string of text, called the variable's "value".
526 These values are substituted by explicit request in the definitions of
527 other variables or in calls to external commands.
529    Variables can represent lists of file names, options to pass to
530 compilers, programs to run, directories to look in for source files,
531 directories to write output to, or anything else you can imagine.
533    Definitions of variables in qi have four levels of precedence.
534 Options which define variables from the command-line override those
535 specified in the 'qirc' file, while variables defined in the recipe
536 override those specified in 'qirc', taking priority over those variables
537 set by command-line options.  Finally, the variables have default values
538 if they are not defined anywhere.
540    Options that set variables through the command-line can only
541 reference variables defined in 'qirc' and variables with default values.
543    Definitions of variables in 'qirc' can only reference variables
544 previously defined in 'qirc' and variables with default values.
546    Definitions of variables in the recipe can only reference variables
547 set by the command-line, variables previously defined in the recipe,
548 variables defined in 'qirc', and variables with default values.
550 5.2 Special variables
551 =====================
553 There are variables which can only be set using the command line options
554 or via 'qirc', there are other special variables which can be defined or
555 redefined in a recipe.  See the following definitions:
557    'outdir' is the directory where the packages produced are written.
558 This variable can be redefined per-recipe.  Default sets to
559 '/var/cache/qi/packages'.
561    'worktree' is the working tree where archives, patches, and recipes
562 are expected.  This variable can not be redefined in the recipe.
563 Default sets to '/usr/src/qi'.
565    'tardir' is defined in the recipe to the directory where the tarball
566 containing the source can be found.  The full name of the tarball is
567 composed as '${tardir}/$tarname'.  Its value is available in the recipe
568 as '${tardir}'; a value of .  for 'tardir' sets it to the value of CWD
569 (Current Working Directory), this is where the recipe lives.
571    'arch' is the architecture to compose the package name.  Its value is
572 available in the recipe as '${arch}'.  Default value is the one that was
573 set in the Qi configuration.
575    'jobs' is the number of parallel jobs to pass to the compiler.  Its
576 value is available in the recipe as '${jobs}'.  The default value is 1.
578    The two variables '${srcdir}' and '${destdir}' can be set in the
579 recipe, as any other variable, but if they are not, qi uses default
580 values for them when building a package.
582    'srcdir' contains the source code to be compiled, and defaults to
583 '${program}-${version}'.  'destdir' is the place where the built package
584 will be installed, and defaults to '${TMPDIR}/package-${program}'.
586    If 'pkgname' is left undefined, the special variable 'program' is
587 assigned by default.  If 'pkgversion' is left undefined, the special
588 variable 'version' is assigned by default.
590    'pkgname' and 'pkgversion' along with: 'version', 'arch', 'release',
591 and (optionally) 'pkgcategory' are used to produce the package name in
592 the form:
593 '${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}].tlz'
595    'pkgcategory' is an optional special variable that can be defined on
596 the recipe to categorize the package name.  If it is defined, then the
597 package output will be composed as
598 '${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}.tlz'.
599 Automatically, the value of 'pkgcategory' will be prefixed using the '@'
600 (at) symbol which will be added to the last part of the package name.
602    A special variable called 'replace' can be used to declare package
603 names that will be replaced at installation time.
605    The special variables 'keep_srcdir' and 'keep_destdir' are provided
606 in order to preserve the directories '${srcdir}' or '${destdir}', if
607 those exists as such.  Note: The declaration of these variables are
608 subject to manual deactivation; its purpose in recipes is to preserve
609 the directories that relate to the package's build (source) and
610 destination directory, that is so that another recipe can get a new
611 package (or meta package) from there.  For example, the declarations can
612 be done as:
614      keep_srcdir=keep_srcdir
615      keep_destdir=keep_destdir
617    Then from another recipe you would proceed to copy the necessary
618 files that will compose the meta package, from the main function you
619 must deactivate the variables at the end:
621      unset keep_srcdir
622      unset keep_destdir
624    This will leave the 'keep_srcdir' and 'keep_destdir' variables blank
625 to continue with the rest of the recipes.
627 A typical recipe contains the following variables:
629    * 'program': Software name.
631      It matches the source name.  It is also used to compose the name of
632      the package if '${pkgname}' is not specified.
634    * 'version': Software version.
636      It matches the source name.  It is also used to compose the version
637      of the package if '${pkgversion}' is not specified.
639    * 'arch': Software architecture.
641      It is used to compose the architecture of the package in which it
642      is build.
644    * 'release': Release number.
646      This is used to reflect the release number of the package.  It is
647      recommended to increase this number after any significant change in
648      the recipe or post-install script.
650    * 'pkgcategory': Package category.
652      Optional but recommended variable to categorize the package name
653      when it is created.
655 Obtaining sources over the network must be declared in the recipe using
656 the 'fetch' variable.
658    The variables 'netget' and 'rsync' can be defined in 'qirc' to
659 establish a network downloader in order to get the sources.  If they are
660 not defined, qi uses default values:
662    'netget' is the general network downloader tool, defaults sets to
663 'wget -c -w1 -t3 --no-check-certificate'.
665    'rsync' is the network tool for sources containing the prefix for the
666 RSYNC protocol, default sets to 'rsync -v -a -L -z -i --progress'.
668    The variable 'description' is used to print the package description
669 when a package is installed.
671    A description has two parts: a brief description, and a long
672 description.  By convention, the syntax of 'description' is:
674      description="
675      Brief description.
677      Long description.
678      "
680    The first line of the value represented is a brief description of the
681 software (called "blurb").  A blank line separates the _brief
682 description_ from the _long description_, which should contain a more
683 descriptive description of the software.
685 An example looks like:
687      description="
688      The GNU core utilities.
690      The GNU core utilities are the basic file, shell and text manipulation
691      utilities of the GNU operating system.  These are the core utilities
692      which are expected to exist on every operating system.
693      "
695    Please consider a length limit of 78 characters as maximum, because
696 the same one would be used on the meta file creation.  See *note The
697 meta file: Recipes. section.
699    The 'homepage' variable is used to declare the main site or home
700 page:
702      homepage=http://www.gnu.org/software/gcc
704    The variable 'license' is used for license information(1).  Some code
705 in the program can be covered by license A, license B, or license C. For
706 "separate licensing" or "heterogeneous licensing", we suggest using *|*
707 for a disjunction, *&* for a conjunction (if that ever happens in a
708 significant way), and comma for heterogeneous licensing.  Comma would
709 have lower precedence, plus added special terms.
711      license="LGPL, GPL | Artistic - added permission"
713 5.3 Writing recipes
714 ===================
716 Originally, Qi was designed for the version 3 of Dragora GNU/Linux; this
717 doesn't mean you can't use it in another distribution, just that if you
718 do, you'll have to try it out for yourself.  To help with this, here are
719 some references to well-written recipes:
721    * <http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes>
722    * <http://notabug.org/dragora/dragora/src/master/recipes>
724 5.4 Building packages
725 =====================
727 A recipe is any valid regular file.  Qi sets priorities for reading a
728 recipe, the order in which qi looks for a recipe is:
730   1. Current working directory.
732   2. If the specified path name does not contain "recipe" as the last
733      component.  Qi will complete it by adding "recipe" to the path
734      name.
736   3. If the recipe is not in the current working directory, it will be
737      searched under '${worktree}/recipes'.  The last component will be
738      completed adding "recipe" to the specified path name.
740 To build a single package, type:
742      qi build x-apps/xterm
744 Multiple jobs can be passed to the compiler to speed up the build
745 process:
747      qi build --jobs 3 x-apps/xterm
749 Update or install the produced package (if not already installed) when
750 the build command ends:
752      qi build -j3 --upgrade x-apps/xterm
754 Only process a recipe but do not create the binary package:
756      qi build --no-package dict/aspell
758    The options -install or -upgrade have no effect when -no-package is
759 given.
761 This can be useful to inspect the build process of recipe:
763    qi build -keep -no-package dict/aspell 2>&1 | tee aspell-log.txt
765    The -keep option could preserve the source directory and the
766 destination directory for later inspection.  A log file of the build
767 process will be created redirecting both, standard error and standard
768 output to tee(1).
770 5.5 Variables from the environment
771 ==================================
773 Qi has environment variables which can be used at build time:
775    The variable 'TMPDIR' sets the temporary directory for sources, which
776 is used for package extractions (see *note Examining packages::) and is
777 prepended to the value of '${srcdir}' and '${destdir}' in build command.
778 By convention its default value is equal to '/usr/src/qi/build'.
780    The variables 'QICFLAGS', 'QICXXFLAGS', and 'QILDFLAGS' have no
781 effect by default.  The environment variables such as 'CFLAGS',
782 'CXXFLAGS', and 'LDFLAGS' are unset at compile time:
784 Recommended practice is to set variables in the command line of
785 'configure' or _make(1)_ instead of exporting to the environment.  As
786 follows:
788    <http://www.gnu.org/software/make/manual/html_node/Environment.html>
789      It is not wise for makefiles to depend for their functioning on
790      environment variables set up outside their control, since this
791      would cause different users to get different results from the same
792      makefile.  This is against the whole purpose of most makefiles.
794    Setting environment variables for configure is deprecated because
795 running configure in varying environments can be dangerous.
797    <http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html>
798      Variables not defined in a site shell script can be set in the
799      environment passed to configure.  However, some packages may run
800      configure again during the build, and the customized values of
801      these variables may be lost.  In order to avoid this problem, you
802      should set them in the configure command line, using 'VAR=value'.
803      For example:
805      './configure CC=/usr/local2/bin/gcc'
807    <http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html>
808      If for instance the user runs 'CC=bizarre-cc ./configure', then the
809      cache, config.h, and many other output files depend upon bizarre-cc
810      being the C compiler.  If for some reason the user runs ./configure
811      again, or if it is run via './config.status --recheck', (See
812      Automatic Remaking, and see config.status Invocation), then the
813      configuration can be inconsistent, composed of results depending
814      upon two different compilers.  [...]  Indeed, while configure can
815      notice the definition of CC in './configure CC=bizarre-cc', it is
816      impossible to notice it in 'CC=bizarre-cc ./configure', which,
817      unfortunately, is what most users do.  [...]  configure: error:
818      changes in the environment can compromise the build.
820 5.6 The meta file
821 =================
823 The "meta file" is a regular file created during the build command, it
824 contains information about the package such as package name, package
825 version, architecture, release, fetch address, description, and other
826 minor data extracted from processed recipes.  The name of the file is
827 generated as '${full_pkgname}.tlz.txt', and its purpose is to reflect
828 essential information to the user without having to look inside the
829 package content.  The file format is also intended to be used by other
830 scripts or by common Unix tools.
832    The content of a meta file looks like:
834      #
835      # Pattern scanning and processing language.
836      #
837      # The awk utility interprets a special-purpose programming language
838      # that makes it possible to handle simple data-reformatting jobs
839      # with just a few lines of code.  It is a free version of 'awk'.
840      #
841      # GNU awk implements the AWK utility which is part of
842      # IEEE Std 1003.1 Shell and Utilities (XCU).
843      #
845      QICFLAGS="-g0 -Os"
846      QICXXFLAGS="-g0 -Os"
847      QILDFLAGS="-s"
848      pkgname=gawk
849      pkgversion=5.0.1
850      arch=amd64
851      release=1
852      pkgcategory="tools"
853      full_pkgname=gawk_5.0.1_amd64-1@tools
854      blurb="Pattern scanning and processing language."
855      homepage="http://www.gnu.org/software/gawk"
856      license="GPLv3+"
857      fetch="http://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz"
858      replace=""
860    Package descriptions are extracted from the variable 'description'
861 where each line is interpreted literally and pre-formatted to fit in
862 (exactly) *80 columns*, plus the character '#' and a blank space is
863 prefixed to every line (shell comments).
865 In addition to the Special variables, there are implicit variables such
866 as 'blurb':
868    The 'blurb' variable is related to the special variable
869 'description'.  Its value is made from the first (substantial) line of
870 'description', mentioned as the "brief description".
872    ---------- Footnotes ----------
874    (1) The proposal for 'license' was made by Richard M. Stallman at
875 <http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html>.
877 \x1f
878 File: qi.info,  Node: Order files,  Next: Creating packages,  Prev: Recipes,  Up: Top
880 6 Order files
881 *************
883 The order command has the purpose of resolving the build order through
884 .order files.  An order file contains a list of recipe names, by default
885 does not perform any action other than to print a resolved list in
886 descending order.  For example, if *a* depends on *b* and *c*, and *c*
887 depends on *b* as well, the file might look like:
889      a: c b
890      b:
891      c: b
893    Each letter represents a recipe name, complete dependencies for the
894 first recipe name are listed in descending order, which is printed from
895 right to left, and removed from left to right:
897    OUTPUT
899      b
900      c
901      a
903    Blank lines, colons and parentheses are simply ignored.  Comment
904 lines beginning with '#' are allowed.
906 An order file could be used to build a series of packages, for example,
907 if the content is:
909      # Image handling libraries
911      libs/libjpeg-turbo: devel/nasm
912      x-libs/jasper: libs/libjpeg-turbo
913      libs/tiff: libs/libjpeg-turbo
915    To proceed with each recipe, we can type:
917      qi order imglibs.order | qi build --install -
919    The output of 'qi order imglibs.order' tells to qi in which order it
920 should build the recipes:
922      devel/nasm
923      libs/libjpeg-turbo
924      x-libs/jasper
925      libs/tiff
927 \x1f
928 File: qi.info,  Node: Creating packages,  Next: Examining packages,  Prev: Order files,  Up: Top
930 7 Creating packages
931 *******************
933 The creation command is an internal function of qi to make new Qi
934 compatible packages.  A package is produced using the contents of the
935 Current Working Directory and the package file is written out.
937      Usage: qi create [OUTPUT/PACKAGENAME.TLZ]...
939    The argument for the file name to be written must contain a fully
940 qualified named directory as the output directory where the package
941 produced will be written.  The file name should be composed using the
942 full name: name-version-architecture-release[@pkgcategory].tlz
944    EXAMPLE
946      cd /usr/pkg
947      cd claws-mail_3.17.1_amd64-1@x-apps
948      qi create /var/cache/qi/packages/claws-mail_3.17.1_amd64-1@x-apps
950    In this case, the package "claws-mail_3.17.1_amd64-1@x-apps" will be
951 written into '/var/cache/qi/packages/'.
953 All packages produced are complemented by a checksum file (.sha256).
955 \x1f
956 File: qi.info,  Node: Examining packages,  Next: Exit status,  Prev: Creating packages,  Up: Top
958 8 Examining packages
959 ********************
961 The extraction command serves to examine binary packages for debugging
962 purposes.  It decompresses a package into a single directory, verifying
963 its integrity and preserving all of it properties (owner and
964 permission).
966      Usage: qi extract [PACKAGENAME.TLZ]...
968    EXAMPLE
970      qi extract mksh_R56c_amd64-1@shells.tlz
972    This action will put the content of "mksh_R56c_amd64-1@shells.tlz"
973 into a single directory, this is a private directory for the user who
974 requested the action, creation operation will be equal to *u=rwx,g=,o=
975 (0700)*.  The package content will reside on this location, default mask
976 to deploy the content will be equal to *u=rwx,g=rwx,o=rwx (0000)*.
978 Note: the creation of the custom directory is influenced by the value of
979 the 'TMPDIR' variable.
981 \x1f
982 File: qi.info,  Node: Exit status,  Next: Index,  Prev: Examining packages,  Up: Top
984 9 Exit status
985 *************
987 All the exit codes are described in this chapter.
990      Successful completion (no errors).
993      Minor common errors:
995         * Help usage on illegal options or required arguments.
997         * Program needed by qi (prerequisite) is not available.
1000      Command execution error:
1002      This code is used to return the evaluation of an external command
1003      or shell arguments in case of failure.
1006      Integrity check error for compressed files.
1008      Compressed files means:
1010         * A tarball file from tar(1).  Supported extensions: .tar,
1011           .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz, .tar.xz, .txz
1013         * A tarball file from tarlz(1).  Supported extensions: .tar.lz,
1014           .tlz
1016         * Zip files from unzip(1).  Supported extensions: .zip, .ZIP
1018         * Gzip files from gzip(1).  Supported extensions: .gz, .Z
1020         * Bzip2 files from bzip2(1).  Supported extension: .bz2
1022         * Lzip files from lzip(1).  Supported extension: .lz
1024         * Xz files from xz(1).  Supported extension: .xz
1027      File empty, not regular, or expected.
1029      It's commonly expected:
1031         * An argument for giving commands.
1033         * A regular file or readable directory.
1035         * An expected extension: .tlz, .sha256, .order.
1037         * A protocol supported by the network downloader tool.
1040      Empty or not defined variable:
1042      This code is used to report empty or undefined variables (usually
1043      variables coming from a recipe or assigned arrays that are tested).
1046      Package already installed:
1048      The package directory for an incoming .tlz package already exists.
1050 '10'
1051      Network manager error:
1053      This code is used if the network downloader tool fails for some
1054      reason.
1056 \x1f
1057 File: qi.info,  Node: Index,  Prev: Exit status,  Up: Top
1059 Index
1060 *****
1062 \0\b[index\0\b]
1063 * Menu:
1065 * configuration file:                    The qirc file.       (line   6)
1066 * environment variables:                 Recipes.             (line 278)
1067 * exit codes:                            Exit status.         (line   6)
1068 * handling build order:                  Order files.         (line   6)
1069 * introduction:                          Introduction.        (line   6)
1070 * invocation:                            Invoking qi.         (line   6)
1071 * managing packages:                     Packages.            (line   6)
1072 * package blacklist:                     Packages.            (line 184)
1073 * package build:                         Recipes.             (line 232)
1074 * package conflicts:                     Packages.            (line  31)
1075 * package creation:                      Creating packages.   (line   6)
1076 * package de-installation:               Packages.            (line 112)
1077 * package examination:                   Examining packages.  (line   6)
1078 * package installation:                  Packages.            (line  56)
1079 * package upgrade:                       Packages.            (line 151)
1080 * recipes:                               Recipes.             (line   6)
1081 * special variables:                     Recipes.             (line  58)
1082 * the meta file:                         Recipes.             (line 328)
1083 * variables:                             Recipes.             (line  29)
1084 * writing recipes:                       Recipes.             (line 221)
1087 \x1f
1088 Tag Table:
1089 Node: Top\x7f807
1090 Node: Introduction\x7f1592
1091 Node: Invoking qi\x7f2761
1092 Node: The qirc file\x7f6880
1093 Node: Packages\x7f7844
1094 Ref: Packages-Footnote-1\x7f15267
1095 Ref: Packages-Footnote-2\x7f15369
1096 Node: Recipes\x7f15482
1097 Ref: Recipes-Footnote-1\x7f30441
1098 Node: Order files\x7f30586
1099 Node: Creating packages\x7f31907
1100 Node: Examining packages\x7f32895
1101 Node: Exit status\x7f33808
1102 Node: Index\x7f35669
1103 \x1f
1104 End Tag Table
1106 \x1f
1107 Local Variables:
1108 coding: iso-8859-1
1109 End: