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:receipt [2012/04/06 12:29]
linea
en:cookbook:receipt [2017/04/24 17:05] (current)
hgt [Functions]
Line 4: Line 4:
 This document describes the opportunities offered by the recipes used by Cookutils to compile and generate packages for SliTaz and Tazpkg through the wok and tools. The recipe for a package is also used by Tazpkg to install/​uninstall and provide information about a .tazpkg package. Each recipe begins with a comment in English: This document describes the opportunities offered by the recipes used by Cookutils to compile and generate packages for SliTaz and Tazpkg through the wok and tools. The recipe for a package is also used by Tazpkg to install/​uninstall and provide information about a .tazpkg package. Each recipe begins with a comment in English:
  
-<​file>#​ SliTaz package receipt </​file>​+<​file ​bash># SliTaz package receipt </​file>​
  
 ===== Variables ===== ===== Variables =====
Line 10: Line 10:
  
 The first 5 variables should always be present and defined. They respectively configure the package ($PACKAGE), its version, its category, provide a short description and the name of the maintainer. Example for the package, file manager Clex: The first 5 variables should always be present and defined. They respectively configure the package ($PACKAGE), its version, its category, provide a short description and the name of the maintainer. Example for the package, file manager Clex:
-<​file>​+<​file ​bash>
 PACKAGE="​clex"​ PACKAGE="​clex"​
 VERSION="​3.16"​ VERSION="​3.16"​
Line 25: Line 25:
   * **$DEPENDS:​** Set dependencies,​ there may be several dependencies separated by a space or on several lines. This variable is used mainly by Tazpkg when installing the package and Cookutils to build large packages such as Xorg. Example for Clex which depends on ncurses:   * **$DEPENDS:​** Set dependencies,​ there may be several dependencies separated by a space or on several lines. This variable is used mainly by Tazpkg when installing the package and Cookutils to build large packages such as Xorg. Example for Clex which depends on ncurses:
  
-<​file>​DEPENDS="​ncurses"</​file>​+<​file ​bash>​DEPENDS="​ncurses"</​file>​
  
   * **$BUILD_DEPENDS:​** Set compilation dependencies,​ again separated by a space or several lines. This variable is used by Cookutils during the cooking of a package. Example:   * **$BUILD_DEPENDS:​** Set compilation dependencies,​ again separated by a space or several lines. This variable is used by Cookutils during the cooking of a package. Example:
  
-<​file>​BUILD_DEPENDS="​ncurses-dev"</​file>​+<​file ​bash>​BUILD_DEPENDS="​ncurses-dev"</​file>​
  
   * **$TARBALL :** The archive is a source with the extension (tar.gz, tgz or tar.bz2). In general, the variables $PACKAGE and $VERSION are used to just change the extension, it helps to upgrade the package without changing the $VERSION variable. Generic example (see also $SOURCE example):   * **$TARBALL :** The archive is a source with the extension (tar.gz, tgz or tar.bz2). In general, the variables $PACKAGE and $VERSION are used to just change the extension, it helps to upgrade the package without changing the $VERSION variable. Generic example (see also $SOURCE example):
  
-<​file>​TARBALL="​$PACKAGE-$VERSION.tar.gz"</​file>​+<​file ​bash>​TARBALL="​$PACKAGE-$VERSION.tar.gz"</​file>​
  
   * **$WEB_SITE :** The official website of the package. It may be that some libraries have no website, in this case, there is no need to specify a URL. Note Cookutils and Tazpkg both expect to find a URL with the complete HTTP:    * **$WEB_SITE :** The official website of the package. It may be that some libraries have no website, in this case, there is no need to specify a URL. Note Cookutils and Tazpkg both expect to find a URL with the complete HTTP: 
  
-<​file>​WEB_SITE="​http://​www.clex.sk/"</​file>​+<​file ​bash>​WEB_SITE="​http://​www.clex.sk/"</​file>​
  
   * **$WGET_URL :** URL to download the source file. In general the variable $TARBALL should be used to facilitate the updating of the package without changing the $VERSION. Using a configuration file, Cookutils also configures by default 3 mirrors: $GNU_MIRROR for the GNU mirror, $SF_MIRROR for SourceForge and XORG_MIRROR for mirroring the graphical server Xorg. Example for Clex:   * **$WGET_URL :** URL to download the source file. In general the variable $TARBALL should be used to facilitate the updating of the package without changing the $VERSION. Using a configuration file, Cookutils also configures by default 3 mirrors: $GNU_MIRROR for the GNU mirror, $SF_MIRROR for SourceForge and XORG_MIRROR for mirroring the graphical server Xorg. Example for Clex:
  
-<​file>​WGET_URL="​http://​www.clex.sk/​download/​$TARBALL"</​file>​+<​file ​bash>​WGET_URL="​http://​www.clex.sk/​download/​$TARBALL"</​file>​
  
   * **$CONFIG_FILES :** Some packages provide customized configuration files. The $CONFIG_FILES variable provides a list of these files that can be saved by the '​tazpkg repack-config'​ command. These files are not overwritten when reinstalling the package if they already exist and the package can be successfully recreated with '​tazpkg repack',​ (even if they have been modified since). Netatalk for example:   * **$CONFIG_FILES :** Some packages provide customized configuration files. The $CONFIG_FILES variable provides a list of these files that can be saved by the '​tazpkg repack-config'​ command. These files are not overwritten when reinstalling the package if they already exist and the package can be successfully recreated with '​tazpkg repack',​ (even if they have been modified since). Netatalk for example:
  
- <​file>​CONFIG_FILES="/​etc/​netatalk/​AppleVolumes.* /​etc/​netatalk/​*.conf"</​file>​+ <​file ​bash>​CONFIG_FILES="/​etc/​netatalk/​AppleVolumes.* /​etc/​netatalk/​*.conf"</​file>​
  
   * **$SUGGESTED :** Lists useful packages without being essential. Also used to activate optional features.   * **$SUGGESTED :** Lists useful packages without being essential. Also used to activate optional features.
Line 51: Line 51:
   * **$WANTED :** SliTaz packages normally depend on the compilation of a source package. Sometimes the recipe of a package requires no compilation of rules, then $WANTED is used to copy files from the source of another package by using the variable $ src.   * **$WANTED :** SliTaz packages normally depend on the compilation of a source package. Sometimes the recipe of a package requires no compilation of rules, then $WANTED is used to copy files from the source of another package by using the variable $ src.
  
-  * **$SOURCE :** It may be that the Tazpkg package name differs from the name of the source package. Example for Xorg packages, the name of Tazpkg library X11 is '​xorg-libX11'​ and the name of the package source is libX11. $SOURCE allows you to use the variables $src and $_pkg during the cooking of a package. It should be noted that in the case of libX11, the name of the source archive becomes $SOURCE-$VERSION.tar.gz.+  * **$SOURCE :** It may be that the Tazpkg package name differs from the name of the source package. Example for Xorg packages, the name of Tazpkg library X11 is '​xorg-libX11'​ and the name of the package source is libX11. $SOURCE allows you to use the variables $src and $install ​during the cooking of a package. It should be noted that in the case of libX11, the name of the source archive becomes $SOURCE-$VERSION.tar.gz.
  
   * **$PROVIDE :** Some packages offer the same functionality,​ for instance the web server was at first lighttpd; now apache is available. All packages dependent on a web server refer to lighttpd. The //​PROVIDE="​lighttpd"//​ variable in the apache recipe states that packages dependent on lighttpd do not need to install the lighttpd package if apache is already on the system. Some packages may vary according to the webserver you choose, ie. the php package is dependent on lighttpd, as is php-apache on apache. The //​PROVIDE="​php:​apache"//​ in the apache recipe says that you must install php-apache instead of php, if apache is already on the system. Therefore each package dependent on php will install either php-apache or php according to the webserver on the system. This variable also chooses packages compiled with different options. The //​PROVIDE="​epdfview:​cups"//​ in the epdfview-cups recipe allows you to install epdfview with printer support via cups if cups is already on the system. \\   * **$PROVIDE :** Some packages offer the same functionality,​ for instance the web server was at first lighttpd; now apache is available. All packages dependent on a web server refer to lighttpd. The //​PROVIDE="​lighttpd"//​ variable in the apache recipe states that packages dependent on lighttpd do not need to install the lighttpd package if apache is already on the system. Some packages may vary according to the webserver you choose, ie. the php package is dependent on lighttpd, as is php-apache on apache. The //​PROVIDE="​php:​apache"//​ in the apache recipe says that you must install php-apache instead of php, if apache is already on the system. Therefore each package dependent on php will install either php-apache or php according to the webserver on the system. This variable also chooses packages compiled with different options. The //​PROVIDE="​epdfview:​cups"//​ in the epdfview-cups recipe allows you to install epdfview with printer support via cups if cups is already on the system. \\
Line 74: Line 74:
   * **$src :** Defines the path to the directory of unarchived sources.   * **$src :** Defines the path to the directory of unarchived sources.
  
-  * **$_pkg :** Defines the path to the compiled binaries installed via 'make DESTDIR=$PWD/​_pkg ​install'​. This variable is used to copy the generated files and create Tazpkg packages.+  * **$install ​:** Defines the path to the compiled binaries installed via 'make DESTDIR=$DESTDIR ​install'​. This variable is used to copy the generated files and create Tazpkg packages.
   ​   ​
-  * **$install ​:** Same as $_pkg.+  * **$_pkg :** Same as $install.
  
   * **$fs :** Defines the path to the pseudo filesystem (fs) in each package. The '​fs'​ of the package corresponds to the root of the system, a bit like Clex will for example be in $fs/​usr/​bin/​clex. Note the need to create the necessary directories via function genpkg_rules() before copying the files.   * **$fs :** Defines the path to the pseudo filesystem (fs) in each package. The '​fs'​ of the package corresponds to the root of the system, a bit like Clex will for example be in $fs/​usr/​bin/​clex. Note the need to create the necessary directories via function genpkg_rules() before copying the files.
Line 90: Line 90:
 === compile_rules() === === compile_rules() ===
  
-To compile a package you can use the variable $src to move (cd) in the directory of sources and use $CONFIGURE_ARGS to include arguments from the Cookutils configuration file. To build the package you usually launch '​make'​ without any arguments, and to install the package into the directory ​_pkg: it's necessary to use the command 'make DESTDIR=$PWD/​_pkg ​install'​. Generic example:+To compile a package you can use the variable $src to move (cd) in the directory of sources and use $CONFIGURE_ARGS to include arguments from the Cookutils configuration file. To build the package you usually launch '​make'​ without any arguments, and to install the package into the directory ​''​$DESTDIR''​: it's necessary to use the command ​''make DESTDIR=$DESTDIR ​install''. Generic example:
  
-<​file>​+<​file ​bash>
 # Rules to configure and make the package. # Rules to configure and make the package.
 compile_rules() compile_rules()
Line 100: Line 100:
  --mandir=/​usr/​share/​man $CONFIGURE_ARGS  --mandir=/​usr/​share/​man $CONFIGURE_ARGS
  make  make
- make DESTDIR=$PWD/​_pkg ​install+ make DESTDIR=$DESTDIR ​install ​(or simply make install)
 } }
 </​file>​ </​file>​
Line 108: Line 108:
 To generate a tazkg package we must specify commands in the function genpkg_rules. In this example we create a psuedo directory /usr in the filesystem of the package, copy the whole binary(s) and finally use strip to clean the files: To generate a tazkg package we must specify commands in the function genpkg_rules. In this example we create a psuedo directory /usr in the filesystem of the package, copy the whole binary(s) and finally use strip to clean the files:
  
-<​file>​+<​file ​bash>
 # Rules to gen a SliTaz package suitable for Tazpkg. # Rules to gen a SliTaz package suitable for Tazpkg.
 genpkg_rules() genpkg_rules()
 { {
  mkdir -p $fs/usr  mkdir -p $fs/usr
- cp -a $_pkg/usr/bin $fs/usr+ cp -a $install/usr/bin $fs/usr
  strip -s $fs/​usr/​bin/​*  strip -s $fs/​usr/​bin/​*
 } }
Line 122: Line 122:
 These functions are initiated by Tazpkg when installing the package. They must be defined before generating the .tazpkg package with Cookutils. If no rules are given for these functions, they have no raison d'etre and can be removed. Example using echo to display some text (no function should be empty): These functions are initiated by Tazpkg when installing the package. They must be defined before generating the .tazpkg package with Cookutils. If no rules are given for these functions, they have no raison d'etre and can be removed. Example using echo to display some text (no function should be empty):
  
-<​file>​+<​file ​bash>
 # Pre and post install commands for Tazpkg. # Pre and post install commands for Tazpkg.
 pre_install() pre_install()
Line 138: Line 138:
 These functions are initiated by Tazpkg when removing the package. They must be defined before generating the .tazpkg package with Cookutils. If no rules are given for these functions, they have no raison d'etre and can be removed. Example using echo to display some text (no function should be empty): These functions are initiated by Tazpkg when removing the package. They must be defined before generating the .tazpkg package with Cookutils. If no rules are given for these functions, they have no raison d'etre and can be removed. Example using echo to display some text (no function should be empty):
  
-<​file>​+<​file ​bash>
 # Pre and post remove commands for Tazpkg. # Pre and post remove commands for Tazpkg.
 pre_remove() pre_remove()
 
en/cookbook/receipt.1333708178.txt.gz ยท Last modified: 2012/04/06 12:29 by linea