Sat Apr 8 16:58:07 2017 UTC

How to build a package


We have provided the required Know-how, the available base commands, the minimum syntax of instructions and a list of available packages for you to choose from.

Come and join the many participants of all ages, male and female, from all over the world, and venture along this exciting road we call NuTyX. We can promise you a rewarding experience as you build your very first NuTyX system, following our (NuTyX) rules Laughing.

Build my first package

We will see how to build and install a first package in a very straigtforward way.

This tutorial explain you in a very simple way the construction of your first binary package.

They are no prerequest, this exercice can be done regardless the state of your NuTyX.

The choosen receipt is a little text editor which don't need any dependencies.

[Important] For this package, we won't use an isolate environment named chroot. We will see in the next article, how to build in such isolate environment. Because that's the only working method if we need to build a package having dependencies.

Make the recept

sudo mkdir -p /usr/ports/perso/nano
echo '
description="Text Editor"
maintainer="Nano team"
packager="Fran├žois Perrin francois dot perrin at myworld dot com"



build() {
cd $name-$version
./configure --prefix=/usr \
--sysconfdir=/etc \
--enable-utf8 \
--enable-color \
--enable-multibuffer \
--enable-nanorc \
make DESTDIR=$PKG install
rm $PKG/usr/share/info/dir
}' > /usr/ports/perso/nano/Pkgfile

Install the development packages

get cards.devel

Compile the package

cd /usr/ports/perso/nano
sudo pkgmk -d

Install the package

sudo pkgadd nano1*

The configuration files

The /etc/cards.conf file

This file is always present on a NuTyX installation.

It's a bit like "the spine" of your NuTyX.

The /etc/cards.conf file will reflect the way you use NuTyX.

All the collections that you want to use in your NuTyX can be specified in two way:

  1. configuration example of cli collection in binaries from a remote server
    dir /var/lib/pkg/depot/cli|
  2. configuration example of cli in local ports
    dir /usr/ports/cli

This file is also responsible for the list of packages you want to keep when you execute the command:

cards base -r
And finaly, it's specify which locale should be installed.

You can find more information by reading the cards.conf manual

man cards.conf

The /etc/pkgmk.conf file

This file is used when compiling news ports. It specify all the variables used by the pkgmk command.

Please take the time to read the man page of pkgmk.conf

man pkgmk.conf

Example of /etc/pkgmk.conf file

export CFLAGS="-O2 -pipe"

case ${PKGMK_ARCH} in
		export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
                export CFLAGS="${CFLAGS} -m32"
                export CXXFLAGS="${CXXFLAGS} -m32"
                export LDFLAGS="${LDFLAGS} -m32"
                echo "Unknown architecture selected! Exiting."
                exit 1
# Those settings are typically set for packaging
# without sub packages and only french locale
# They are also the default ones


We are now ready to build our packages in a chroot.