Package manager for the NuTyX GNU/Linux distribution
Recept Syntax


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.

The collection directory

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.

The port directory

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.

  • It should never contains capital letters and never start with a number.
  • It has to start with a lowercase letter.
  • It can contains the 26 lowercase letters, the 10 chiffers 0 to 9 and one of following three sympols: -, _ or +

Exemple of a directory name:


The port directory contents

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:


The Pkgfile file

The dependencies

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 a comment line as a follow example:

# Depends on: glibc gtk2 glib libvorbis python

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

Available Variables

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 mandatory variables

The minimum information required for producing a binary are:

  • version: the version of the sources of the package.
  • release: the nth attempt at building the package. Its value will always start at 1

The High recommended variables

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.

alias=(name1 name2 name3)

A description can contains up to 110 characters maximum. Try to be as consistent as possible and avoid unecessary worlds.

description="Text editor with colored syntax supporting many languages"

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:

contributors="pierre at nutyx dot org, tnut at nutyx dot org"

The name of the last packager who modify the recept can be specify via the packager variable:

packager="tnut at nutyx dot org"

The name of the upstream(s) maintainer(s) can be specify via the maintainer variable:

maintainer="Daniel Stenberg and many more"

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:

run=(python gawk)

The sources of the package will be insert via the source array variable, here is an complete example:


The available variables

All the defined variables located into the /etc/pkgmk.conf file can be reused into our Pkgfile recept Consult the manual of pkgmk.conf

man pkgmk.conf

Following variables are just examples you can use:


The Available functions

All the available functions are using TWO specific variables, thoses two variables are set onces and should never be set again.

  • SRC is the variable which define the root working folder
  • PKG is the variable which define the root packaging folder

They are define in the /etc/pkgmk.conf file via the PKGMK_WORK_DIR variable (parent folder of SRC and PKG)

The specific build() function

In case your build() function look like the mostly used one :

build() {
cd $name-$version
./configure --prefix=/usr
make DESTDIR=$PKG install

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.

The optionnal reconize functions

Possible functions are:

prepare() {
package() {
devel() {
service() {
doc() {
lib() {


To conclude, a full example with all the possible variables:

# Depends on: gtk-doc shared-mime-info,xorg-libxinerama,xorg-libxrandr,cairo,pango,pangox-compat,atk,libtiff,cups,gdk-pixbuf,xorg-libxi,xorg-libxcursor,hicolor-icon-theme,gtk-update-icon-cache
description="GTK+ is a multi-platform toolkit (version 2)"
contributors="tyrry at nutyx dot org, pierre at nutyx dot org"
packager="tnut at nutyx dot org"
alias=(Gtk+ gtk+)
build() {
cd ${_name}-$version
sed -i 's#l \(gtk-.*\).sgml#& -o \1#' docs/{faq,tutorial}/
sed -i "/seems to be moved/s/^/#/"
./configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
make DESTDIR=$PKG install
mkdir -p $PKG/etc/gtk-2.0
echo 'gtk-fallback-icon-theme = "Tango"' > $PKG/etc/gtk-2.0/gtkrc
# Already build in gtk-update-icon-cache
rm -f $PKG/usr/bin/gtk-update-icon-cache
rm -f $PKG/usr/share/man/man1/gtk-update-icon-cache.1
doc() {
cd $PKG
bsdtar -cf \
usr/share/gtk-doc usr/share/gtk-2.0/demo
rm -r usr/share/{gtk-doc,gtk-2.0/demo}
devel() {
cd $PKG
bsdtar -cf \
usr/lib/pkgconfig \
usr/include \
rm -r usr/{share/gir-1.0,lib/pkgconfig,include}