Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/cfengine-build-host-setup.cf
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
41 changes: 41 additions & 0 deletions ci/linux-install-pcre2.sh
Original file line number Diff line number Diff line change
@@ -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"
14 changes: 13 additions & 1 deletion ci/setup-cfengine-build-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading