Skip to content
2 changes: 1 addition & 1 deletion build-scripts/detect-environment
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ detect_distribution() {
# CentOS Linux release 7.6.1810 (Core)
OS=centos
;;
"Red Hat Enterprise Linux "*)
"Red Hat Enterprise Linux "*|"Rocky Linux release "*)
# Example output for RHEL:
# Red Hat Enterprise Linux release 8.10 (Ootpa)
OS=rhel
Expand Down
8 changes: 8 additions & 0 deletions build-scripts/labels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ PACKAGES_HUB_x86_64_linux_debian_11
PACKAGES_HUB_arm_64_linux_debian_11
PACKAGES_HUB_x86_64_linux_debian_12
PACKAGES_HUB_arm_64_linux_debian_12
PACKAGES_HUB_x86_64_linux_debian_13
PACKAGES_HUB_arm_64_linux_debian_13

PACKAGES_HUB_x86_64_linux_redhat_7
PACKAGES_HUB_x86_64_linux_redhat_8
PACKAGES_HUB_x86_64_linux_redhat_9
PACKAGES_HUB_x86_64_linux_redhat_10
PACKAGES_HUB_arm_64_linux_redhat_10

PACKAGES_HUB_x86_64_linux_ubuntu_20
PACKAGES_HUB_x86_64_linux_ubuntu_22
Expand All @@ -19,10 +23,14 @@ PACKAGES_x86_64_linux_debian_11
PACKAGES_arm_64_linux_debian_11
PACKAGES_x86_64_linux_debian_12
PACKAGES_arm_64_linux_debian_12
PACKAGES_x86_64_linux_debian_13
PACKAGES_arm_64_linux_debian_13

PACKAGES_x86_64_linux_redhat_7
PACKAGES_x86_64_linux_redhat_8
PACKAGES_x86_64_linux_redhat_9
PACKAGES_x86_64_linux_redhat_10
PACKAGES_arm_64_linux_redhat_10

PACKAGES_x86_64_linux_suse_12
PACKAGES_x86_64_linux_suse_15
Expand Down
2 changes: 2 additions & 0 deletions build-scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ rpm | lpp)
# eval is needed to preserve spaces in arguments within quotes
# Example: --define 'with_expansion 1' needs to be passed as two args
log_debug "Building RPM package with rpmbuild"
# rhel-10 rpmbuild is more picky about /var/cfengine/lib RPATH we need
export QA_RPATHS=$(( 0x0002 ))
eval rpmbuild -bb \
--define "'_topdir $BASEDIR/$PKG'" \
--define "'buildprefix $BUILDPREFIX'" \
Expand Down
4 changes: 3 additions & 1 deletion deps-packaging/apache/cfbuild-apache.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Release: 1
Source0: httpd-%{apache_version}.tar.gz
Source1: httpd.conf
Patch0: apachectl.patch
Patch1: fixed-implicit-decl-gettid.patch
License: MIT
Group: Other
Url: https://cfengine.com
Expand All @@ -21,7 +22,8 @@ AutoReqProv: no
mkdir -p %{_builddir}
%setup -q -n httpd-%{apache_version}

%patch0 -p0
%patch -P 0
%patch -P 1 -p1

CPPFLAGS=-I%{buildprefix}/include

Expand Down
3 changes: 1 addition & 2 deletions deps-packaging/leech/cfbuild-leech.spec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ mkdir -p %{_builddir}
./configure --prefix=%{prefix} --enable-shared --disable-static

rm -f ${RPM_BUILD_ROOT}%{prefix}/lib/libleech.a
rm -f ${RPM_BUILD_ROOT}%{prefix}/lib/libleech.la

%build

Expand All @@ -31,6 +30,7 @@ make
rm -rf ${RPM_BUILD_ROOT}

make install DESTDIR=${RPM_BUILD_ROOT}
rm -f ${RPM_BUILD_ROOT}%{prefix}/lib/libleech.la

%clean
rm -rf $RPM_BUILD_ROOT
Expand Down Expand Up @@ -59,6 +59,5 @@ CFEngine Build Automation -- leech -- development files
%{prefix}/include/*.h

%dir %{prefix}/lib
%{prefix}/lib/*.la

%changelog
3 changes: 1 addition & 2 deletions deps-packaging/librsync/cfbuild-librsync.spec
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ touch -t 0001010102 ar-lib
./configure --prefix=%{prefix} --enable-shared --disable-static

rm -f ${RPM_BUILD_ROOT}%{prefix}/lib/librsync.a
rm -f ${RPM_BUILD_ROOT}%{prefix}/lib/librsync.la

%build

Expand All @@ -63,6 +62,7 @@ make
rm -rf ${RPM_BUILD_ROOT}

make install DESTDIR=${RPM_BUILD_ROOT}
rm -f ${RPM_BUILD_ROOT}%{prefix}/lib/librsync.la

%clean
rm -rf $RPM_BUILD_ROOT
Expand Down Expand Up @@ -91,7 +91,6 @@ CFEngine Build Automation -- librsync -- development files
%{prefix}/include/*.h

%dir %{prefix}/lib
%{prefix}/lib/*.la
%{prefix}/lib/pkgconfig

%changelog
2 changes: 1 addition & 1 deletion deps-packaging/libyaml/cfbuild-libyaml.spec
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ $MAKE
%install
rm -rf ${RPM_BUILD_ROOT}
$MAKE DESTDIR=${RPM_BUILD_ROOT} install
rm -rf ${RPM_BUILD_ROOT}%{prefix}/lib/libyaml.la

%clean
rm -rf $RPM_BUILD_ROOT
Expand Down Expand Up @@ -65,7 +66,6 @@ CFEngine Build Automation -- lmdb -- development files
%dir %{prefix}/lib
%{prefix}/lib/pkgconfig
%{prefix}/lib/*.a
%{prefix}/lib/*.la

%changelog

Expand Down
13 changes: 11 additions & 2 deletions deps-packaging/pkg-build-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@ if [ $TARGET != native ]; then
exit 42
fi

# deps packages may result in binaries without debug symbols even when debugsym=yes aka BUILD_TYPE=DEBUG
# to avoid rpmbuild errors when this occurs, allow empties
RPMBUILD_OPTIONS="$RPMBUILD_OPTIONS --define '_empty_manifest_terminate_build 0'"

case "$TESTS" in
no)
RPMBUILD_OPTIONS="--define 'with_testsuite 0'";;
RPMBUILD_OPTIONS="$RPMBUILD_OPTIONS --define 'with_testsuite 0'";;
yes)
RPMBUILD_OPTIONS="--define 'with_testsuite 1'";;
RPMBUILD_OPTIONS="$RPMBUILD_OPTIONS --define 'with_testsuite 1'";;
*)
fatal "Unknown tests option: $TESTS";;
esac
Expand Down Expand Up @@ -112,6 +116,11 @@ fi
# example cmd --define 'a b':
# - argv[1] = --define
# - argv[2] = a b

# We have /var/cfengine/lib in RPATHS which should be OK
# We asked in https://github.com/rpm-software-management/rpm/issues/3982, and it seems allowing this is OK
# 0x0002 - contains an invalid RPATH - in our case /var/cfengine/lib is OK so allow it as an exception
export QA_RPATHS=$(( 0x0002 ))
eval rpmbuild -bb \
--define "'_topdir $BASEDIR/$PKGNAME'" \
--define "'version $VERSION'" \
Expand Down