Tutorial «Basic packages»¶
This tutorial shows an example using very simple script-based packages. This example will make a project with two packages, setup a dependency between them and setup scripts to help show a developer how packages are processed.
To start, make a new folder for the project, folders for each package and move into the root folder:
$ mkdir -p my-project/package/liba $ mkdir -p my-project/package/program-b $ cd my-project/
liba package, a package definition and script-based files will
be created. First, build the package definition
the following contents:
LIBA_VERSION = '1.0.0'
Next, create a build script for the
my-project/liba/liba-build.py with the following contents:
print('invoked liba package build stage')
Repeat the same steps for the
program-b package with the file
PROGRAM_B_DEPENDENCIES = ['liba'] PROGRAM_B_VERSION = '2.1.0'
print('invoked program-b package build stage')
The second package is a bit different since it indicates that package
program-b has a dependency on
liba. Configuring a dependency ensures
releng-tool will process the
liba package before
With this minimal set of packages, the project’s releng-tool configuration
can now be created. At the root of the project, create a
configuration file with the following contents:
packages = [ 'program-b', ]
packages key indicates a list of required packages to be processed.
In this example, we only need to list
liba will be
implicitly loaded through the dependency configuration set in program B’s
The file structure should now be as follows:
└── my-project/ ├── package/ │ ├── liba/ │ │ ├── liba.py │ │ └── liba-build.py │ └── program-b/ │ ├── program-b.py │ └── program-b-build.py └── releng.py
This sample project should be ready for a spin. While in the
$ releng-tool configuring liba... building liba... invoked liba package build stage installing liba... configuring program-b... building program-b... invoked program-b package build stage installing program-b... generating sbom information... generating license information... (success) completed (0:00:01)
This above output shows that the
liba stages are invoke followed by
program-b stages. For the build stage in each package, each respective
package script has been invoked. While this example only prints a message,
more elaborate scripts can be made to handle a package’s source to build.
To clean the project, a
releng-tool clean request can be invoked:
$ releng-tool clean
clean request, the project should be ready to perform a fresh
This concludes this tutorial.