kea-custom-hooks
FeM custom hooks libraries for Kea DHCP
Installation

Dependencies

  • Build from source
    • build-essential
    • CMake
    • make or ninja-build (we're using ninja-build here)
    • pkg-config
    • libboost-dev
    • libcurl-dev
    • libhiredis-dev
    • nlohmann-json-dev
    • kea-dev
    • xmlrpc-c
  • Runtime
    • libcurl
    • libhiredis0.14 (or similar)
    • libpqxx >= 7
    • kea-common
    • xmlrpc-c
  • Testing
    • gtest
    • xq
    • Redis
    • PostgreSQL
    • AdminDB database

Information regarding Debian: As of 2021-10-22 Debian doesn't provide the required version of libpqxx. The version isn't even available in sid, so a manual build process from the Debian sources is necessary.

Building a release build

Cloning the repo

$ git clone https://gitlab.fem-net.de/admindb/kea-custom-hooks.git
$ cd kea-custom-hooks

Configuring the build

Example configuration:

  • ninja instead of make
  • Release
  • without unit tests
  • with deb-package generation
$ mkdir -p Release && cd Release
$ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=false -DCPACK_GENERATOR=DEB -DCMAKE_INSTALL_PREFIX=/usr

Note: The CMAKE_INSTALL_PREFIX is required for some file to be installed correctly. While the default for a local install is /usr/local and works perfectly fine, the deb packaging assumes /usr as prefix for installing files while using /usr/local for linker rpaths, unless CMAKE_INSTALL_PREFIX is set correctly. This results in binaries not finding the required shared libraries under certain circumstances if CMAKE_INSTALL_PREFIX is not set.

Compiling the source code

$ ninja

Generating the deb-package (optional, recommended)

$ ninja package

The package is now located under pkg in the build-directory (in this case .../kea-custom-hooks/Release/pkg) and can be installed using dpkg -i.

Installing (witout deb-package, not recommended)

If deb-package generation is not desired (although not recommended), the libraries can be installed as usual:

# ninja install

Note: If desired, -DCMAKE_INSTALL_PREFIX=/usr (or similar) might be set during configure time to install to the /usr prefix. This should, however, be avoided if the system has a package manager (which is very likely).