src2pkg Options & Variables

As seen in the Internal Execution section, the src2pkg functions are driven and controlled by using variables. The src2pkg options are also controlled by setting variables. This section takes a closer look at the different types of variables to see how, when and where to use them. The discussion here centers on the syntax as used in sr2pkg build scripts -see the --help output or man-page for src2pkg or trackinstall for the corresponding syntax.

Option types

  1. Administrative options like working directories or prompting preferences
  2. Transient User Options
  3. Build Options
  4. Advanced Features Options

Notes

1. The administrative options are usually changed by editing the /etc/src2pkg/src2pkg.conf file which contains comments on usage of these options. These options are used to change the default src2pkg behaviour, such as where to find sources, where to unpack and build them and where to leave the final compressed package when finished. Default prompting options can also be set here. src2pkg can be run without a src2pkg.conf file since sane defaults are set in the DEFINES and FUNCTIONS files. But changes you make to src2pkg.conf will override these defaults.

2. Transient User Options -many of the administrative options above can be overridden on a case-by-case basis from the command-line when needed. This category also includes other options which are used on a temporary basis without affecting the content of the final package. Examples include the CLEANUP and USE_OBJ_DIR options.

3. Build Options -these are the main options which may affect package content or compiling success.

    EXTRA_CONFIGS -this is probably the most used of all options. It is used to pass extra arguments to the configure script found in source-code archives. Sometimes you'll need or want to pass arguments like '--without-gnome' or '--disable-tests' to configure in order for the sources to configure and compile correctly. Note that the installation prefix for the package('--prefix=???') is set separately for your convenience with the PRE_FIX variable which is set to /usr by default.
    CONFIG_COMMAND is the command run to configure sources -usually just 'configure'.

Here's an example which uses the above 3 variables. Usually you won't need to change all three of these at once, but they are kept separate so it is possible when needed. Say you have sources which need to be configured with this line:
./configure Linux --prefix=/opt/myprogram --with-gnu-ld
You'd pass all that to src2pkg like this (in a sr2pkg script):
CONFIG_COMMAND='configure Linux'
PRE_FIX=/opt/myprogram
EXTRA_CONFIGS='--with-gnu-ld'

4. Advanced Options -src2pkg contains several features which may be used to produce what might be considered non-standard packages. Most of these options revolve around creating smaller packages, but others may be used to create or preserve logfiles or other information.
Text