1 This is qi.info, produced by makeinfo version 6.8 from qi-header.texi.
3 Copyright © 2019-2024 Matias Andres Fonzo, Santiago del Estero,
6 Permission is granted to copy, distribute and/or modify this document
7 under the terms of the GNU Free Documentation License, Version 1.3 or
8 any later version published by the Free Software Foundation; with no
9 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
10 INFO-DIR-SECTION Package management
12 * Qi: (qi). A user-friendly package manager.
16 File: qi.info, Node: Top, Next: Introduction to Qi, Up: (dir)
21 This user guide is for Qi (version 2.12, 04 Apr 2024).
25 * Introduction to Qi:: Description and features of qi
26 * Invoking qi:: Command-line options
27 * The qirc file:: Configuration file
28 * Packages:: Managing packages
29 * Recipes:: Building packages
30 * Order files:: Handling build order
31 * Creating packages:: Making Qi packages
32 * Examining packages:: Debugging purposes
33 * Qi exit status:: Exit codes
37 Copyright © 2019-2024 Matias Andres Fonzo, Santiago del Estero,
40 Permission is granted to copy, distribute and/or modify this document
41 under the terms of the GNU Free Documentation License, Version 1.3 or
42 any later version published by the Free Software Foundation; with no
43 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
46 File: qi.info, Node: Introduction to Qi, Next: Invoking qi, Prev: Top, Up: Top
51 Qi is a simple but well-integrated package manager. It can create,
52 install, remove, and upgrade software packages. Qi produces binary
53 packages using recipes, which are files containing specific instructions
54 to build each package from source. Qi can manage multiple packages
55 under a single directory hierarchy. This method allows to maintain a
56 set of packages and multiple versions of them. This means that Qi could
57 be used as the main package manager or complement the existing one.
59 Qi offers a friendly command line interface, a global configuration
60 file, a simple recipe layout to deploy software packages; also works
61 with binary packages in parallel, speeding up installations and packages
62 in production. The format used for packages is a simplified and safer
63 variant of POSIX pax archive compressed in lzip format.
65 Qi is a modern (POSIX-compliant) shell script released under the
66 terms of the GNU General Public License. There are only two major
67 dependencies for the magic: graft(1) and tarlz(1), the rest is expected
68 to be found in any Unix-like system.
71 File: qi.info, Node: Invoking qi, Next: The qirc file, Prev: Introduction to Qi, Up: Top
76 This chapter describes the synopsis for invoking Qi.
78 Usage: qi COMMAND [OPTION...] [FILE]...
80 One mandatory command specifies the operation that ‘qi’ should perform,
81 options are meant to detail how this operation should be performed
82 during or after the process.
84 Qi supports the following commands:
87 Warn about files that will be installed.
99 Extract packages for debugging purposes.
102 Create a .tlz package from directory.
105 Build packages using recipe names.
108 Resolve build order through .order files
110 Options when installing, removing, or upgrading software packages:
114 Force upgrade of pre-existing packages.
118 Keep directories when build/remove/upgrade.
120 Keep (don’t delete) the package directory when using remove/upgrade
123 This will also try to preserve the directories ‘${srcdir}’ and
124 ‘${destdir}’ when using build command. Its effect is available in
125 recipes as ‘${keep_srcdir}’ and ‘${keep_destdir}’. See *note
126 Special variables: Recipes. for details.
134 Set directory for package installations.
138 Set target directory for symbolic links.
142 Use the fully qualified named directory as the root directory for
145 Note: the target directory and the package directory will be
146 relative to the specified directory, excepting the graft log file.
148 Options when building software packages using recipes:
152 Set architecture name for the package.
156 Parallel jobs for the compiler.
158 This option sets the variable ‘${jobs}’. If not specified, default
163 Skip questions on completed recipes.
167 Increment release number (‘${release}’ + 1).
169 The effect of this option will be omitted if –no-package is being
174 Do not create a .tlz package.
178 Install package after the build.
182 Upgrade package after the build.
186 Where the packages produced will be written.
188 This option sets the variable ‘${outdir}’.
192 Where archives, patches, recipes are expected.
194 This option sets the variable ‘${worktree}’.
198 Where compressed sources will be found.
200 This option sets the variable ‘${tardir}’.
206 Be verbose (an extra -v gives more).
208 It sets the verbosity level, default sets to 0.
210 The value 1 is used for more verbosity while the value 2 is too
211 detailed. Although at the moment it is limited to graft(1)
216 Do not read the configuration file.
218 This will ignore reading the qirc file.
222 Print default directory locations and exit.
224 This will print the target directory, package directory, working
225 tree, the directory for sources, and the output directory for the
226 packages produced. The output will appear on STDOUT as follows:
228 QI_TARGETDIR=/usr/local
229 QI_PACKAGEDIR=/usr/local/pkgs
230 QI_WORKTREE=/usr/src/qi
231 QI_TARDIR=/usr/src/qi/sources
232 QI_OUTDIR=/var/cache/qi/packages
234 You can set these environment variables using one of the following
239 This will display the default locations taking into account the
240 values set from the qirc configuration file. You can deny the
241 influence of the configuration file by setting the option ‘-N’.
245 Or you can adjust the new locations using the command-line options,
248 ‘eval "$(qi -N --targetdir=/directory -L)"’
252 Display the usage and exit.
257 This will print the (short) version information and then exit.
259 The same can be achieved if Qi is invoked as ‘qi version’.
261 When FILE is -, qi can read from the standard input. See examples
262 from the *note Packages:: section.
264 Exit status: 0 for a normal exit, 1 for minor common errors (help
265 usage, support not available, etc), 2 to indicate a command execution
266 error; 3 for integrity check error on compressed files, 4 for empty, not
267 regular, or expected files, 5 for empty or not defined variables, 6 when
268 a package already exist, 10 for network manager errors. For more
269 details, see the *note Qi exit status:: section.
272 File: qi.info, Node: The qirc file, Next: Packages, Prev: Invoking qi, Up: Top
277 The global ‘qirc’ file offers a way to define variables and tools (such
278 as a download manager) for default use. This file is used by qi at
279 runtime, e.g., to build, install, remove or upgrade packages.
281 Variables and their possible values must be declared as any other
282 variable in the shell.
284 The command line options related to the package directory and target
285 directory and some of the command line options used for the build
286 command, have the power to override the values declared on ‘qirc’. See
289 The order in which qi looks for this file is:
291 1. ‘${HOME}/.qirc’ Effective user.
293 2. ‘${sysconfdir}/qirc’ System-wide.
295 If you intend to run qi as effective user, the file
296 ‘${sysconfdir}/qirc’ could be copied to ‘${HOME}/.qirc’ setting the
297 paths for ‘${packagedir}’ and ‘${targetdir}’ according to the ‘$HOME’.
300 File: qi.info, Node: Packages, Next: Recipes, Prev: The qirc file, Up: Top
305 A package is a suite of programs usually distributed in binary form
306 which may also contain manual pages, documentation, or any other file
307 associated to a specific software.
309 The package format used by qi is a simplified POSIX pax archive
310 compressed using lzip(1). The file extension for packages ends in
313 Both package installation and package de-installation are managed using
314 two important (internal) variables: ‘${packagedir}’ and ‘${targetdir}’,
315 these values can be changed in the configuration file or via options.
317 ‘${packagedir}’ is a common directory tree where the package contents
318 will be decompressed (will reside).
320 ‘${targetdir}’ is a target directory where the links will be made by
321 graft(1) taking ‘${packagedir}/package_name’ into account.
323 Packages are installed in self-contained directory trees and symbolic
324 links from a common area are made to the package files. This allows
325 multiple versions of the same package to coexist on the same system.
327 4.1 Package conflicts
328 =====================
330 All the links to install or remove a package are handled by graft(1).
331 Since multiple packages can be installed or removed at the same time,
332 certain conflicts may arise between the packages.
334 graft(2) defines a CONFLICT as one of the following conditions:
336 • If the package object is a directory and the target object exists
337 but is not a directory.
339 • If the package object is not a directory and the target object
340 exists and is not a symbolic link.
342 • If the package object is not a directory and the target object
343 exists and is a symbolic link to something other than the package
346 The default behavior of qi for an incoming package is to ABORT if a
347 conflict arises. When a package is going to be deleted, qi tells to
348 graft(1) to remove those parts that are not in conflict, leaving the
349 links to the belonging package. This behavior can be forced if the
350 –prune option is given.
352 4.2 Installing packages
353 =======================
355 To install a single package, simply type:
357 qi install coreutils_8.30_i586-1@tools.tlz
359 To install multiple packages at once, type:
361 qi install gcc_8.3.0_i586-1@devel.tlz rafaela_2.2_i586-1@legacy.tlz ...
363 Warn about the files that will be linked:
365 qi warn bash_5.0_i586-1@shells.tlz
367 This is to verify the content of a package before installing it.
369 See the process of an installation:
371 qi install --verbose mariana_3.0_i586-1@woman.tlz
373 A second –verbose or -v option gives more (very verbose).
375 Installing package in a different location:
377 qi install --rootdir=/media/floppy lzip_1.21_i586-1@compressors.tlz
379 Important: the –rootdir option assumes ‘${targetdir}’ and
380 ‘${packagedir}’. See the following example:
382 qi install --rootdir=/home/selk lzip_1.21_i586-1@compressors.tlz
384 The content of "lzip_1.21_i586-1@compressors.tlz" will be
385 decompressed into ‘/home/selk/pkgs/lzip_1.21_i586-1@compressors’.
386 Assuming that the main binary for lzip is under
387 ‘/home/selk/pkgs/lzip_1.21_i586-1@compressors/usr/bin/’ the target for
388 "usr/bin" will be created at ‘/home/selk’. Considering that you have
389 exported the ‘PATH’ as ‘${HOME}/usr/bin’, now the system is able to see
390 the recent lzip command.
392 Installing from a list of packages using standard input:
394 qi install - < PACKAGELIST.txt
396 Or in combination with another tool:
397 sort -u PACKAGELIST.txt | qi install -
399 The sort command will read and sorts the list of declared packages,
400 while trying to have unique entries for each statement. The output
401 produced is captured by Qi to install each package.
403 An example of a list containing package names is:
404 /var/cache/qi/packages/amd64/tcl_8.6.9_amd64-1@devel.tlz
405 /var/cache/qi/packages/amd64/tk_8.6.9.1_amd64-1@devel.tlz
406 /var/cache/qi/packages/amd64/vala_0.42.3_amd64-1@devel.tlz
408 4.3 Removing packages
409 =====================
411 To remove a package, simply type:
413 qi remove xz_5.2.4_i586-1@compressors.tlz
415 Remove command will match the package name using ‘${packagedir}’ as
416 prefix. For example, if the value of ‘${packagedir}’ has been set to
417 /usr/pkg, this will be equal to:
419 qi remove /usr/pkg/xz_5.2.4_i586-1@compressors
423 qi remove --verbose /usr/pkg/xz_5.2.4_i586-1@compressors
425 A second –verbose or -v option gives more (very verbose).
427 By default the remove command does not preserve a package directory
428 after removing its links from ‘${targetdir}’, but this behavior can be
429 changed if the –keep option is passed:
431 qi remove --keep /usr/pkg/lzip_1.21_i586-1@compressors
433 This means that the links to the package can be reactivated, later:
435 cd /usr/pkg && graft -i lzip_1.21_i586-1@compressors
437 Removing package from a different location:
439 qi remove --rootdir=/home/cthulhu xz_5.2.4_i586-1@compressors
441 Removing a package using standard input:
443 echo vala_0.42.3_amd64-1@devel | qi remove -
445 This will match with the package directory.
447 4.4 Upgrading packages
448 ======================
450 The upgrade command inherits the properties of the installation and
451 removal process. To make sure that a package is updated, the package is
452 installed in a temporary directory taking ‘${packagedir}’ into account.
453 Once the incoming package is pre-installed, qi can proceed to search and
454 delete packages that have the same name (considered as previous ones).
455 Finally, the package is re-installed at its final location and the
456 temporary directory is removed.
458 Since updating a package can be crucial and so to perform a
459 successful upgrade, from start to finish, you will want to ignore some
460 important system signals during the upgrade process, those signals are
461 SIGHUP, SIGINT, SIGQUIT, SIGABRT, and SIGTERM.
463 To upgrade a package, just type:
465 qi upgrade gcc_9.0.1_i586-1@devel.tlz
467 This will proceed to upgrade "gcc_9.0.1_i586-1@devel" removing any
468 other version of "gcc" (if any).
470 If you want to keep the package directories of versions found during the
471 upgrade process, just pass:
473 qi upgrade --keep gcc_9.0.1_i586-1@devel.tlz
475 To see the upgrade process:
477 qi upgrade --verbose gcc_9.0.1_i586-1@devel.tlz
479 A second –verbose or -v option gives more (very verbose).
481 To force the upgrade of an existing package:
483 qi upgrade --force gcc_9.0.1_i586-1@devel.tlz
485 4.4.1 Package blacklist
486 -----------------------
488 To implement general package facilities, either to install, remove or
489 maintain the hierarchy of packages in a clean manner, qi makes use of
490 the pruning operation via graft(1) by default:
492 There is a risk if those are crucial packages for the proper
493 functioning of the system, because it implies the deactivation of
494 symbolic from the target directory, _especially_ when transitioning an
495 incoming package into its final location during an upgrade.
497 A blacklist of package names has been devised for the case where a user
498 decides to upgrade all the packages in the system, or just the crucial
499 ones, such as the C library.
501 The blacklist is related to the upgrade command only, consists in
502 installing a package instead of updating it or removing previous
503 versions of it; the content of the package will be updated over the
504 existing content at ‘${packagedir}’, while the existing links from
505 ‘${targetdir}’ will be preserved. A pruning of links will be carried
506 out in order to re-link possible differences with the recent content,
507 this helps to avoid leaving dead links in the target directory.
509 Package names for the blacklist to be declared must be set from the
510 configuration file. By default, it is declared using the package name,
511 which is more than enough for critical system packages, but if you want
512 to be more specific, you can declare a package using:
513 ‘${pkgname}_${pkgversion}_${arch}-${release}’ where the package category
514 is avoided for common matching. See *note Special variables: Recipes.
515 for a description of these variables.
517 ---------- Footnotes ----------
519 (1) For more details about tarlz and the lzip format, visit
520 <https://lzip.nongnu.org/tarlz.html>.
522 (2) The official guide for Graft can be found at
523 <https://peters.gormand.com.au/Home/tools/graft/graft.html>.
526 File: qi.info, Node: Recipes, Next: Order files, Prev: Packages, Up: Top
531 A recipe is a file telling qi what to do. Most often, the recipe tells
532 qi how to build a binary package from a source tarball.
534 A recipe has two parts: a list of variable definitions and a list of
535 sections. By convention, the syntax of a section is:
542 The section name is followed by parentheses, one newline and an
543 opening brace. The line finishing the section contains just a closing
544 brace. The section names or the function names currently recognized are
547 The ‘build’ section (or *shell function*) is an augmented shell
548 script that contains the main instructions to build software from
551 If there are other functions defined by the packager, Qi detects them
557 A "variable" is a *shell variable* defined either in ‘qirc’ or in a
558 recipe to represent a string of text, called the variable’s "value".
559 These values are substituted by explicit request in the definitions of
560 other variables or in calls to external commands.
562 Variables can represent lists of file names, options to pass to
563 compilers, programs to run, directories to look in for source files,
564 directories to write output to, or anything else you can imagine.
566 Definitions of variables in qi have four levels of precedence.
567 Options which define variables from the command-line override those
568 specified in the ‘qirc’ file, while variables defined in the recipe
569 override those specified in ‘qirc’, taking priority over those variables
570 set by command-line options. Finally, the variables have default values
571 if they are not defined anywhere.
573 Options that set variables through the command-line can only
574 reference variables defined in ‘qirc’ and variables with default values.
576 Definitions of variables in ‘qirc’ can only reference variables
577 previously defined in ‘qirc’ and variables with default values.
579 Definitions of variables in the recipe can only reference variables
580 set by the command-line, variables previously defined in the recipe,
581 variables defined in ‘qirc’, and variables with default values.
583 5.2 Special variables
584 =====================
586 There are variables which can only be set using the command line options
587 or via ‘qirc’, there are other special variables which can be defined or
588 redefined in a recipe. See the following definitions:
590 ‘outdir’ is the directory where the packages produced are written.
591 This variable can be redefined per-recipe. Default sets to
592 ‘/var/cache/qi/packages’.
594 ‘worktree’ is the working tree where archives, patches, and recipes
595 are expected. This variable can not be redefined in the recipe.
596 Default sets to ‘/usr/src/qi’.
598 ‘tardir’ is defined in the recipe to the directory where the tarball
599 containing the source can be found. The full name of the tarball is
600 composed as ‘${tardir}/$tarname’. Its value is available in the recipe
601 as ‘${tardir}’; a value of . for ‘tardir’ sets it to the value of CWD
602 (Current Working Directory), this is where the recipe lives.
604 ‘arch’ is the architecture to compose the package name. Its value is
605 available in the recipe as ‘${arch}’. Default value is the one that was
606 set in the Qi configuration.
608 ‘jobs’ is the number of parallel jobs to pass to the compiler. Its
609 value is available in the recipe as ‘${jobs}’. The default value is 1.
611 The two variables ‘${srcdir}’ and ‘${destdir}’ can be set in the
612 recipe, as any other variable, but if they are not, qi uses default
613 values for them when building a package.
615 ‘srcdir’ contains the source code to be compiled, and defaults to
616 ‘${program}-${version}’. ‘destdir’ is the place where the built package
617 will be installed, and defaults to ‘${TMPDIR}/package-${program}’.
619 If ‘pkgname’ is left undefined, the special variable ‘program’ is
620 assigned by default. If ‘pkgversion’ is left undefined, the special
621 variable ‘version’ is assigned by default.
623 ‘pkgname’ and ‘pkgversion’ along with: ‘version’, ‘arch’, ‘release’,
624 and (optionally) ‘pkgcategory’ are used to produce the package name in
626 ‘${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}].tlz’
628 ‘pkgcategory’ is an optional special variable that can be defined on
629 the recipe to categorize the package name. If it is defined, then the
630 package output will be composed as
631 ‘${pkgname}_${pkgversion}_${arch}-${release}[@${pkgcategory}.tlz’.
632 Automatically, the value of ‘pkgcategory’ will be prefixed using the ‘@’
633 (at) symbol which will be added to the last part of the package name.
635 A special variable called ‘replace’ can be used to declare package
636 names that will be replaced at installation time.
638 The special variables ‘keep_srcdir’ and ‘keep_destdir’ are provided
639 in order to preserve the directories ‘${srcdir}’ or ‘${destdir}’, if
640 those exists as such. Note: The declaration of these variables are
641 subject to manual deactivation; its purpose in recipes is to preserve
642 the directories that relate to the package’s build (source) and
643 destination directory, that is so that another recipe can get a new
644 package (or meta package) from there. For example, the declarations can
647 keep_srcdir=keep_srcdir
648 keep_destdir=keep_destdir
650 Then from another recipe you would proceed to copy the necessary
651 files that will compose the meta package, from the main function you
652 must deactivate the variables at the end:
654 unset -v keep_srcdir keep_destdir
656 This will leave the ’keep_srcdir’ and ’keep_destdir’ variables blank
657 to continue with the rest of the recipes.
659 The special variable ‘opt_skiprecipe’ is available when you need to
660 ignore a recipe cleanly, continuing with the next recipe. May you add a
661 conditional test then set it as ‘opt_skiprecipe=opt_skiprecipe’.
663 The variable ‘tarlz_compression_options’ can be used to change the
664 default compression options in tarlz(1), default sets to ‘-9 --solid’.
665 For example if the variable is declared as:
667 tarlz_compression_options="-0 --bsolid"
669 It will change the granularity of tarlz(1) by using the ‘--bsolid’
670 option (1), as well as increasing the compression speed by lowering the
671 compression level with ‘-0’.
673 This is only recommended for recipes where testing, or faster
674 processing is desired to create the packaged file more quickly. It is
675 not recommended for production or general distribution of binary
678 A typical recipe contains the following variables:
680 • ‘program’: Software name.
682 It matches the source name. It is also used to compose the name of
683 the package if ‘${pkgname}’ is not specified.
685 • ‘version’: Software version.
687 It matches the source name. It is also used to compose the version
688 of the package if ‘${pkgversion}’ is not specified.
690 • ‘arch’: Software architecture.
692 It is used to compose the architecture of the package in which it
695 • ‘release’: Release number.
697 This is used to reflect the release number of the package. It is
698 recommended to increase this number after any significant change in
699 the recipe or post-install script.
701 • ‘pkgcategory’: Package category.
703 Optional but recommended variable to categorize the package name
706 Obtaining sources over the network must be declared in the recipe using
707 the ‘fetch’ variable.
709 The variables ‘netget’ and ‘rsync’ can be defined in ‘qirc’ to
710 establish a network downloader in order to get the sources. If they are
711 not defined, qi uses default values:
713 ‘netget’ is the general network downloader tool, defaults sets to
714 ‘wget2 -c -w1 -t3 --no-check-certificate’.
716 ‘rsync’ is the network tool for sources containing the prefix for the
717 RSYNC protocol, default sets to ‘rsync -v -a -L -z -i --progress’.
719 The variable ‘description’ is used to print the package description
720 when a package is installed.
722 A description has two parts: a brief description, and a long
723 description. By convention, the syntax of ‘description’ is:
731 The first line of the value represented is a brief description of the
732 software (called "blurb"). A blank line separates the _brief
733 description_ from the _long description_, which should contain a more
734 descriptive description of the software.
736 An example looks like:
739 The GNU core utilities.
741 The GNU core utilities are the basic file, shell and text manipulation
742 utilities of the GNU operating system. These are the core utilities
743 which are expected to exist on every operating system.
746 Please consider a length limit of 78 characters as maximum, because
747 the same one would be used on the meta file creation. See *note The
748 meta file: Recipes. section.
750 The ‘homepage’ variable is used to declare the main site or home
753 homepage=https://www.gnu.org/software/gcc
755 The variable ‘license’ is used for license information(2). Some code
756 in the program can be covered by license A, license B, or license C. For
757 "separate licensing" or "heterogeneous licensing", we suggest using *|*
758 for a disjunction, *&* for a conjunction (if that ever happens in a
759 significant way), and comma for heterogeneous licensing. Comma would
760 have lower precedence, plus added special terms.
762 license="LGPL, GPL | Artistic - added permission"
767 Originally, Qi was designed for the series of Dragora GNU/Linux-Libre 3;
768 this doesn’t mean you can’t use it in another distribution, just that if
769 you do, you’ll have to try it out for yourself. To help with this, here
770 are some references to well-written recipes:
772 • <https://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes>
773 • <https://notabug.org/dragora/dragora/src/master/recipes>
774 • <https://notabug.org/dragora/dragora-extras/src/master/recipes>
776 <https://git.savannah.nongnu.org/cgit/dragora/dragora-extras.git/tree/recipes>
778 5.4 Building packages
779 =====================
781 A recipe is any valid regular file. Qi sets priorities for reading a
782 recipe, the order in which qi looks for a recipe is:
784 1. Current working directory.
786 2. If the specified path name does not contain "recipe" as the last
787 component. Qi will complete it by adding "recipe" to the path
790 3. If the recipe is not in the current working directory, it will be
791 searched under ‘${worktree}/recipes’. The last component will be
792 completed adding "recipe" to the specified path name.
794 To build a single package, type:
796 qi build x-apps/xterm
798 Multiple jobs can be passed to the compiler to speed up the build
801 qi build --jobs 3 x-apps/xterm
803 Update or install the produced package (if not already installed) when
804 the build command ends:
806 qi build -j3 --upgrade x-apps/xterm
808 Only process a recipe but do not create the binary package:
810 qi build --no-package dict/aspell
812 The options –install or –upgrade have no effect when –no-package is
815 This is useful to inspect the build process of the above recipe:
817 qi build –keep –no-package dict/aspell 2>&1 | tee aspell-log.txt
819 The –keep option could preserve the source directory and the
820 destination directory for later inspection. A log file of the build
821 process will be created redirecting both, standard error and standard
824 5.5 Variables from the environment
825 ==================================
827 Qi has environment variables which can be used at build time:
829 The variable ‘TMPDIR’ sets the temporary directory for sources, which
830 is used for package extractions (see *note Examining packages::) and is
831 prepended to the value of ‘${srcdir}’ and ‘${destdir}’ in build command.
832 By convention its default value is equal to ‘/usr/src/qi/build’.
834 The variables ‘QICFLAGS’, ‘QICXXFLAGS’, ‘QILDFLAGS’, and ‘QICPPFLAGS’
835 have no effect by default. The environment variables such as ‘CFLAGS’,
836 ‘CXXFLAGS’, ‘LDFLAGS’, and ‘CPPFLAGS’ are unset at compile time:
838 Recommended practice is to set variables in the command line of
839 ‘configure’ or _make(1)_ instead of exporting to the environment. As
842 <https://www.gnu.org/software/make/manual/html_node/Environment.html>
843 It is not wise for makefiles to depend for their functioning on
844 environment variables set up outside their control, since this
845 would cause different users to get different results from the same
846 makefile. This is against the whole purpose of most makefiles.
848 Setting environment variables for configure is deprecated because
849 running configure in varying environments can be dangerous.
851 <https://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html>
852 Variables not defined in a site shell script can be set in the
853 environment passed to configure. However, some packages may run
854 configure again during the build, and the customized values of
855 these variables may be lost. In order to avoid this problem, you
856 should set them in the configure command line, using ‘VAR=value’.
859 ‘./configure CC=/usr/local2/bin/gcc’
861 <https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html>
862 If for instance the user runs ‘CC=bizarre-cc ./configure’, then the
863 cache, config.h, and many other output files depend upon bizarre-cc
864 being the C compiler. If for some reason the user runs ./configure
865 again, or if it is run via ‘./config.status --recheck’, (See
866 Automatic Remaking, and see config.status Invocation), then the
867 configuration can be inconsistent, composed of results depending
868 upon two different compilers. [...] Indeed, while configure can
869 notice the definition of CC in ‘./configure CC=bizarre-cc’, it is
870 impossible to notice it in ‘CC=bizarre-cc ./configure’, which,
871 unfortunately, is what most users do. [...] configure: error:
872 changes in the environment can compromise the build.
874 If the ‘SOURCE_DATE_EPOCH’ environment variable is set to a UNIX
875 timestamp (defined as the number of seconds, excluding leap seconds,
876 since 01 Jan 1970 00:00:00 UTC.); then the given timestamp will be used
877 to overwrite any newer timestamps on the package contents (when it is
878 created). More information about this can be found at
879 <https://reproducible-builds.org/specs/source-date-epoch/>.
884 The "meta file" is a regular file created during the build process, it
885 contains information about the package such as package name, package
886 version, architecture, release, fetch address, description, and other
887 minor data extracted from processed recipes. The name of the file is
888 generated as ‘${full_pkgname}.tlz.txt’, and its purpose is to reflect
889 essential information to the user without having to look inside the
890 package content. The file format is also intended to be used by other
891 scripts or by common Unix tools.
893 The content of a meta file looks like:
896 # Pattern scanning and processing language.
898 # The awk utility interprets a special-purpose programming language
899 # that makes it possible to handle simple data-reformatting jobs
900 # with just a few lines of code. It is a free version of 'awk'.
902 # GNU awk implements the AWK utility which is part of
903 # IEEE Std 1003.1 Shell and Utilities (XCU).
915 full_pkgname=gawk_5.0.1_amd64-1@tools
916 blurb="Pattern scanning and processing language."
917 homepage="https://www.gnu.org/software/gawk"
919 fetch="https://ftp.gnu.org/gnu/gawk/gawk-5.0.1.tar.lz"
922 A package descriptions is extracted from the variable ‘description’
923 where each line is interpreted literally and pre-formatted to fit in
924 (exactly) *80 columns*, plus the character ‘#’ and a blank space is
925 prefixed to every line (shell comments).
927 In addition to the Special variables, there are implicit variables such
930 The ‘blurb’ variable is related to the special variable
931 ‘description’. Its value is made from the first (substantial) line of
932 ‘description’, mentioned as the "brief description".
934 The build flags such as ‘QICFLAGS’, ‘QICXXFLAGS’, ‘QILDFLAGS’, and
935 ‘QICPPFLAGS’ are only added to the meta file if the declared variable
936 ‘arch’ is not equal to the "noarch" value.
938 ---------- Footnotes ----------
940 (1) About the ‘--bsolid’ granularity option of tarlz(1),
941 <https://www.nongnu.org/lzip/manual/tarlz_manual.html#g_t_002d_002dbsolid>.
943 (2) The proposal for ‘license’ was made by Richard M. Stallman at
944 <https://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html>.
947 File: qi.info, Node: Order files, Next: Creating packages, Prev: Recipes, Up: Top
952 The order command has the purpose of resolving the build order through
953 .order files. An order file contains a list of recipe names, by default
954 does not perform any action other than to print a resolved list in
955 descending order. For example, if *a* depends on *b* and *c*, and *c*
956 depends on *b* as well, the file might look like:
962 Each letter represents a recipe name, complete dependencies for the
963 first recipe name are listed in descending order, which is printed from
964 right to left, and removed from left to right:
972 Blank lines, colons and parentheses are simply ignored. Comment
973 lines beginning with ‘#’ are allowed.
975 An order file could be used to build a series of packages, for example,
978 # Image handling libraries
980 libs/libjpeg-turbo: devel/nasm
981 x-libs/jasper: libs/libjpeg-turbo
982 libs/tiff: libs/libjpeg-turbo
984 To proceed with each recipe, we can type:
986 qi order imglibs.order | qi build --install -
988 The output of ‘qi order imglibs.order’ tells to qi in which order it
989 should build the recipes:
997 File: qi.info, Node: Creating packages, Next: Examining packages, Prev: Order files, Up: Top
1002 The creation command is an internal function of qi to make new Qi
1003 compatible packages. A package is produced using the contents of the
1004 Current Working Directory and the package file is written out.
1006 Usage: qi create [OUTPUT/PACKAGENAME.TLZ]...
1008 The argument for the file name to be written must contain a fully
1009 qualified named directory as the output directory where the package
1010 produced will be written. The file name should be composed using the
1011 full name: name-version-architecture-release[@pkgcategory].tlz
1016 cd claws-mail_3.17.1_amd64-1@x-apps
1017 qi create /var/cache/qi/packages/claws-mail_3.17.1_amd64-1@x-apps
1019 In this case, the package "claws-mail_3.17.1_amd64-1@x-apps" will be
1020 written into ‘/var/cache/qi/packages/’.
1022 All packages produced are complemented by a checksum file (.sha256).
1025 File: qi.info, Node: Examining packages, Next: Qi exit status, Prev: Creating packages, Up: Top
1027 8 Examining packages
1028 ********************
1030 The extraction command serves to examine binary packages for debugging
1031 purposes. It decompresses a package into a single directory, verifying
1032 its integrity and preserving all of its properties (owner and
1035 Usage: qi extract [PACKAGENAME.TLZ]...
1039 qi extract mksh_R56c_amd64-1@shells.tlz
1041 This action will put the content of "mksh_R56c_amd64-1@shells.tlz"
1042 into a single directory, this is a private directory for the user who
1043 requested the action, creation operation will be equal to *u=rwx,g=,o=
1044 (0700)*. The package content will reside on this location, default mask
1045 to deploy the content will be equal to *u=rwx,g=rwx,o=rwx (0000)*.
1047 Note: the creation of the custom directory is influenced by the value of
1048 the ‘TMPDIR’ variable.
1051 File: qi.info, Node: Qi exit status, Next: Index, Prev: Examining packages, Up: Top
1056 All the exit codes are described in this chapter.
1059 Successful completion (no errors).
1062 Minor common errors:
1064 • Help usage on invalid options or required arguments.
1066 • Program needed by qi (prerequisite) is not available.
1069 Command execution error:
1071 This code is used to return the evaluation of an external command
1072 or shell arguments in case of failure.
1075 Integrity check error for compressed files.
1077 Compressed files means:
1079 • A tarball file from tar(1), typically handled by the GNU tar
1080 implementation. Supported extensions: .tar, .tar.gz, .tgz,
1081 .tar.Z, .tar.bz2, .tbz2, .tbz, .tar.xz, .txz, .tar.zst, .tzst
1083 • A tarball file from tarlz(1). Supported extensions: .tar.lz,
1086 • Zip files from unzip(1). Supported extensions: .zip, .ZIP
1088 • Gzip files from gzip(1). Supported extensions: .gz, .Z
1090 • Bzip2 files from bzip2(1). Supported extension: .bz2
1092 • Lzip files from lzip(1). Supported extension: .lz
1094 • Xz files from xz(1). Supported extension: .xz
1096 • Zstd files from zstd(1). Supported extension: .zst
1099 File empty, not regular, or expected.
1101 It’s commonly expected:
1103 • An argument for giving commands.
1105 • A regular file or readable directory.
1107 • An expected extension: .tlz, .sha256, .order.
1109 • A protocol supported by the network downloader tool.
1112 Empty or not defined variable:
1114 This code is used to report empty or undefined variables (usually
1115 variables coming from a recipe or assigned arrays that are tested).
1118 Package already installed:
1120 The package directory for an incoming .tlz package already exists.
1123 Network manager error:
1125 This code is used if the network downloader tool fails for some
1129 File: qi.info, Node: Index, Prev: Qi exit status, Up: Top
1137 * configuration file: The qirc file. (line 6)
1138 * environment variables: Recipes. (line 302)
1139 * exit codes: Qi exit status. (line 6)
1140 * handling build order: Order files. (line 6)
1141 * introduction to qi: Introduction to Qi. (line 6)
1142 * invocation: Invoking qi. (line 6)
1143 * managing packages: Packages. (line 6)
1144 * package blacklist: Packages. (line 189)
1145 * package build: Recipes. (line 256)
1146 * package conflicts: Packages. (line 31)
1147 * package creation: Creating packages. (line 6)
1148 * package de-installation: Packages. (line 112)
1149 * package examination: Examining packages. (line 6)
1150 * package installation: Packages. (line 56)
1151 * package upgrade: Packages. (line 151)
1152 * recipes: Recipes. (line 6)
1153 * special variables: Recipes. (line 61)
1154 * the meta file: Recipes. (line 359)
1155 * variables: Recipes. (line 32)
1156 * writing recipes: Recipes. (line 242)
1162 Node: Introduction to Qi
\x7f1549
1163 Node: Invoking qi
\x7f2753
1164 Node: The qirc file
\x7f7862
1165 Node: Packages
\x7f8862
1166 Ref: Packages-Footnote-1
\x7f16996
1167 Ref: Packages-Footnote-2
\x7f17098
1168 Node: Recipes
\x7f17212
1169 Ref: Recipes-Footnote-1
\x7f34349
1170 Ref: Recipes-Footnote-2
\x7f34490
1171 Node: Order files
\x7f34640
1172 Node: Creating packages
\x7f35969
1173 Node: Examining packages
\x7f36961
1174 Node: Qi exit status
\x7f37883
1175 Node: Index
\x7f39954