diff --git a/ci/cfengine-build-host-setup.cf b/ci/cfengine-build-host-setup.cf index ceb93eb10..a6fe92289 100644 --- a/ci/cfengine-build-host-setup.cf +++ b/ci/cfengine-build-host-setup.cf @@ -427,7 +427,7 @@ bundle agent cfengine_build_host_setup (redhat_8|centos_8).!have_fakeroot:: # special fakeroot, missing from _8 an d up? - "sudo rpm -iv https://kojipkgs.fedoraproject.org//packages/fakeroot/1.23/1.fc29/x86_64/fakeroot-1.23-1.fc29.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/fakeroot/1.23/1.fc29/x86_64/fakeroot-libs-1.23-1.fc29.x86_64.rpm" + "sudo rpm -iv https://kojipkgs.fedoraproject.org//packages/fakeroot/1.23/1.fc29/${sys.arch}/fakeroot-1.23-1.fc29.${sys.arch}.rpm https://kojipkgs.fedoraproject.org//packages/fakeroot/1.23/1.fc29/${sys.arch}/fakeroot-libs-1.23-1.fc29.${sys.arch}.rpm" contain => in_shell; (redhat|centos).!(redhat_7|centos_7).!(redhat_6|centos_6).!epel_release_ok:: diff --git a/ci/linux-install-pcre2.sh b/ci/linux-install-pcre2.sh new file mode 100755 index 000000000..64c785ad6 --- /dev/null +++ b/ci/linux-install-pcre2.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# args: +# $1 - destination for build e.g. /opt would result in /opt/pcre2 and /opt/pcre2/lib as the build destination. default is /opt + +dest="${dest:-/opt}" + +GAINROOT="" +if [ "$(id -u)" != "0" ]; then + GAINROOT="sudo" + if ! command -v sudo >/dev/null; then + echo "Sorry, either run $0 as root or install sudo." + exit 1 + fi +fi + +set -e +buildscripts_dir="$(cd $(dirname "$0"); cd ..; pwd)" + +if [ -d "$dest"/pcre2 ]; then + echo "pcre2 already built to $dest/pcre2, removing and building again..." + $GAINROOT rm -rf "$dest/pcre2" +fi + +tmpdir="$(mktemp -d)" +echo "Building pcre2 in $tmpdir..." + +( + cd "$tmpdir" + source="$(head -1 "$buildscripts_dir"/deps-packaging/pcre2/source)" + head -1 "$buildscripts_dir"/deps-packaging/pcre2/distfiles > distfile + tarball="$(awk '{print $2}' distfile)" + curl --fail --location --silent --show-error --output "$tarball" "$source$tarball" + sha256sum --check distfile + + tar xf "$tarball" + cd "${tarball%.tar.gz}" + ./configure --prefix="$dest"/pcre2 --libdir="$dest"/pcre2/lib + make + $GAINROOT make install +) +rm -rf "$tmpdir" diff --git a/ci/setup-cfengine-build-host.sh b/ci/setup-cfengine-build-host.sh index 5e95491f0..25158578d 100755 --- a/ci/setup-cfengine-build-host.sh +++ b/ci/setup-cfengine-build-host.sh @@ -317,10 +317,22 @@ if [ ! -x /var/cfengine/bin/cf-agent ]; then software git echo "cf-remote didn't install cf-agent, try from source" rm -rf core # just in case we are repeating the script + + # Here we need to take care of some dependencies on older platforms + OPTS="" + if grep -q rhel /etc/os-release; then + if grep -qi version=\"8 /etc/os-release; then + # rhel-8 pcre2 is too old so we must install a sufficient one (10.34+) for libntech as of 2023-12-05 https://github.com/NorthernTechHQ/libntech/commit/12ddb1151629a84a5a13056ecccdc20a0d1d6a0c + software gcc make + "$thisdir"/linux-install-pcre2.sh /opt + OPTS="--with-pcre2=/opt/pcre2" + fi + fi + git clone --recursive --depth 1 https://github.com/cfengine/core ( cd core - ./ci/install.sh + OPTS="$OPTS" ./ci/install.sh ) fi