KEA_ADMIN_INSTALLED = PREFIX / SBINDIR / 'kea-admin'
KEA_LFC_BUILT = TOP_BUILD_DIR / 'src/bin/lfc/kea-lfc'
KEA_LFC_INSTALLED = PREFIX / SBINDIR / 'kea-lfc'
+LOCALSTATEDIR_INSTALLED = PREFIX / LOCALSTATEDIR
+LIBDIR_INSTALLED = PREFIX / LIBDIR
LOGDIR = LOCALSTATEDIR / 'log/kea'
LOGDIR_INSTALLED = PREFIX / LOGDIR
RUNSTATEDIR = LOCALSTATEDIR / 'run/kea'
# HOOK_RPATH = '$ORIGIN/../..'
BUILD_RPATH = TOP_BUILD_DIR / 'src/lib'
-INSTALL_RPATH = PREFIX / LIBDIR
+INSTALL_RPATH = LIBDIR_INSTALLED
# Add rpaths for NETCONF dependencies.
if NETCONF_DEP.found()
keactrl_conf_data = configuration_data()
-keactrl_conf_data.set('prefix', PREFIX)
-keactrl_conf_data.set('sysconfdir', '${prefix}/' + SYSCONFDIR)
keactrl_conf_data.set('PACKAGE', 'kea')
keactrl_conf_data.set('exec_prefix', '${prefix}')
+keactrl_conf_data.set('prefix', PREFIX)
keactrl_conf_data.set('sbindir', '${prefix}/' + SBINDIR)
+keactrl_conf_data.set('sysconfdir', '${prefix}/' + SYSCONFDIR)
if NETCONF_DEP.found()
keactrl_conf_data.set('HAVE_NETCONF', 'yes')
else
keactrl_conf_data.set('PACKAGE_VERSION', PROJECT_VERSION)
keactrl_conf_data.set('runstatedir', '${prefix}/' + LOCALSTATEDIR + '/run')
keactrl_conf_data.set('localstatedir', '${prefix}/' + LOCALSTATEDIR)
+
+kea_conf_data = configuration_data()
+kea_conf_data.set('libdir', LIBDIR_INSTALLED)
+kea_conf_data.set('localstatedir', LOCALSTATEDIR_INSTALLED)
+
kea_configfiles_destdir = SYSCONFDIR / 'kea'
configure_file(
input: 'keactrl.conf.in',
configure_file(
input: 'kea-dhcp4.conf.pre',
output: 'kea-dhcp4.conf',
- command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'],
- install: true,
+ configuration: kea_conf_data,
install_dir: kea_configfiles_destdir,
)
configure_file(
input: 'kea-dhcp6.conf.pre',
output: 'kea-dhcp6.conf',
- command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'],
- install: true,
+ configuration: kea_conf_data,
install_dir: kea_configfiles_destdir,
)
configure_file(
input: 'kea-dhcp-ddns.conf.pre',
output: 'kea-dhcp-ddns.conf',
- command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'],
- install: true,
+ configuration: kea_conf_data,
install_dir: kea_configfiles_destdir,
)
configure_file(
input: 'kea-ctrl-agent.conf.pre',
output: 'kea-ctrl-agent.conf',
- command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'],
- install: true,
+ configuration: kea_conf_data,
install_dir: kea_configfiles_destdir,
)
configure_file(
input: 'kea-netconf.conf.pre',
output: 'kea-netconf.conf',
- command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'],
+ configuration: kea_conf_data,
install: NETCONF_DEP.found(),
install_dir: kea_configfiles_destdir,
)
+++ /dev/null
-#!/bin/sh
-
-# Copyright (C) 2014-2025 Internet Systems Consortium, Inc. ("ISC")
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# This script replaces @prefix@, @localstatedir@ and other automake/autoconf
-# variables with their actual content.
-#
-# Invocation:
-#
-# ./path_replacer.sh input-file.in output-file
-#
-# This script is initially used to generate configuration files, but it is
-# generic and can be used to generate any text files.
-
-# shellcheck disable=SC2034
-# SC2034: ... appears unused. Verify use (or export if used externally).
-
-# Exit with error if commands exit with non-zero and if undefined variables are
-# used.
-set -eu
-
-prefix="@prefix@"
-sysconfdir="@sysconfdir@"
-localstatedir="@localstatedir@"
-exec_prefix="@exec_prefix@"
-libdir="@libdir@"
-
-echo "Replacing \@prefix\@ with ${prefix}"
-echo "Replacing \@libdir\@ with ${libdir}"
-echo "Replacing \@sysconfdir\@ with ${sysconfdir}"
-echo "Replacing \@localstatedir\@ with ${localstatedir}"
-
-echo "Input file: $1"
-echo "Output file: $2"
-
-sed -e "s@SEP@\@libdir\@@SEP@${libdir}@SEP@g; s@SEP@\@localstatedir\@@SEP@${localstatedir}@SEP@g; s@SEP@\@prefix\@@SEP@${prefix}@SEP@g; s@SEP@\@sysconfdir\@@SEP@${sysconfdir}@SEP@g" "${1}" > "${2}"