Skip to content

Commit 9b8dd77

Browse files
Merge pull request #1537 from craigcomstock/ENT-12042-fix/3.21
Fixed up build host policy and build-environment-check for centos/redhat (3.21)
2 parents 81055a2 + 6fe4558 commit 9b8dd77

3 files changed

Lines changed: 23 additions & 14 deletions

File tree

build-scripts/build-environment-check

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
case "$OS" in
1919
rhel|centos)
20-
DEP_LIST="gcc-c++ ncurses ncurses-devel pkgconfig rpm-build pam-devel"
20+
DEP_LIST="gcc-c++ ncurses ncurses-devel pkgconfig pam-devel"
2121
UNWANTED_DEPS="libtool-ltdl libtool-ltdl-devel"
2222
;;
2323
debian|ubuntu)
@@ -32,10 +32,16 @@ case "$OS" in
3232
;;
3333
esac
3434

35+
3536
# Fakeroot is here: http://dl.atrpms.net/el5-$1/atrpms/stable/fakeroot-1.6.4-15.1.el5.$1.rpm
3637
# It is needed by the debian buildslaves for their packaging scripts
3738
case "$OS-$OS_VERSION" in
38-
rhel-* | centos-* ) DEP_LIST="$DEP_LIST" ;;
39+
rhel-6|centos-6)
40+
DEP_LIST="$DEP_LIST rpm-build"
41+
;;
42+
rhel-* | centos-* )
43+
DEP_LIST="$DEP_LIST rpm-build-libs"
44+
;;
3945
*) DEP_LIST="$DEP_LIST fakeroot" ;;
4046
esac
4147

ci/cfengine-build-host-setup.cf

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ bundle agent cfengine_build_host_setup
2020
"shellcheck" comment => "not sure why only ubuntu-20 needed this.";
2121
debian.(!debian_12.!ubuntu_22)::
2222
"python" comment => "debian-12 has only python3";
23-
!(debian_9|ubuntu_16).(debian|ubuntu)::
24-
"default-jre" comment => "on debian10+ and ubuntu18+ this will be jdk11, good enough for jenkins 2.426.1 https://www.jenkins.io/doc/book/platform-information/support-policy-java/index.html";
23+
!(debian_9|ubuntu_16).(debian|ubuntu)::
24+
"default-jre" comment => "on debian10+ and ubuntu18+ this will be jdk11, good enough for jenkins 2.426.1 https://www.jenkins.io/doc/book/platform-information/support-policy-java/index.html";
2525

2626
debian|ubuntu::
2727
"libltdl7" package_policy => "delete";
@@ -61,7 +61,7 @@ bundle agent cfengine_build_host_setup
6161
"pam-devel";
6262
"rsync";
6363
"make";
64-
"rpm-build";
64+
"libtool-ltdl" package_policy => "delete";
6565

6666
(redhat|centos).(yum_dnf_conf_ok)::
6767
"expat-devel";
@@ -72,7 +72,13 @@ bundle agent cfengine_build_host_setup
7272
"perl-Module-Load-Conditional";
7373
"wget";
7474

75+
!(redhat_6|centos_6).(yum_dnf_conf_ok)::
76+
"rpm-build-libs" handle => "rpm_build_installed";
77+
"python3-psycopg2";
78+
7579
(redhat_6|centos_6).(yum_dnf_conf_ok)::
80+
"rpm-build" handle => "rpm_build_installed";
81+
"python-psycopg2" comment => "centos-6 provides python2 and psycopg2 for python2 as a package";
7682
"perl-IO-Compress-Zlib" comment => "provides perl(IO::Uncompress::Gunzip) needed by lcov dependency package";
7783
"perl-JSON";
7884
# perl-Digest-MD5 and perl-Data-Dumper are included in perl for centos-6
@@ -87,7 +93,7 @@ bundle agent cfengine_build_host_setup
8793

8894
(redhat_6|centos_6).(yum_dnf_conf_ok)::
8995
"python-psycopg2" comment => "centos-6 provides python2 and psycopg2 for python2 as a package";
90-
(redhat_7|centos_7).(yum_dnf_conf_ok)::
96+
!(redhat_6|centos_6).(yum_dnf_conf_ok)::
9197
"python3-psycopg2";
9298

9399
# note that shellcheck, fakeroot and ccache require epel-release to be installed
@@ -232,12 +238,9 @@ bundle agent cfengine_build_host_setup
232238
comment => "even though rhel8/9 come with /bin/perl perl >= 5.8.8 is needed by cfbuild-lcov-1.16-1.noarch. So the package must be installed.";
233239
redhat_9.!have_python3_pip_package_installed.(yum_dnf_conf_ok)::
234240
"yum install -y python3-pip" contain => in_shell;
235-
redhat_8|centos_8|redhat_9::
236-
"sudo sed -ri 's/^%_enable_debug_packages/#\0/' /usr/lib/rpm/redhat/macros" contain => in_shell;
237-
# todo, need 2.7pip psycopg2-binary for ubuntu-20 as well?
238-
debian_11.!have_pip2::
239-
"wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -O get-pip.py && python2 get-pip.py && pip install psycopg2-binary"
240-
contain => in_shell;
241+
redhat_8|centos_8|redhat_9|centos_9::
242+
"sudo sed -ri 's/^%_enable_debug_packages/#\0/' /usr/lib/rpm/redhat/macros" contain => in_shell,
243+
depends_on => { "rpm_build_installed" };
241244

242245
ubuntu_16.!have_i386_architecture:: # mingw build host
243246
"${paths.dpkg} --add-architecture i386";

ci/setup-cfengine-build-host.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ policy="$(dirname "$0")"/cfengine-build-host-setup.cf
111111
chmod 600 "$policy"
112112
/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee promises.log
113113
grep -i error: promises.log && exit 1
114-
/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee promises.log
114+
/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee -a promises.log
115115
grep -i error: promises.log && exit 1
116-
/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee promises.log
116+
/var/cfengine/bin/cf-agent -KIf "$policy" -b cfengine_build_host_setup | tee -a promises.log
117117
grep -i error: promises.log && exit 1
118118

119119
cleanup

0 commit comments

Comments
 (0)