qi.info 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. This is qi.info, produced by makeinfo version 6.5 from qi.texi.
  2. This user guide is for Qi (version 1.3, 10 Sep 2019), which is a simple
  3. but well-integrated package manager.
  4. Copyright © 2019 Matias Andres Fonzo, Santiago del Estero, Argentina.
  5. Permission is granted to copy, distribute and/or modify this
  6. document under the terms of the GNU Free Documentation License,
  7. Version 1.3 or any later version published by the Free Software
  8. Foundation; with no Invariant Sections, with no Front-Cover Texts,
  9. and with no Back-Cover Texts. A copy of the license is included in
  10. the section entitled "GNU Free Documentation License".
  11. INFO-DIR-SECTION Package management
  12. START-INFO-DIR-ENTRY
  13. * Qi: (qi). A user-friendly package manager.
  14. END-INFO-DIR-ENTRY
  15. 
  16. File: qi.info, Node: Top, Next: Introduction, Up: (dir)
  17. Qi user guide
  18. *************
  19. This user guide is for Qi (version 1.3, 10 Sep 2019).
  20. * Menu:
  21. * Introduction:: Description and features of qi
  22. * Invoking qi:: Command-line options
  23. * The qirc file:: Configuration file
  24. * Packages:: Managing packages
  25. * Recipes:: Building packages
  26. * Order files:: Handling build order
  27. * Creating packages:: Making Qi packages
  28. * Examining packages:: Debugging purposes
  29. * Exit status:: Exit codes
  30. * Index::
  31. Copyright (C) 2019 Matias Fonzo.
  32. Qi's home page can be found at <http://www.dragora.org>.
  33. Send bug reports or suggestions to <dragora-users@nongnu.org>.
  34. 
  35. File: qi.info, Node: Introduction, Next: Invoking qi, Prev: Top, Up: Top
  36. 1 Introduction
  37. **************
  38. Qi is a simple but well-integrated package manager. It can create,
  39. install, remove, and upgrade software packages. Qi produces binary
  40. packages using recipes, which are files containing specific instructions
  41. to build each package from source. Qi can manage multiple packages
  42. under a single directory hierarchy. This method allows to maintain a
  43. set of packages and multiple versions of them. This means that Qi could
  44. be used as the main package manager or complement the existing one.
  45. Qi offers a friendly command line interface, a global configuration
  46. file, a simple recipe layout to deploy software packages; also works
  47. with binary packages in parallel, speeding up installations and packages
  48. in production. The format used for packages is a simplified but safe
  49. POSIX pax archive compressed with lzip.
  50. Qi is a modern (POSIX-compliant) shell script released under the
  51. terms of the GNU General Public License. There are only two major
  52. dependencies for the magic: graft(1) and tarlz(1), the rest is expected
  53. to be found in any Unix-like system.
  54. 
  55. File: qi.info, Node: Invoking qi, Next: The qirc file, Prev: Introduction, Up: Top
  56. 2 Invoking qi
  57. *************
  58. This chapter describes the synopsis and command line options for invoke
  59. Qi.
  60. Usage: qi [OPTION]... [FILE]...
  61. One mandatory option specifies the operation that 'qi' should perform,
  62. other options are meant to detail how this operation should be
  63. performed.
  64. qi supports the following options to operate:
  65. '-b'
  66. Build package using recipe names.
  67. '-c'
  68. Create .tlz package from directory.
  69. '-d'
  70. Delete packages.
  71. '-i'
  72. Install packages.
  73. '-o'
  74. Resolve build order through .order files.
  75. '-u'
  76. Update packages (implies -i, -d and -p options).
  77. '-w'
  78. Warn about files that will be linked.
  79. '-x'
  80. Extract a package for debugging purposes.
  81. There are common options between modes:
  82. '-N'
  83. Do not read the configuration file.
  84. This will ignore any value in the qirc file.
  85. '-P <DIR>'
  86. Package directory for installations.
  87. This option sets '${packagedir}'.
  88. Only valid for -i, -d, or -u options.
  89. '-f'
  90. Force option.
  91. This option can force the build of a recipe, or force the update of
  92. a pre-existing package.
  93. Only valid for -b, -u options.
  94. '-t <DIR>'
  95. Target directory for symbolic links.
  96. This option sets '${targetdir}'.
  97. Only valid for -i, -d, or -u options.
  98. '-k'
  99. Keep (don't delete) '${srcdir}' or '${destdir}' in build mode, keep
  100. (don't delete) package directory in delete mode.
  101. Only valid for -b, -d or -u options.
  102. '-p'
  103. Prune conflicts on package installations.
  104. This option may proceed with the package installation if one or
  105. more conflicts occur.
  106. '-r /rootdir'
  107. Use the fully qualified named directory as the root directory for
  108. all qi operations. The target directory and package directory will
  109. be relative to the specified directory, including the log file for
  110. graft.
  111. '-v'
  112. Be verbose (a 2nd -v gives more).
  113. Options for build mode (-b):
  114. '-O <DIR>'
  115. Where the packages produced are written.
  116. This option sets '${outdir}'.
  117. '-W <DIR>'
  118. Where archives, patches, and recipes are expected.
  119. This option sets '${worktree}'.
  120. '-Z <DIR>'
  121. Where (compressed) sources will be found.
  122. This option sets '${tardir}'.
  123. '-a'
  124. Architecture to use.
  125. Default value is obtained via uname(1) as 'uname -m'.
  126. '-j'
  127. Parallel jobs for the compiler.
  128. If not specified, default sets to 1.
  129. '-1'
  130. Increment release number ('${release}' + 1).
  131. It will be omitted if the -n option is being used.
  132. '-n'
  133. Don't create a .tlz package.
  134. '-S'
  135. Selects the option to skip completed recipes.
  136. This means, in interactive mode, when the dialog to summarize
  137. recipes is shown.
  138. Informative options:
  139. '-L'
  140. Print default directory locations.
  141. This will print the target directory, package directory, working
  142. tree, the directory for tarballs, and the output directory for the
  143. packages produced.
  144. '-h'
  145. Display the help describing the options and then exit.
  146. '-V'
  147. Print the version number and license information. The version
  148. number should be included in all bug reports.
  149. Expected non-option arguments are package directories and regular files:
  150. recipes or files ending in .tlz, .order. When FILE is -, qi can read
  151. from the standard input. See examples in *note Packages::.
  152. 
  153. File: qi.info, Node: The qirc file, Next: Packages, Prev: Invoking qi, Up: Top
  154. 3 The qirc file
  155. ***************
  156. The global 'qirc' file offers a way to define variables and tools (such
  157. as a download manager) for default use. This file is used by qi at
  158. runtime, e.g., to build, install, remove or upgrade packages.
  159. It has the following rules:
  160. * Variables must be declared as 'name=value'.
  161. * Declaration of values should only take one line, no line break.
  162. * For security reasons, assignments like 'name=$var' are only
  163. interpreted as literal.
  164. The command line options related to the package directory and target
  165. directory plus some of the options used for the build mode can override
  166. some values in 'qirc'. See *note Invoking qi::.
  167. The order in which qi looks for this file is:
  168. 1. '${HOME}/.qirc' Effective user.
  169. 2. '${sysconfdir}/qirc' System-wide.
  170. If you intend to run qi as effective user, the file
  171. '${sysconfdir}/qirc' could be copied to '${HOME}/.qirc' setting the
  172. paths for '${packagedir}' and '${targetdir}' according to the '$HOME'.
  173. 
  174. File: qi.info, Node: Packages, Next: Recipes, Prev: The qirc file, Up: Top
  175. 4 Packages
  176. **********
  177. A package is a suite of programs usually distributed in binary form
  178. which may also contain manual pages, documentation, or any other file
  179. associated to a specific software.
  180. The package format used by qi is a simplified POSIX pax archive
  181. compressed with lzip. The file extension for packages is '.tlz'.
  182. Both package installation and package de-installation are managed using
  183. two important (internal) variables: '${packagedir}' and '${targetdir}',
  184. these values can be changed in the configuration file or via options.
  185. '${packagedir}' is a common directory tree where the package contents
  186. will be decompressed (will reside).
  187. '${targetdir}' is a target directory where the links will be made by
  188. graft(1) taking '${packagedir}/package_name' into account.
  189. Packages are installed in self-contained directory trees and symbolic
  190. links from a common area are made to the package files. This allows
  191. multiple versions of the same package to coexist on the same system.
  192. 4.1 Package conflicts
  193. =====================
  194. All the links to install or remove a package are handled by graft(1).
  195. Since multiple packages can be installed or removed at the same time,
  196. certain conflicts may arise between the packages.
  197. graft(1) defines a CONFLICT as one of the following conditions:
  198. * If the package object is a directory and the target object exists
  199. but is not a directory.
  200. * If the package object is not a directory and the target object
  201. exists and is not a symbolic link.
  202. * If the package object is not a directory and the target object
  203. exists and is a symbolic link to something other than the package
  204. object.
  205. The default behavior of qi for an incoming package is to ABORT if a
  206. conflict arises. When a package is going to be deleted, qi tells to
  207. graft(1) to remove those parts that are not in conflict, leaving the
  208. links to the belonging package. This behavior can be forced if the -p
  209. option is given.
  210. 4.2 Installing packages
  211. =======================
  212. To install a single package, simply type:
  213. qi -i coreutils-8.30-i586+1.tlz
  214. To install multiple packages at once, type:
  215. qi -i gcc-8.3.0-i586+1.tlz rafaela-2.2-i586+1.tlz ...
  216. Warn about the files that will be linked:
  217. qi -w bash-5.0-i586+1.tlz
  218. This is to verify the content of a package before installing it.
  219. See the process of an installation (very verbose):
  220. qi -i -v mariana-3.0-i586+1.tlz
  221. A second -v gives more.
  222. Installing package in a different location:
  223. qi -r /media/floppy -i lzip-1.21-i586+1.tlz
  224. The -r option assumes '${targetdir}' and '${packagedir}'. See:
  225. qi -r /home/selk -P /pkgs -t / -i lzip-1.21-i586+1.tlz
  226. In this case the content of "lzip-1.21-i586+1.tlz" will be
  227. decompressed into '/home/selk/pkgs/lzip-1.21-i586+1'. Assuming that the
  228. main binary for lzip is under
  229. '/home/selk/pkgs/lzip-1.21-i586+1/usr/bin/' the target for "usr/bin"
  230. will be created at '/home/selk'. Considering that you have exported the
  231. 'PATH' as '${HOME}/usr/bin', now the system is able to see the recent
  232. lzip.
  233. Installing from a list of packages using standard input:
  234. cat FILELIST.txt | qi -i -
  235. The list of packages must contain full path names to be passed in the
  236. installation, e.g.:
  237. /var/cache/qi/packages/x86_64/devel/tcl-8.6.9-x86_64+1.tlz
  238. /var/cache/qi/packages/x86_64/devel/tk-8.6.9.1-x86_64+1.tlz
  239. /var/cache/qi/packages/x86_64/devel/vala-0.42.3-x86_64+1.tlz
  240. 4.3 Removing packages
  241. =====================
  242. To remove a package, simply type:
  243. qi -d xz-5.2.4-i586+1.tlz
  244. Delete mode will match the package name using '${packagedir}' as prefix.
  245. For example, if the value of '${packagedir}' is set to /usr/local/pkgs,
  246. this will be equal to:
  247. qi -d /usr/local/pkgs/xz-5.2.4-i586+1
  248. Detailed output (very verbose):
  249. qi -d -v /usr/local/pkgs/xz-5.2.4-i586+1
  250. A second -v gives more.
  251. By default the delete mode does not preserve a package directory after
  252. removing its links from '${targetdir}', but this behavior can be changed
  253. if the -k option is passed:
  254. qi -d -k /usr/local/pkgs/lzip-1.21-i586+1
  255. This means that the links to the package can be reactivated, later:
  256. cd /usr/local/pkgs && graft -i lzip-1.21-i586+1
  257. Removing package from a different location:
  258. qi -r /home/cthulhu -P /pkgs -t / -d xz-5.2.4-i586+1
  259. Removing a package using standard input:
  260. echo "vala-0.42.3-x86_64+1" | qi -d -
  261. This will match with the package directory.
  262. 4.4 Upgrading packages
  263. ======================
  264. The upgrade mode inherits the properties of the installation and removal
  265. process. To make sure that a package is updated, the package is
  266. installed in a temporary directory taking '${packagedir}' into account.
  267. Once the incoming package is pre-installed, qi can proceed to search and
  268. delete packages that have the same name (considered as previous ones).
  269. Finally, the package is re-installed at its final location and the
  270. temporary directory is removed.
  271. To upgrade a package, just type:
  272. qi -u gcc-9.0.1-i586+1.tlz
  273. This will proceed to update "gcc-9.0.1-i586+1" removing other
  274. versions of "gcc" (if any).
  275. If you want to keep the package directories of versions found during the
  276. upgrade process, just pass:
  277. qi -u -k gcc-9.0.1-i586+1.tlz
  278. To see the upgrade process (very verbose):
  279. qi -u -v gcc-9.0.1-i586+1.tlz
  280. A second -v gives more.
  281. To force the upgrade of an existing package:
  282. qi -u -f gcc-9.0.1-i586+1.tlz
  283. 4.4.1 Package blacklist
  284. -----------------------
  285. To implement general package facilities, either to install, remove or
  286. maintain the hierarchy of packages in a clean manner, qi makes use of
  287. the pruning operation via graft(1):
  288. There is a risk if those are crucial packages for the proper
  289. functioning of the system, because it implies the deactivation of
  290. symbolic from the target directory, _especially_ when transitioning an
  291. incoming package into its final location during upgrade.
  292. A blacklist of package names has been devised for the case where a user
  293. decides to upgrade all packages in the system, or just the crucial ones,
  294. such as the C library.
  295. The blacklist is related to the upgrade mode only, consists in
  296. installing a package instead of updating it or removing previous
  297. versions of it; the content of the package will be updated over the
  298. existing content at '${packagedir}', while the existing links from
  299. '${targetdir}' will be preserved. A pruning of links will be carried
  300. out in order to re-link possible differences with the recent content,
  301. this helps to avoid leaving dead links in the target directory.
  302. Since the upgrade mode is also used to install a new package, the
  303. mechanism for blacklist is to install a declared package if it does not
  304. already exist. If it already exists, it is verified that the binary
  305. package is newer than the package directory in order to perform an
  306. update.
  307. Package names for the blacklist can be set from the configuration
  308. file.
  309. ---------- Footnotes ----------
  310. (1) The official guide for Graft can be found at
  311. <http://peters.gormand.com.au/Home/tools/graft/graft.html>.
  312. 
  313. File: qi.info, Node: Recipes, Next: Order files, Prev: Packages, Up: Top
  314. 5 Recipes
  315. *********
  316. A recipe is a file telling qi what to do. Most often, the recipe tells
  317. qi how to build a binary package from a source tarball.
  318. A recipe has two parts: a list of variable definitions and a list of
  319. sections. By convention, the syntax of a section is:
  320. section_name()
  321. {
  322. section lines
  323. }
  324. The section name is followed by parentheses, one newline and an
  325. opening brace. The line finishing the section contains just a closing
  326. brace. The section names or the function names currently recognized are
  327. 'build'.
  328. The 'build' section is an augmented shell script. This is the main
  329. section (or *shell function*) which contains the instructions to build
  330. and produce a package.
  331. 5.1 Variables
  332. =============
  333. A "variable" is a *shell variable* defined either in 'qirc' or in a
  334. recipe to represent a string of text, called the variable's "value".
  335. These values are substituted by explicit request in the definitions of
  336. other variables or in calls to external commands.
  337. Variables can represent lists of file names, options to pass to
  338. compilers, programs to run, directories to look in for source files,
  339. directories to write output to, or anything else you can imagine.
  340. Definitions of variables in qi have four levels of precedence.
  341. Options which define variables from the command-line override those
  342. specified in the 'qirc' file, while variables defined in the recipe
  343. override those specified in 'qirc', taking priority over those variables
  344. set by command-line options. Finally, the variables have default values
  345. if they are not defined anywhere.
  346. Options that set variables through the command-line can only
  347. reference variables defined in 'qirc' and variables with default values.
  348. Definitions of variables in 'qirc' can only reference variables
  349. previously defined in 'qirc' and variables with default values.
  350. Definitions of variables in the recipe can only reference variables
  351. set by the command-line, variables previously defined in the recipe,
  352. variables defined in 'qirc', and variables with default values.
  353. 5.2 Special variables
  354. =====================
  355. There are variables which can only be set using the command line options
  356. or via 'qirc', there are other special variables which can be defined or
  357. redefined in a recipe. See the following definitions:
  358. 'outdir' is the directory where the packages produced are written.
  359. This variable can not be redefined in the recipe. Default sets to
  360. '/var/cache/qi/packages'.
  361. 'worktree' is the working tree where archives, patches, and recipes
  362. are expected. This variable can not be redefined in the recipe.
  363. Default sets to '/usr/src/qi'.
  364. 'tardir' is defined in the recipe to the directory where the tarball
  365. containing the source can be found. The full name of the tarball is
  366. composed as '${tardir}/$tarname'. Its value is available in the recipe
  367. as '${tardir}'; a value of . for 'tardir' sets it to the value of CWD
  368. (Current Working Directory), this is where the recipe lives.
  369. 'arch' is the architecture to compose the package name. Its value is
  370. available in the recipe as '${arch}'. Default value is the output of
  371. 'uname -m'.
  372. 'jobs' is the number of parallel jobs to pass to the compiler. Its
  373. value is available in the recipe as '${jobs}'. The default value is 1.
  374. The two variables '${srcdir}' and '${destdir}' can be set in the
  375. recipe, as any other variable, but if they are not, qi uses default
  376. values for them when building a package.
  377. 'srcdir' contains the source code to be compiled, and defaults to
  378. '${program}-${version}'. 'destdir' is the place where the built package
  379. will be installed, and defaults to '${TMPDIR}/package-${program}'.
  380. If 'pkgname' is left undefined, the special variable 'program' is
  381. assigned by default. If 'pkgversion' is left undefined, the special
  382. variable 'version' is assigned by default.
  383. 'pkgname' and 'pkgversion' along with: 'version', 'arch', and
  384. 'release' are used to produce the name of the package in the form:
  385. '${pkgname}-${pkgversion}-${arch}+${release}.tlz'
  386. A special variable called 'replace' can be used to declare package
  387. names that will be replaced at the time of installation.
  388. A typical recipe contains the following variables:
  389. * 'program': software name.
  390. It matches the source name. It is also used to compose the name of
  391. the package if '${pkgname}' is not specified.
  392. * 'version': software version.
  393. It matches the source name. It is also used to compose the version
  394. of the package if '${pkgversion}' is not specified.
  395. * 'arch': software architecture.
  396. It is used to compose the architecture of the package in which it
  397. is build.
  398. * 'release': release number.
  399. This is used to reflect the release number of the package. It is
  400. recommended to increase this number after any significant change in
  401. the recipe or post-install script.
  402. Obtaining sources over the network must be declared in the recipe using
  403. the 'fetch' variable. Use double quotes for separated values.
  404. The variables 'netget' and 'rsync' can be defined in 'qirc' to
  405. establish a network downloader in order to get the sources. If they are
  406. not defined, qi uses default values:
  407. 'netget' is the general network downloader tool, defaults sets to
  408. 'wget -c -w1 -t3 --no-check-certificate'.
  409. 'rsync' is the network tool for sources containing the prefix for the
  410. RSYNC protocol, default sets to 'rsync -v -a -L -z -i --progress'.
  411. The variable 'description' is used to print the package description
  412. when a package is installed.
  413. A description has two parts: a brief description, and a long
  414. description. By convention, the syntax of 'description' is:
  415. description="
  416. Brief description.
  417. Long description.
  418. "
  419. The first line of the value represented is a brief description of the
  420. software (called "blurb"). A blank line separates the _brief
  421. description_ from the _long description_, which should contain a more
  422. descriptive description of the software.
  423. An example looks like:
  424. description="
  425. The GNU core utilities.
  426. The GNU core utilities are the basic file, shell and text manipulation
  427. utilities of the GNU operating system. These are the core utilities
  428. which are expected to exist on every operating system.
  429. "
  430. Please consider a length limit of 78 characters as maximum, because
  431. the same one would be used on the meta file creation. See *note The
  432. meta file: Recipes. section.
  433. The 'homepage' variable is used to declare the main site or home
  434. page:
  435. homepage=http://www.gnu.org/software/gcc
  436. The variable 'license' is used for license information(1). Some code
  437. in the program can be covered by license A, license B, or license C. For
  438. "separate licensing" or "heterogeneous licensing", we suggest using *|*
  439. for a disjunction, *&* for a conjunction (if that ever happens in a
  440. significant way), and comma for heterogeneous licensing. Comma would
  441. have lower precedence, plus added special terms.
  442. license="LGPL, GPL | Artistic + added permission"
  443. 5.3 Writing recipes
  444. ===================
  445. Originally, qi was designed for the version 3 of Dragora GNU/Linux (this
  446. does not mean that you can't use it in another distribution, just that
  447. if you do you will need to test it for your selves). To aid this here
  448. are some references to well written recipes:
  449. <http://git.savannah.nongnu.org/cgit/dragora.git/tree/recipes>.
  450. <http://notabug.org/dragora/dragora/src/master/recipes>.
  451. You can also check the "doc" directory in the distribution sources of
  452. qi for some examples.
  453. 5.4 Building packages
  454. =====================
  455. A recipe is any valid regular file. Qi sets priorities for reading a
  456. recipe, the order in which qi looks for a recipe is:
  457. 1. Current working directory.
  458. 2. If the specified path name does not contain "recipe" as the last
  459. component. Qi will complete it by adding "recipe" to the path
  460. name.
  461. 3. If the recipe is not in the current working directory, it will be
  462. searched under '${worktree}/recipes'. The last component will be
  463. completed adding "recipe" to the specified path name.
  464. To build a single package, type:
  465. qi -b x-apps/xterm
  466. Multiple jobs can be passed to the compiler to speed up the build
  467. process:
  468. qi -b -j3 x-apps/xterm
  469. Update or install the package produced (if it is not already installed)
  470. when finish:
  471. qi -b -j3 -u x-apps/xterm
  472. Only process a recipe but do not create the binary package:
  473. qi -b -n dict/aspell
  474. The options -i or -u have no effect when -n is given.
  475. This can be useful to inspect the build process of recipe:
  476. qi -b -k -n dict/aspell 2>&1 | tee aspell-buildlog.txt
  477. The -k option could preserve the source directory and the destination
  478. directory for later inspection. A log file of the build process will be
  479. created redirecting both, standard error and standard output to tee(1).
  480. 5.5 Variables from the environment
  481. ==================================
  482. Qi has environment variables which can be used at build time:
  483. The variable 'TMPDIR' sets the temporary directory for sources, which
  484. is used for package extractions (see *note Examining packages::) and is
  485. prepended to the value of '${srcdir}' and '${destdir}' in build mode.
  486. By convention its default value is equal to '/usr/src/qi/build'.
  487. The variables 'QICFLAGS', 'QICXXFLAGS', and 'QILDFLAGS' have no
  488. effect by default. The environment variables such as 'CFLAGS',
  489. 'CXXFLAGS', and 'LDFLAGS' are unset at compile time:
  490. Recommended practice is to set variables in the command line of
  491. 'configure' or _make(1)_ instead of exporting to the environment. As
  492. follows:
  493. Variables not defined in a site shell script can be set in the
  494. environment passed to configure. However, some packages may run
  495. configure again during the build, and the customized values of
  496. these variables may be lost. In order to avoid this problem, you
  497. should set them in the configure command line, using 'VAR=value'.
  498. For example:
  499. './configure CC=/usr/local2/bin/gcc'
  500. <http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Defining-Variables.html>
  501. Indeed, while configure can notice the definition of CC in
  502. './configure CC=bizarre-cc', it is impossible to notice it in
  503. 'CC=bizarre-cc ./configure', which, unfortunately, is what most
  504. users do.
  505. [...]
  506. configure: error: changes in the environment can compromise the
  507. build.
  508. <http://gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html>
  509. It is not wise for makefiles to depend for their functioning on
  510. environment variables set up outside their control, since this
  511. would cause different users to get different results from the same
  512. makefile. This is against the whole purpose of most makefiles.
  513. <http://gnu.org/software/make/manual/make.html#Environment>
  514. 5.6 The meta file
  515. =================
  516. The "meta file" is a regular file created during the build mode, it
  517. contains information about the package such as package name, package
  518. version, architecture, release, fetch address, description, and other
  519. minor data extracted from processed recipes. The name of the file is
  520. generated as '${full_pkgname}.tlz.txt', and its purpose is to reflect
  521. essential information to the user without having to look inside the
  522. package content. The file format is also intended to be imported from
  523. other scripts.
  524. The content of a meta file looks like:
  525. #
  526. # The Bourne Again SHell.
  527. #
  528. # Bash is an sh-compatible shell that incorporates useful features from
  529. # the Korn shell (ksh) and C shell (csh). It is intended to conform to
  530. # the IEEE POSIX P1003.2/ISO 9945.2 shell and tools standard.
  531. #
  532. # It offers functional improvements over sh for both programming and
  533. # interactive use.
  534. #
  535. QICFLAGS="-g0 -Os -mtune=generic -pipe"
  536. QICXXFLAGS="-g0 -Os -mtune=generic -pipe"
  537. QILDFLAGS="-s"
  538. pkgname=bash
  539. pkgversion=5.0
  540. arch=x86_64
  541. release=1
  542. blurb="The Bourne Again SHell."
  543. homepage="http://www.gnu.org/software/bash"
  544. license="GPLv3+"
  545. fetch="ftp://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz"
  546. replace=""
  547. Package descriptions are extracted from the variable 'description'
  548. where each line is interpreted literally and pre-formatted to fit in
  549. (exactly) *80 columns*, plus the character '#' and a space is prefixed
  550. to every line.
  551. In addition to the Special variables, there are implicit variables such
  552. as 'blurb':
  553. The 'blurb' variable is related to the special variable
  554. 'description'. Its value is composed using the first (substantial) line
  555. of 'description', mentioned as the "brief description".
  556. ---------- Footnotes ----------
  557. (1) The proposal for 'license' was made by Richard M. Stallman at
  558. <http://lists.gnu.org/archive/html/gnu-linux-libre/2016-05/msg00003.html>.
  559. 
  560. File: qi.info, Node: Order files, Next: Creating packages, Prev: Recipes, Up: Top
  561. 6 Order files
  562. *************
  563. The order mode has the purpose of resolving the build order through
  564. .order files. An order file contains a list of recipe names, by default
  565. does not perform any action other than to print a resolved list in
  566. descending order. For example, if *a* depends on *b* and *c*, and *c*
  567. depends on *b* as well, the file might look like:
  568. a: c b
  569. b:
  570. c: b
  571. Each letter represents a recipe name, complete dependencies for the
  572. first recipe name are listed in descending order, which is printed from
  573. right to left, and removed from left to right:
  574. OUTPUT
  575. b
  576. c
  577. a
  578. Blank lines, colons and parentheses are simply ignored. Comment
  579. lines beginning with '#' are allowed.
  580. An order file could be used to build a series of packages, for example,
  581. if the content is:
  582. # Image handling libraries
  583. libs/libjpeg-turbo: devel/nasm
  584. x-libs/jasper: libs/libjpeg-turbo
  585. libs/tiff: libs/libjpeg-turbo
  586. To proceed with each recipe, we can type:
  587. qi -o imglibs.order | qi -b -i -
  588. The output of 'qi -o imglibs.order' tells to qi in which order it
  589. should build the recipes:
  590. devel/nasm
  591. libs/libjpeg-turbo
  592. x-libs/jasper
  593. libs/tiff
  594. 
  595. File: qi.info, Node: Creating packages, Next: Examining packages, Prev: Order files, Up: Top
  596. 7 Creating packages
  597. *******************
  598. The "creation mode" is an internal function of qi to make new Qi
  599. compatible compatible packages, the creation mode is selected by the -c
  600. option. A package is produced using the contents of the Current
  601. Directory, and the package file is written out.
  602. Usage: qi -c [OUTPUT/PACKAGENAME.TLZ]...
  603. The argument for the file name to be written must contain a fully
  604. qualified named directory as the output directory where the package
  605. produced will be written. The file name should be composed using the
  606. full name: name-version-architecture+release.tlz
  607. EXAMPLE
  608. cd /usr/local/pkgs
  609. cd claws-mail-3.17.1-x86_64+1
  610. qi -c /var/cache/qi/packages/x86_64/local/claws-mail-3.17.1-x86_64+1.tlz
  611. In this case, the package "claws-mail-3.17.1-x86_64+1.tlz" will be
  612. written into '/var/cache/qi/packages/x86_64/local/'.
  613. All packages produced are complemented by a checksum file (.sha256).
  614. 
  615. File: qi.info, Node: Examining packages, Next: Exit status, Prev: Creating packages, Up: Top
  616. 8 Examining packages
  617. ********************
  618. The "extraction mode" serves to examine binary packages for debugging
  619. purposes. The extraction mode is selected by the -x option. It
  620. decompresses a package into a single directory, verifying its integrity
  621. and preserving its properties.
  622. Usage: qi -x [PACKAGENAME.TLZ]...
  623. EXAMPLE
  624. qi -x mksh-R56c-x86_64+1.tlz
  625. This action will put the content of "mksh-R56c-x86_64+1.tlz" into a
  626. single directory, this will be a private directory for the user who
  627. requested the action, creation mode will be equal to *u=rwx,g=,o=
  628. (0700)*. The package content will reside on this location, default mask
  629. to deploy the content will be equal to *u=rwx,g=rwx,o=rwx (0000)*.
  630. The creation of the custom directory is influenced by the value of the
  631. 'TMPDIR' variable.
  632. 
  633. File: qi.info, Node: Exit status, Next: Index, Prev: Examining packages, Up: Top
  634. 9 Exit status
  635. *************
  636. All the exit codes are described in this chapter.
  637. '0'
  638. Successful completion (no errors).
  639. '1'
  640. Minor common errors:
  641. - Help usage on illegal options or required arguments.
  642. - Program needed by qi (prerequisite) is not available.
  643. '2'
  644. Command execution error:
  645. This code is used to return the evaluation of external commands and
  646. shell arguments in case of error.
  647. '3'
  648. Integrity check error for compressed files.
  649. Compressed files means:
  650. - Tarball files from tar(1). Supported extensions: .tar,
  651. .tar.gz, .tgz, .tar.Z, .tar.bz2, .tbz2, .tbz, .tar.xz, .txz
  652. - Tarball files from tarlz(1). Supported extensions: .tar.lz,
  653. .tlz
  654. - Zip files from unzip(1). Supported extensions: .zip, .ZIP
  655. - Gzip files from gzip(1). Supported extensions: .gz, .Z
  656. - Bzip2 files from bzip2(1). Supported extensions: .bz2
  657. - Lzip files from lzip(1). Supported extensions: .lz
  658. - Xz files from xz(1). Supported extensions: .xz
  659. '4'
  660. File empty, not regular, or expected.
  661. Commonly, it is expected:
  662. - An argument for the mode of operation.
  663. - A readable file or directory.
  664. - A binary package (.tlz).
  665. - A valid recipe.
  666. - An order file (.order).
  667. - A protocol supported by the network downloader tool.
  668. - A checksum file (.sha256).
  669. '5'
  670. Empty or not defined variable:
  671. This code is used to report empty or undefined variables; usually,
  672. variables coming from a recipe or assigned arrays that are tested.
  673. '6'
  674. Package already installed:
  675. The package directory for an incoming .tlz package already exists.
  676. '10'
  677. Network manager error:
  678. This code is used if the network downloader tool fails for some
  679. reason.
  680. 
  681. File: qi.info, Node: Index, Prev: Exit status, Up: Top
  682. Index
  683. *****
  684. [index]
  685. * Menu:
  686. * configuration file: The qirc file. (line 6)
  687. * environment variables: Recipes. (line 244)
  688. * exit codes: Exit status. (line 6)
  689. * handling build order: Order files. (line 6)
  690. * introduction: Introduction. (line 6)
  691. * invocation: Invoking qi. (line 6)
  692. * managing packages: Packages. (line 6)
  693. * package blacklist: Packages. (line 176)
  694. * package build: Recipes. (line 200)
  695. * package conflicts: Packages. (line 30)
  696. * package creation: Creating packages. (line 6)
  697. * package de-installation: Packages. (line 104)
  698. * package examination: Examining packages. (line 6)
  699. * package installation: Packages. (line 55)
  700. * package upgrade: Packages. (line 143)
  701. * recipes: Recipes. (line 6)
  702. * special variables: Recipes. (line 58)
  703. * the meta file: Recipes. (line 292)
  704. * variables: Recipes. (line 29)
  705. * writing recipes: Recipes. (line 186)
  706. 
  707. Tag Table:
  708. Node: Top798
  709. Node: Introduction1573
  710. Node: Invoking qi2742
  711. Node: The qirc file6160
  712. Node: Packages7237
  713. Ref: Packages-Footnote-114273
  714. Node: Recipes14386
  715. Ref: Recipes-Footnote-127255
  716. Node: Order files27400
  717. Node: Creating packages28702
  718. Node: Examining packages29742
  719. Node: Exit status30652
  720. Node: Index32590
  721. 
  722. End Tag Table
  723. 
  724. Local Variables:
  725. coding: iso-8859-1
  726. End: