From cd2e58b898fb00d73b6f2a0ff5a322a8be42d49e Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Tue, 13 May 2025 22:32:23 +0300 Subject: [PATCH] [#3734] Remove unnecessary path_replacer.sh --- meson.build | 4 +++- src/bin/keactrl/meson.build | 23 +++++++++++---------- tools/.gitignore | 1 - tools/meson.build | 5 ----- tools/path_replacer.sh.in | 40 ------------------------------------- 5 files changed, 15 insertions(+), 58 deletions(-) delete mode 100755 tools/path_replacer.sh.in diff --git a/meson.build b/meson.build index 9bf35e07c0..a2dbd9d840 100644 --- a/meson.build +++ b/meson.build @@ -67,6 +67,8 @@ KEA_ADMIN_BUILT = TOP_BUILD_DIR / 'src/bin/admin/kea-admin' 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' @@ -574,7 +576,7 @@ link_args = [] # 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() diff --git a/src/bin/keactrl/meson.build b/src/bin/keactrl/meson.build index 9012825977..0b5b860844 100644 --- a/src/bin/keactrl/meson.build +++ b/src/bin/keactrl/meson.build @@ -1,9 +1,9 @@ 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 @@ -16,6 +16,11 @@ keactrl_conf_data.set( 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', @@ -32,35 +37,31 @@ configure_file( 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, ) diff --git a/tools/.gitignore b/tools/.gitignore index 22040ce2d3..df41b5c14d 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -1,2 +1 @@ /extract_bnf.sh -/path_replacer.sh diff --git a/tools/meson.build b/tools/meson.build index 64184d7312..8095dffa00 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -15,11 +15,6 @@ if AWK.found() else tools_conf_data.set('AWK', 'awk') endif -PATH_REPLACER = configure_file( - input: 'path_replacer.sh.in', - output: 'path_replacer.sh', - configuration: tools_conf_data, -) configure_file( input: 'extract_bnf.sh.in', output: 'extract_bnf.sh', diff --git a/tools/path_replacer.sh.in b/tools/path_replacer.sh.in deleted file mode 100755 index 468f2b6581..0000000000 --- a/tools/path_replacer.sh.in +++ /dev/null @@ -1,40 +0,0 @@ -#!/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}"