.. _script-pkg:

Script Package (default)
~~~~~~~~~~~~~~~~~~~~~~~~

A script-based package is the most basic package type available. By default,
packages are considered to be script packages unless explicitly configured to be
another package type (|LIBFOO_TYPE|_). If a developer wishes to explicitly
configure a project as script-based, the following configuration can be used:

.. code-block:: python

   LIBFOO_TYPE = 'script'

A script package has the ability to define three Python stage scripts:

- ``<package>-configure`` - script to invoke during the configuration stage
- ``<package>-build`` - script to invoke during the build stage
- ``<package>-install`` - script to invoke during the installation stage

An example build script (``libfoo-build``) can be as follows:

.. code-block:: python

   #!/usr/bin/env python
   # -*- coding: utf-8 -*-

   releng_execute(['make'])

When a package performs a configuration, build or installation stage; the
respective script (mentioned above) will be invoked. Package scripts are
optional; thus, if a script is not provided for a stage, the stage will be
skipped.

See also `script helpers`_ for helper functions/variables available for use an
`bootstrapping/post-processing <package_bootstrapping_and_postprocessing_>`_ for
more stage script support.
