Chapter 5. Inside T2

Table of Contents

A Package
Description File (.desc)
The File's Copyright
The End-Uer Information
Who is Responsible?
The Version, State and Other Build Details
Other Tunable Details
Where Does the Package Source Come From?
Configuration File (.conf)
Patch Files (.patch)
Cache File (.cache)
Package Creation in Practice
Custom Code
Getting New Packages Into T2
Compiler Optimisations
The Automated Package Build
Build Stages
Build Priority
Supported Build Styles
Working with Variables
Functions for Variable Modifications
Build System Hooks
Available Hooks
Working with Hooks
Filling Hooks
Evaluating Hooks
Command Wrapper
Available Wrappers
Wrapper Configuration
Environment Variables
Hacking with Bash
Bash Version
How to Watch the Value of a Variable While Running a Script
How to Interrupt Scripts Based on Conditions
How to Skip Part of a Script While Testing
Convenient Variables

This chapter gives a quick run-through on the package system. For the information that actually goes into a package - the packaging - see the section called “Description File (.desc)”.

T2 is built out of shell scripts. These scripts access the files in ./config to build the packages from source.

These scripts run with quite some environment variables being set (see the section called “Environment Variables”).

There will come a day when you want to contribute a package to the T2 tree - because you find you are builting that package from source every time you do a clean install.

Mastering the package system is a good idea if you deploy similar configurations across machines. If that is your daily work your job title may be 'system administrator'.

Packages usually get quickly accepted into the T2 SVN trunk source tree and even if not local packages can still be useful.

To get a grip on how the Build scripts work the best thing to do is take one of the smaller standard packages and build them by hand. Start changing parameters and see what happens in /var/adm/logs and the ./src trees.

scripts/Build-Pkg package

By studying existing config files you'll find there are a number of interesting features.

Many standard configure type build doesn't even need scripting. T2 does that all for you.

When packages need special configuration parameters or command sequences write them directly into the shell script.