SliTaz GNU/Linux official and community documentation wiki.
.png

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:cookbook:wok [2010/07/08 17:14]
127.0.0.1 external edit
en:cookbook:wok [2017/04/17 18:31] (current)
hgt create package after writing recipe
Line 3: Line 3:
 ===== Overview ===== ===== Overview =====
  
-[[http://​hg.slitaz.org/​tazwok/​raw-file/​tip/​doc/​tazwok.en.html|Tazwok]] is used to compile and generate code (cooking) via instructions found in a receipt. It places compiled files in to a directory and calls upon Tazpkg to package said directory. The receipt found in a wok has a different "​bottom half" to that of a Tazpkg; ​Tazwok ​has rules for compilation //and// packaging (which it forwards to Tazpkg), whereas Tazpkg is only concerned with packaging.+[[http://​hg.slitaz.org/​cookutils/​raw-file/​tip/​doc/​cookutils.en.html|Cookutils]] is used to compile and generate code (cooking) via instructions found in a receipt. It places compiled files in to a directory and calls upon Tazpkg to package said directory. The receipt found in a wok has a different "​bottom half" to that of a Tazpkg; ​Cookutils ​has rules for compilation //and// packaging (which it forwards to Tazpkg), whereas Tazpkg is only concerned with packaging.
  
-Tazwok ​is one of many small utilities the SliTaz project uses to automatically rebuild the distribution from source. The project also offers an archive of [[en:​cookbook:​slitaztools|tools]] containing various small utilities, examples and configuration files. The distribution generator [[http://​hg.slitaz.org/​tazwok/​raw-file/​tip/​doc/​tazwok.en.html|Tazlito]] is designed for users and developers; it can retrieve and reconstruct a LiveCD ISO image and generate a distribution flavor from a list of packages, a configuration file and a description. The utilities are all distributed as a source archive and are installed by default on SliTaz.+Cookutils ​is one of many small utilities the SliTaz project uses to automatically rebuild the distribution from source. The project also offers an archive of [[en:​cookbook:​slitaztools|tools]] containing various small utilities, examples and configuration files. The distribution generator [[http://​hg.slitaz.org/​tazlito/​raw-file/​tip/​doc/​tazlito.en.html|Tazlito]] is designed for users and developers; it can retrieve and reconstruct a LiveCD ISO image and generate a distribution flavor from a list of packages, a configuration file and a description. The utilities are all distributed as a source archive and are installed by default on SliTaz.
  
-<note tip>​Developers and future contributors can refer to the [[http://doc.slitaz.org/​en:​cookbook:​devcorner|development]] page that provides information on SliTaz project management.</​note>​+<note tip>​Developers and future contributors can refer to the [[http://www.slitaz.org/​en/​devel/​forge.php|development]] page that provides information on SliTaz project management.</​note>​
  
 === Wok Structure and Organisation === === Wok Structure and Organisation ===
  
-The //wok// is a directory structure that houses all the available packages. Each directory contains at least one receipt to download, unpack, compile and generate a package. ​Tazwok ​also needs to create a directory to store downloaded sources (//​$SOURCES_REPOSITORY//,​ usually ///​home/​slitaz/​src//​) and a repository of generated packages (//​$PACKAGES_REPOSITORY//,​ usually ///​home/​slitaz/​packages//​);​ these values can be configured in the ///etc/tazwok.conf// file.+The //wok// is a directory structure that houses all the available packages. Each directory contains at least one receipt to download, unpack, compile and generate a package. ​Cookutils ​also needs to create a directory to store downloaded sources (//​$SOURCES_REPOSITORY//,​ usually ///​home/​slitaz/​src//​) and a repository of generated packages (//​$PACKAGES_REPOSITORY//,​ usually ///​home/​slitaz/​packages//​);​ these values can be configured in the ///etc/slitaz/cook.conf// file.
  
 There is more than one Wok on the [[http://​hg.slitaz.org|Mercurial repositories]]:​ There is more than one Wok on the [[http://​hg.slitaz.org|Mercurial repositories]]:​
Line 24: Line 24:
 ===== Preparation ===== ===== Preparation =====
  
-The [[en:​cookbook:​devcorner#​mercurial-repositories|Developer'​s Corner]] provides invaluable background information. Please ensure you have read and understood it before continuing.+The [[http://​www.slitaz.org/​en/​devel/​forge.php|Developer'​s Corner]] provides invaluable background information. Please ensure you have read and understood it before continuing.
  
-To begin using the Wok, [[http://​hg.slitaz.org/​tazwok/​raw-file/​tip/​doc/​tazwok.en.html|Tazwok]] must already be installed on the system along with the main development tools (binutils, compiler, libraries-dev,​ make). This requires you to install the meta-package //​slitaz-toolchain//:​+To begin using the Wok, [[http://​hg.slitaz.org/​cookutils/​raw-file/​tip/​doc/​cookutils.en.html|Cookutils]] must already be installed on the system along with the main development tools (binutils, compiler, libraries-dev,​ make). This requires you to install the meta-package //​slitaz-toolchain//:​
  
 <​code>​ <​code>​
-tazpkg recharge + # ​tazpkg recharge 
-tazpkg get-install slitaz-toolchain+ tazpkg get-install slitaz-toolchain
 </​code>​ </​code>​
  
Line 36: Line 36:
  
 <​code>​ <​code>​
-tazpkg get-install mercurial+ # ​tazpkg get-install mercurial
 </​code>​ </​code>​
  
-More information on the use of the Mercurial VCS is available from its [[http://​mercurial.selenic.com/|website]] and the "​[[http://​hgbook.red-bean.com/​|Hg Book]]"​.+More information on the use of the Mercurial VCS is available from its [[http://​mercurial-scm.org/|website]] and the "​[[http://​hgbook.red-bean.com/​|Hg Book]]"​.
  
 === Cloning the Wok === === Cloning the Wok ===
  
-If you are to generate a package for inclusion in the SliTaz repositories,​ it is necessary to first obtain the current wok by using Mercurial. This is called //cloning// the Wok, a procedure that downloads the entire Wok and all its history to a working directory. **If you wish to only use Tazwok ​to build packages for personal use, this is not necessary.** See the [[#​creating-a-personal-wok|Personal Wok]] section below instead.+If you are to generate a package for inclusion in the SliTaz repositories,​ it is necessary to first obtain the current wok by using Mercurial. This is called //cloning// the Wok, a procedure that downloads the entire Wok and all its history to a working directory. **If you wish to only use Cookutils ​to build packages for personal use, this is not necessary.** See the [[#​creating-a-personal-wok|Personal Wok]] section below instead.
  
 The usual destination for a Wok clone is ///​home/​slitaz/​wok//:​ The usual destination for a Wok clone is ///​home/​slitaz/​wok//:​
  
 <​code>​ <​code>​
-hg clone http://​hg.slitaz.org/​wok/​ /​home/​slitaz/​wok + # cook setup --wok
 </​code>​ </​code>​
  
Line 59: Line 59:
 If your packages are only for personal use and are not intended for inclusion in the SliTaz repositories,​ a wok can be created from scratch. ​ If your packages are only for personal use and are not intended for inclusion in the SliTaz repositories,​ a wok can be created from scratch. ​
  
-<​code> ​tazwok gen-clean-wok ​</​code>​+<​code> ​# cook setup </​code>​
  
  
 ===== Compiling and Generating Packages ===== ===== Compiling and Generating Packages =====
  
-Before compiling your first package, ​Tazwok ​must know where your working directory is. By default the path is ///​home/​slitaz/​wok//​ but you can change this or rename the wok that you want to download. ​To view and check Tazwok paths that will be used, and the number of packages in the wok, you can ask Tazwok for statistics:​ +Before compiling your first package, ​Cookutils ​must know where your working directory is. By default the path is ///​home/​slitaz/​wok//​ but you can change this or rename the wok that you want to download. ​
- +
-<​code>​ tazwok stats </​code>​+
  
 The process for generating a SliTaz package from source can be summarised thus: [[http://​www.tuxfiles.org/​linuxhelp/​softinstall.html#​s2|configure]],​ [[http://​www.tuxfiles.org/​linuxhelp/​softinstall.html#​s3|compile]] & [[http://​linux.die.net/​man/​1/​strip|strip]]. The process for generating a SliTaz package from source can be summarised thus: [[http://​www.tuxfiles.org/​linuxhelp/​softinstall.html#​s2|configure]],​ [[http://​www.tuxfiles.org/​linuxhelp/​softinstall.html#​s3|compile]] & [[http://​linux.die.net/​man/​1/​strip|strip]].
  
-<​note>​We do not carry out the '//​make install//'​-style step ourselves; the built files are not to be installed in the system but left in the output directory (_pkg), ready for packaging.</​note>​+<​note>​We do not carry out the '//​make install//'​-style step ourselves; the built files are not to be installed in the system but left in the output directory ($DESTDIR), ready for packaging.</​note>​
  
 When generating your first package, it is advisable to [[http://​doc.slitaz.org/​en:​cookbook:​devcorner#​kiss-comply-to-standards|keep it simple]] and build your package without changing its receipt or seeking dependencies. M4 is an ideal candidate for your first //cook//: When generating your first package, it is advisable to [[http://​doc.slitaz.org/​en:​cookbook:​devcorner#​kiss-comply-to-standards|keep it simple]] and build your package without changing its receipt or seeking dependencies. M4 is an ideal candidate for your first //cook//:
  
-<​code> ​tazwok ​cook m4 </​code>​+<​code> ​cook m4 </​code>​
  
-When Tazwok ​has finished building M4, its package is placed in the directory specified by the configuration file (///​home/​slitaz///​packages by default). If all went well, you can install the package on the host system or use it to generate a LiveCD distribution via Tazlito!+When Cookutils ​has finished building M4, its package is placed in the directory specified by the configuration file (///​home/​slitaz///​packages by default). If all went well, you can install the package on the host system or use it to generate a LiveCD distribution via Tazlito!
  
-When you are familiar with [[en:​cookbook:​receipt|receipts]] and the compilation process, you can use the following command to create a new package ​(and a wokif you don't have one) before ​interactively writing its receipt:+When you are familiar with [[en:​cookbook:​receipt|receipts]] and the compilation process, you can use the following command to create a new package, ​after interactively writing its receipt:
  
-<​code> ​tazwok ​new-tree <​packageName>​ --interactive </​code>​+<​code> ​# cook new <​packageName>​ --interactive </​code>​
  
 Be sure to read the documentation on the options provided by the [[en:​cookbook:​receipt|receipt]] and the [[en:​guides:​tazwoktips|Tazwok Tips]] to avoid frustration! Be sure to read the documentation on the options provided by the [[en:​cookbook:​receipt|receipt]] and the [[en:​guides:​tazwoktips|Tazwok Tips]] to avoid frustration!
  
 +=== Cooking Multiple Packages with a cook list ===
  
-=== Cooking Multiple Packages with cook-list === +Cookutils ​can compile several packages with a single command. This is achieved with a //cooking list//, a text file of one package per line. Cookutils ​can accept a cook-list with the command of the same name; for example, to cook the //mypkgs// cook-list:
- +
-Tazwok ​can compile several packages with a single command. This is achieved with a //cooking list//, a text file of one package per line. Tazwok ​can accept a cook-list with the command of the same name; for example, to cook the //mypkgs// cook-list: +
- +
-<​code>​ tazwok cook-list mypkgs.cooklist </​code>​ +
- +
-<note tip>​There are example lists in ///​usr/​share/​examples/​tazwok/​cooklists//​.</​note>​+
  
 +<​code>​ # cook list mypkgs.cooklist </​code>​
  
 ===== Package Compilation Options ===== ===== Package Compilation Options =====
Line 106: Line 100:
 === Optimization === === Optimization ===
  
-The official SliTaz packages are optimized for **i486**, the optimization arguments used to configure are specified in **/etc/tazwok.conf** and can be called via the variable $CONFIGURE_ARGS. If you want to compile a package with different arguments, you can modify the Tazwok ​configuration file:+The official SliTaz packages are optimized for **i486**, the optimization arguments used to configure are specified in **/etc/slitaz/cook.conf** and can be called via the variable $CONFIGURE_ARGS. If you want to compile a package with different arguments, you can modify the Cookutils ​configuration file:
  
-<code>+<file bash>
 CONFIGURE_ARGS="​--build=i486-pc-linux-gnu --host=i486-pc-linux-gnu"​ CONFIGURE_ARGS="​--build=i486-pc-linux-gnu --host=i486-pc-linux-gnu"​
-</code>+</file>
  
  
Line 127: Line 121:
 ===== Structure of a Wok Package ===== ===== Structure of a Wok Package =====
  
-The structure of the packages in the wok should always be respected so that Tazwok ​can find the correct files and directories. Possible contents of a package (note the directory taz/ is created at time of cooking):+The structure of the packages in the wok should always be respected so that Cookutils ​can find the correct files and directories. Possible contents of a package (note the directory taz/ is created at time of cooking):
  
     * **stuff/** : The material used to configure, compile and generate the package (patch(es), Makefile, pseudo fs, etc);     * **stuff/** : The material used to configure, compile and generate the package (patch(es), Makefile, pseudo fs, etc);
     * **receipt**:​ The ever-present [[en:​cookbook:​receipt|receipt]];​     * **receipt**:​ The ever-present [[en:​cookbook:​receipt|receipt]];​
     * //​**description.txt** : (optional) The description of the package is included in the final package, copied to its root. Once installed, Tazpkg identifies this file as the description and can display it via //tazpkg desc pkgname//​.//​     * //​**description.txt** : (optional) The description of the package is included in the final package, copied to its root. Once installed, Tazpkg identifies this file as the description and can display it via //tazpkg desc pkgname//​.//​
-    * //**taz/** : Directory tree containing the package Tazpkg generated, the compressed package is stored in the directory specified by $PACKAGES_REPOSITORY in the Tazwok ​configuration file.//+    * //**taz/** : Directory tree containing the package Tazpkg generated, the compressed package is stored in the directory specified by $PACKAGES_REPOSITORY in the Cookutils ​configuration file.//
  
-Tazwok ​will automatically call upon Tazpkg to package the //taz// directory. It also forwards any packaging instructions found in the receipt.+Cookutils ​will automatically call upon Tazpkg to package the //taz// directory. It also forwards any packaging instructions found in the receipt.
  
 ===== Structure of a Tazpkg ===== ===== Structure of a Tazpkg =====
 
en/cookbook/wok.1278602054.txt.gz · Last modified: 2010/08/18 16:51 (external edit)