CARDS 3.0.0
Package manager for the NuTyX GNU/Linux distribution
|
A port is a directory containing the files needed for building a package. This directory will contains various files. The Pkgfile will alway be present. A pre-installation script file and / or a post-installation script file can also be found in this directory.
The command pkgmk will be used to "build" the package, which can be installed afterwards.
A collection directory contains a set of ports. It can also contains a file named .pkgmk.conf. This file will contains info that can be share between ports of the collection. It's very usefull to use such a file when we have to produce many packages that shares a lot of information like version, url, packager, contributors and even the build() function.
A package directory will always be named by the package name. The lenght of the name of the folder (means the lenght of the name of the package) should not exceed 50 characters.
Exemple of a directory name:
In the directory of a port, we should at least find a file named Pkgfile. We can also find pre-install and post-install scripts. Those scripts will have the name of the port as prefix.
For example:
We can also find a README file. As for the scripts above, it will take the name of the package as prefix
For example:
Dependencies are used to specify which other binaries packages needs to be installed before cards can compile the port without dependencies failures.
The syntax of declaring dependencies is done via the 'makedepends' and 'run' arrays variables:
Dependencies are found by cards recursively, means you don't have to repeat dependencies that are already declard in the dependencies ports packages
Here, We are only talking about sources or compilations dependencies. Runtime dependencies are normaly not specified as cards will find them for you. See runtime dependencies below
A recept is always following a choosen template depending of the kind of package we want to produce. Variables are then usefull when it comes to customisation our template with a minimum of effort. We can then easily produce a specific recept.
The minimum information required for producing a binary are:
Even if it is not mandatory, the name variable is highly recommended for improved readability of the recept
One or more alias can be defined, they permit cards to call the binary package via one of those. The alias variable is declare in a array of strings An alias may contains uppercase letters. You should alias with great care as you are not allow to use an existing Package name for an alias.
A description can contains up to 110 characters maximum. Try to be as consistent as possible and avoid unecessary worlds.
Information available on the net can be pass to the url variable, for example:
The name of all the peoples that has ones contribute to the construction of the package can be specify via the contributors variable. If it's a new package, they will be no contributors yet:
The name of the last packager who modify the recept can be specify via the packager variable:
The name of the upstream(s) maintainer(s) can be specify via the maintainer variable:
The name of a group can be provide if necessary via the group variable:
Dependencies not automaticaly detect by cards should be pass via the 'run' array variable:
The sources of the package will be insert via the source array variable, here is an complete example:
All the defined variables located into the /etc/pkgmk.conf file can be reused into our Pkgfile recept Consult the manual of pkgmk.conf
Following variables are just examples you can use:
All the available functions are using TWO specific variables, thoses two variables are set onces and should never be set again.
They are define in the /etc/pkgmk.conf file via the PKGMK_WORK_DIR variable (parent folder of SRC and PKG)
In case your build() function look like the mostly used one :
In this case you can ommit the build() function, cards will provide automatically the default one (which is the code of the above one)
In all other cases, you will need to create your own one.
Possible functions are:
To conclude, a full example with all the possible variables: