K.1. General call to Test the ability to configure and build

Check out from git, generate files and configure to tailor to your build environment, and build some tests:

:; mkdir -p nut && cd nut && \
    git clone https://github.com/networkupstools/nut/ -b master .
:; ./autogen.sh && \
    ./configure --with-doc=all --with-all --with-cgi && \
    make all && make check && make spellcheck

You can toggle some configure options to check different dependency variants, e.g. --with-ssl=nss vs. --with-ssl=openssl

For reproducible runs of various pre-sets of configuration during development, take a look at ci_build.sh script and different BUILD_TYPE (and other) environment variable settings that it supports. A minimal run with it is just to call the script, e.g.:

:; mkdir -p nut && cd nut && \
   git clone https://github.com/networkupstools/nut/ -b fightwarn .
:; ./ci_build.sh

Note

To build older releases, such as "vanilla" NUT 2.7.4 and older, you may need to address some nuances:

  • Ensure that python in PATH points to a python-2.x implementation (master branch is fixed to work with python 2 and 3)
  • Ensure that bash is your user and maybe system shell (or ensure the generated configure script gets interpreted by it)
  • Generally you may have better results with GNU Make newer than 3.81 than with other make implementations; however, builds are regularly tested by CI with Sun dmake and BSD make as well, so recipes should not expect GNU-only syntax and constructs to work
  • Parallel builds should be okay in current development version and since NUT 2.8.0 (is a bug to log and fix, if not), but they may be failure-prone in 2.7.4 and earlier releases

For intensive rebuilds, ccache is recommended. Note that instructions below detail how to provide its directory with symlinks as /usr/lib/ccache which is not the default case in all OS distributions. Recent versions of the NUT ci_build.sh script allow to override the location by using the CI_CCACHE_SYMLINKDIR environment variable, which is cumbersome and only recommended for build agents with immutable system areas, etc.