2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-22 09:57:41 +00:00

[#3734] Remove unnecessary path_replacer.sh

This commit is contained in:
Andrei Pavel 2025-05-13 22:32:23 +03:00
parent c46442bc16
commit cd2e58b898
No known key found for this signature in database
GPG Key ID: D4E804481939CB21
5 changed files with 15 additions and 58 deletions

View File

@ -67,6 +67,8 @@ KEA_ADMIN_BUILT = TOP_BUILD_DIR / 'src/bin/admin/kea-admin'
KEA_ADMIN_INSTALLED = PREFIX / SBINDIR / 'kea-admin' KEA_ADMIN_INSTALLED = PREFIX / SBINDIR / 'kea-admin'
KEA_LFC_BUILT = TOP_BUILD_DIR / 'src/bin/lfc/kea-lfc' KEA_LFC_BUILT = TOP_BUILD_DIR / 'src/bin/lfc/kea-lfc'
KEA_LFC_INSTALLED = PREFIX / SBINDIR / 'kea-lfc' KEA_LFC_INSTALLED = PREFIX / SBINDIR / 'kea-lfc'
LOCALSTATEDIR_INSTALLED = PREFIX / LOCALSTATEDIR
LIBDIR_INSTALLED = PREFIX / LIBDIR
LOGDIR = LOCALSTATEDIR / 'log/kea' LOGDIR = LOCALSTATEDIR / 'log/kea'
LOGDIR_INSTALLED = PREFIX / LOGDIR LOGDIR_INSTALLED = PREFIX / LOGDIR
RUNSTATEDIR = LOCALSTATEDIR / 'run/kea' RUNSTATEDIR = LOCALSTATEDIR / 'run/kea'
@ -574,7 +576,7 @@ link_args = []
# HOOK_RPATH = '$ORIGIN/../..' # HOOK_RPATH = '$ORIGIN/../..'
BUILD_RPATH = TOP_BUILD_DIR / 'src/lib' BUILD_RPATH = TOP_BUILD_DIR / 'src/lib'
INSTALL_RPATH = PREFIX / LIBDIR INSTALL_RPATH = LIBDIR_INSTALLED
# Add rpaths for NETCONF dependencies. # Add rpaths for NETCONF dependencies.
if NETCONF_DEP.found() if NETCONF_DEP.found()

View File

@ -1,9 +1,9 @@
keactrl_conf_data = configuration_data() 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('PACKAGE', 'kea')
keactrl_conf_data.set('exec_prefix', '${prefix}') keactrl_conf_data.set('exec_prefix', '${prefix}')
keactrl_conf_data.set('prefix', PREFIX)
keactrl_conf_data.set('sbindir', '${prefix}/' + SBINDIR) keactrl_conf_data.set('sbindir', '${prefix}/' + SBINDIR)
keactrl_conf_data.set('sysconfdir', '${prefix}/' + SYSCONFDIR)
if NETCONF_DEP.found() if NETCONF_DEP.found()
keactrl_conf_data.set('HAVE_NETCONF', 'yes') keactrl_conf_data.set('HAVE_NETCONF', 'yes')
else else
@ -16,6 +16,11 @@ keactrl_conf_data.set(
keactrl_conf_data.set('PACKAGE_VERSION', PROJECT_VERSION) keactrl_conf_data.set('PACKAGE_VERSION', PROJECT_VERSION)
keactrl_conf_data.set('runstatedir', '${prefix}/' + LOCALSTATEDIR + '/run') keactrl_conf_data.set('runstatedir', '${prefix}/' + LOCALSTATEDIR + '/run')
keactrl_conf_data.set('localstatedir', '${prefix}/' + LOCALSTATEDIR) 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' kea_configfiles_destdir = SYSCONFDIR / 'kea'
configure_file( configure_file(
input: 'keactrl.conf.in', input: 'keactrl.conf.in',
@ -32,35 +37,31 @@ configure_file(
configure_file( configure_file(
input: 'kea-dhcp4.conf.pre', input: 'kea-dhcp4.conf.pre',
output: 'kea-dhcp4.conf', output: 'kea-dhcp4.conf',
command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'], configuration: kea_conf_data,
install: true,
install_dir: kea_configfiles_destdir, install_dir: kea_configfiles_destdir,
) )
configure_file( configure_file(
input: 'kea-dhcp6.conf.pre', input: 'kea-dhcp6.conf.pre',
output: 'kea-dhcp6.conf', output: 'kea-dhcp6.conf',
command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'], configuration: kea_conf_data,
install: true,
install_dir: kea_configfiles_destdir, install_dir: kea_configfiles_destdir,
) )
configure_file( configure_file(
input: 'kea-dhcp-ddns.conf.pre', input: 'kea-dhcp-ddns.conf.pre',
output: 'kea-dhcp-ddns.conf', output: 'kea-dhcp-ddns.conf',
command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'], configuration: kea_conf_data,
install: true,
install_dir: kea_configfiles_destdir, install_dir: kea_configfiles_destdir,
) )
configure_file( configure_file(
input: 'kea-ctrl-agent.conf.pre', input: 'kea-ctrl-agent.conf.pre',
output: 'kea-ctrl-agent.conf', output: 'kea-ctrl-agent.conf',
command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'], configuration: kea_conf_data,
install: true,
install_dir: kea_configfiles_destdir, install_dir: kea_configfiles_destdir,
) )
configure_file( configure_file(
input: 'kea-netconf.conf.pre', input: 'kea-netconf.conf.pre',
output: 'kea-netconf.conf', output: 'kea-netconf.conf',
command: [PATH_REPLACER, '@INPUT@', '@OUTPUT@'], configuration: kea_conf_data,
install: NETCONF_DEP.found(), install: NETCONF_DEP.found(),
install_dir: kea_configfiles_destdir, install_dir: kea_configfiles_destdir,
) )

1
tools/.gitignore vendored
View File

@ -1,2 +1 @@
/extract_bnf.sh /extract_bnf.sh
/path_replacer.sh

View File

@ -15,11 +15,6 @@ if AWK.found()
else else
tools_conf_data.set('AWK', 'awk') tools_conf_data.set('AWK', 'awk')
endif endif
PATH_REPLACER = configure_file(
input: 'path_replacer.sh.in',
output: 'path_replacer.sh',
configuration: tools_conf_data,
)
configure_file( configure_file(
input: 'extract_bnf.sh.in', input: 'extract_bnf.sh.in',
output: 'extract_bnf.sh', output: 'extract_bnf.sh',

View File

@ -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}"