Mon Apr 17 12:59:00 2017 UTC

A little lexicon for NuTyX users

Cards

Cards which stands for 'Create, Add, Remove and Download System' packages, is a set of utilities to manage the installed software on your NuTyX Linux system.

Cards can manage dependencies for compilation and handles runtime dependencies on its own. This means that in 95% of all cases, runtime dependencies for a working app do not need to to be specified in the build. recipe.

A package

A package is an archive containing a set of files of various types. It might include libraries, command line applications, graphical user interfaces, commands, configuration information, etc...

When the package is installed on your NuTyX system, it will be handled by the package manager cards.

Package archive name syntax

  • name: (port-name)
  • .group-name: only if it is a group package archive. See configuration: 'PKGMK_GROUPS'
  • .locale-name: only if it is a locale package archive. See configuration: 'PKGMK_LOCALES'
  • build-version: 10-digit Unix timestamp of the archive build time. See also 'PKGMK_BUILDVER'
  • architecture: "any" or the required system architecture: e.g. ("$(uname -m)" x86_64).
  • .extension: the predefined package archive reference extension without compression.
  • .compression-extension: only if it is a compressed archive. see configuration: 'PKGMK_COMPRESS_PACKAGE'

Pkgarchive Names Without Compression:
cards1462695664x86_64.cards.tar name: cards, no group
buildvers: 1462695664
arch: x86_64
ext: cards.tar
cards.devel1462695664x86_64.cards.tar name: cards,group: devel
buildvers: 1462695664
arch: x86_64 ext: cards.tar
cards.man1462695664any.cards.tar name: cards, group: man
buildvers: 1462695664
arch: any
ext: cards.tar

Pkgarchive Names With Compression:
acl.fr1462707691any.cards.tar.xz name: acl, group: fr
buildvers: 1462707691
arch: any
ext: cards.tar, compressed
acl1462707691x86_64.cards.tar.xz name: acl, no group
buildvers: 1462707691
arch: x86_64
ext: cards.tar, compressed

A dependency

A dependency is a package AAA needed either for running or for compiling another package BBB.

A good example of a dependency is the gtk3 package which is used by many packages of the gnome collection.

A collection

A collection is a collection of all the packages that provide a particular set of functions.

When you install a base system from the MINI ISO or with the installation scripts, you install the base collection collection.

The gui collection for example allows you to install a graphical user interface. For such a graphical user interface, you can choose your favorite windows manager.

Under NuTyX, it's possible to install kde5, gnome, mate or xfce4 desktop collections.

A family

A family defines a set of packages which begin with a common name (the father package). Additional parts are separated by a hyphen (-).

An example of a NuTyX package family:

  • gstreamer1
  • gstreamer1-plugins-bad
  • gstreamer1-plugin-good
  • gstreamer1-plugin-libav
  • gstreamer1-...

Usually, a family of packages will be in the same collection.

Such packages family share variables with the mother package (gstreamer1 in this example).

A group

A groupe of packages is made of a set of packages providing a specific usage, for example the devel group provide tools for compilation.

In a group it's the part of the name after the dot which specify the group.

Each locale is a group as well.

For example, the gcc.devel package is part of the devel group.

Most of availables packages are split into thoses groups.

Today groups are: devel, man, doc, lib and service and each available locale fr, de, da, it, pt, tr, ru, sv, nn, es, nl and fi.

A category

A category defines a set of applications which have similar functions: A typical example of a category is "Internet" which includes browsers, irc and mail clients, etc..

The base system

The NuTyX 'base system' defines the minimum set of packages that will never be removed.

The list of packages to keep when we want to return to a base system is defined in the /etc/cards.conf file. The keyword at the begining of the line is: base.

A script

A script is used (like a cinema script) to define each action that has to be executed by the interpreter. The scripts described here specify the actions to be executed for the construction of a package. See recipe.

A script can also be used for installing NuTyX Linux from another Linux distribution, or from an already installed NuTyX Linux system.

A recipe

A recipe is a special script which defines the construction of a package. Under NuTyX, the recipe of a package is located in the Pkgfile file.

A port

In NuTyX, a port is a folder which contains all necessary files for the construction of a package. It will at least contain a file named Pkgfile.

The port can also contain other required files (e.g. patch files) or port metafiles.

Port Metafile Syntax

  • name: (port-name)
  • .group-name: only if it is a group package archive. see configuration: 'PKGMK_GROUPS'
  • .locale-name: only if it is a locale package archive. see configuration: 'PKGMK_LOCALES'
    Followed by one of these file extentions:

  • .pre-install, or : TODO add more info: what it does, when is this script executed.
  • .post-install: TODO add more info: what it does, when is this script executed.
  • .README: a file describing various options, actions, configurations of the port.

EXAMPLE: Meta files port: lxdm

| Meta File Name    | 
| ------------------|
| lxdm.pre-install  |
| lxdm.post-install |
| lxdm.README       |

EXAMPLE: Meta files port: cards

| Meta File Name                | 
| ------------------------------|
| cards.devel.post-install      |
| cards.fr.README               |

The term port refers to a remote repository containing ports which can be downloaded with a suitable client program.

NuTyX uses the ports tool for downloading all the ports from a remote repository and stores them by default in the /usr/ports/<name_of_collection> folder.

The 'Pkgfile' file

A Pkgfile is a script file. It contains the recipe for the construction of a package which can be installed with the package manager cards

The content of this file follows a common schema and is compose of three parts:

  1. `Pkgfile-Header`: (optional but highly recommended) general information about the package: Description, URL, Developer(s), Packager(s), dependencies
  2. `Mandatory information`: for the construction of the package: Name, version, release
  3. `Required build function`: The "build" function defines the construction itself of the package

NOTE: the above outlines only the most general situation. See also package family for exceptions.

It is highly recommended to put the Pkgfile file in a folder with the same name as the name variable defined in the Pkgfile. The folder name will be treated the default name of the base binary package if it is not (re)defined by the name variable.

Example of a Pkgfile located in the mypackage folder:

# Depends on: glib atk

description="My first package"
url="http://downloads.nutyx.org"
packager="tnut at nutyx dot org"
name=mypackage
version=1.0
release=1
source=(${url}/files/$name-$version.tar.xz)
build() {
cd ${name}-$version
./configure --prefix=/usr \
--disable-static
make
make DESTDIR=$PKG install
}

A chroot

A chroot is a way of isolating our working environment while using the recipes coming from various ports.

It is also needed to assure that no dependency will be installed from the host operating system.

Levels

When cards compiles a package, it needs to know the level of compilation of this package.

Each package may or may not contain dependencies.

If a package named AAAA does not contains any dependencies, it will be at the first level: level 0 (zero).

If a package named BBBB contains a dependency named AAAA, this package will be at second level: level 1 (one).

The list of dependencies for the compilation of a package is defined by the line:

# Depends on: glib atk pango gtk xorg-libx11

in a Pkgfile.

Alias

It is worth knowing that some commands are actually aliases used to simplify things. An alias is a kind of shortcut to the original command. To know all the aliases available to you, just type alias in your terminal.

alias

If you want to modify defined alias in your NuTyX, you need to edit the .bashrc file located in your home directory.

Extract of /root/.bashrc:
if [ -f "/etc/bashrc" ] ; then
  source /etc/bashrc
fi
if [ $EUID -eq 0 ]; then
         alias del='cards remove'
         alias get='cards install'
         alias up='cards install -u'
         alias check='cards sync;cards diff'
else
         alias del='sudo cards remove'
         alias get='sudo cards install'
         alias up='sudo cards install -u'
         alias check='sudo cards sync;sudo cards diff'
fi
alias search='cards search'
alias ll='ls -l'
alias l='ls -alh'
alias duh='du -h --max-depth=1'
alias dfh='df -h'
alias pkgfind='cards list| grep -i'
# End ~/.bashrc