Resolves: RHEL-55407 - Rebase mod_proxy_cluster to upstream 1.3.20.Final release

This commit is contained in:
Sokratis Zappis 2024-08-21 15:07:53 +03:00
parent 5578a07132
commit 23ccdcb638
6 changed files with 125 additions and 92 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/mod_cluster-1.3.19.Final.tar.gz
/mod_cluster-45265ef9c1f53c71af5241f9deae19fd839263c8.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -1,80 +1,66 @@
#no jars in this native build, so skip signing
%define _jarsign_opts --nocopy
%global namedreltag .Final
%global namedversion %{version}%{?namedreltag}
%global selinuxtype targeted
%define aplibdir %{_libdir}/httpd/modules/
%define serial 1
Name: mod_proxy_cluster
Summary: JBoss mod_proxy_cluster for Apache httpd
Version: 1.3.19
Release: %{serial}%{?dist}.2
License: LGPL-3.0-only
URL: https://github.com/modcluster/mod_cluster
Source0: https://github.com/modcluster/mod_cluster/archive/%{namedversion}/mod_cluster-%{namedversion}.tar.gz
Source1: %{name}.conf.sample
Source2: %{name}.te
Source3: %{name}.fc
# 64 bit natives only
# Update commitid and serial when new sources and release info is available
%global commitid 45265ef9c1f53c71af5241f9deae19fd839263c8
%global serial 1
Name: mod_proxy_cluster
Summary: JBoss mod_proxy_cluster for Apache httpd
Version: 1.3.20
Release: %{serial}%{?dist}
Epoch: 0
License: LGPLv3
Group: Applications/System
URL: https://github.com/modcluster/mod_cluster
# You can get the tarball from https://github.com/modcluster/mod_cluster/archive/45265ef9c1f53c71af5241f9deae19fd839263c8.tar.gz
Source0: mod_cluster-%{commitid}.tar.gz
Source1: %{name}.conf.sample
Source2: %{name}.te
Source3: %{name}.fc
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# 64 bit natives only on RHEL 10
ExcludeArch: i686 i386
BuildRequires: httpd-devel
BuildRequires: apr-devel
BuildRequires: apr-util-devel
BuildRequires: autoconf
BuildRequires: httpd-devel
BuildRequires: apr-devel
BuildRequires: apr-util-devel
BuildRequires: autoconf
BuildRequires: gcc
Requires: (%{name}-selinux if selinux-policy-%{selinuxtype})
Requires: httpd >= 0:2.4.6
Requires: apr
Requires: apr-util
# SELinux subpackage
%package selinux
Summary: mod_proxy_cluster SELinux policy
BuildArch: noarch
Requires: selinux-policy-%{selinuxtype}
Requires(post): selinux-policy-%{selinuxtype}
BuildRequires: selinux-policy-devel
%{?selinux_requires}
%description selinux
mod_proxy_cluster SELinux policy module
BuildRequires: selinux-policy-devel
Requires(post): policycoreutils-python-utils, python3-policycoreutils
Requires(postun): policycoreutils-python-utils, python3-policycoreutils
Requires: httpd >= 0:2.4.6
Requires: apr
Requires: apr-util
%description
JBoss mod_proxy_cluster for Apache httpd.
%prep
%autosetup -n mod_cluster-%{namedversion}
%setup -q -n mod_cluster-%{commitid}
%build
%{!?apxs: %{expand: %%define apxs %{_sbindir}/apxs}}
%define aplibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
pushd native
for i in advertise mod_manager mod_proxy_cluster mod_cluster_slotmem
do
pushd $i
set -e
sh buildconf
export CFLAGS='%{optflags} -fno-strict-aliasing -DMOD_CLUSTER_RELEASE_VERSION="-%{serial}"'
%configure --with-apxs=/usr/bin/apxs
%make_build
./configure --with-apxs=/usr/bin/apxs
make CFLAGS="%{optflags} -fno-strict-aliasing -DMOD_CLUSTER_RELEASE_VERSION=\\\"-%{serial}\\\""
popd
done
popd
# for SELinux
mkdir selinux
cp -p %{SOURCE2} selinux/
cp -p %{SOURCE3} selinux/
make -f %{_datadir}/selinux/devel/Makefile %{name}.pp
bzip2 -9 %{name}.pp
%install
%define aplibdir /usr/lib64/httpd/modules/
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}-%{version}
install -d -m 755 $RPM_BUILD_ROOT/%{aplibdir}/
cp -p native/*/*.so ${RPM_BUILD_ROOT}/%{aplibdir}/
@ -83,49 +69,55 @@ install -d -m 755 $RPM_BUILD_ROOT/%{_localstatedir}/cache/httpd/mod_proxy_cluste
install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/
install -p -m 644 %{SOURCE1} \
$RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/mod_proxy_cluster.conf.sample
install -D -m 0644 %{name}.pp.bz2 %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
%pre selinux
%selinux_relabel_pre -s %{selinuxtype}
%post selinux
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2
%postun selinux
if [ $1 -eq 0 ]; then
%selinux_modules_uninstall -s %{selinuxtype} %{name}
fi
%posttrans selinux
%selinux_relabel_post -s %{selinuxtype}
# for SELinux
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}
mkdir selinux
pushd selinux
cp -p %{SOURCE2} .
cp -p %{SOURCE3} .
make -f %{_datadir}/selinux/devel/Makefile
install -p -m 644 -D %{name}.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/mod_proxy_cluster.pp
popd
%clean
rm -Rf $RPM_BUILD_ROOT
%post
# first install
if [ $1 -eq 1 ]; then
%{_sbindir}/semanage port -a -t http_port_t -p udp 23364 || true
%{_sbindir}/semanage port -a -t http_port_t -p tcp 6666 || true
if [ $1 -eq 1 ] ; then
%{_sbindir}/semodule -i %{_datadir}/selinux/packages/%{name}/mod_proxy_cluster.pp 2>/dev/null || :
%{_sbindir}/semanage port -a -t http_port_t -p udp 23364 >/dev/null 2>&1 || :
%{_sbindir}/semanage port -a -t http_port_t -p tcp 6666 >/dev/null 2>&1 || :
/sbin/restorecon -R /var/cache/httpd/mod_proxy_cluster >/dev/null 2>&1 || :
fi
%postun
# Delete port labeling when the package is removed
if [ $1 -eq 0 ]; then
%{_sbindir}/semanage port -d -t http_port_t -p udp 23364 || true
%{_sbindir}/semanage port -d -t http_port_t -p tcp 6666 || true
%preun
if [ $1 -eq 0 ] ; then
%{_sbindir}/semanage port -d -t http_port_t -p udp 23364 2>&1 || :
%{_sbindir}/semanage port -d -t http_port_t -p tcp 6666 2>&1 || :
%{_sbindir}/semodule -r mod_proxy_cluster >/dev/null 2>&1 || :
/sbin/restorecon -R /var/cache/httpd/mod_proxy_cluster >/dev/null 2>&1 || :
fi
%files
%license lgpl.txt
%{!?apxs: %{expand: %%define apxs /usr/bin/apxs}}
%define aplibdir /usr/lib64/httpd/modules/
%defattr(0644,root,root,0755)
%doc lgpl.txt
%dir %{_localstatedir}/cache/httpd/mod_proxy_cluster
%attr(0755,root,root) %{aplibdir}/*
%{_sysconfdir}/httpd/conf.d/mod_proxy_cluster.conf.sample
%files selinux
%{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.*
%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}
# for SELinux
%dir %{_datadir}/selinux/packages/%{name}
%{_datadir}/selinux/packages/%{name}/mod_proxy_cluster.pp
%changelog
* Wed Aug 21 2024 Sokratis Zappis <szappis@redhat.com> - 1.3.20-1
- Rebase mod_proxy_cluster to upstream 1.3.20.Final tag
- Related: RHEL-55407 - Rebase mod_proxy_cluster to upstream 1.3.20.Final release
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.3.19-1.2
- Bump release for June 2024 mass rebuild

View File

@ -1 +1 @@
SHA512 (mod_cluster-1.3.19.Final.tar.gz) = aa1a9bea6ccc9191e40aa42f6fc291feed24ba7b57ca832a7796d5c7f214a8340bcd7d2c32321efe301cd1a55b9c95af8e9f77b2b1fffd8a25dfd18fa346719d
SHA512 (mod_cluster-45265ef9c1f53c71af5241f9deae19fd839263c8.tar.gz) = 83b0e1f06cf2cabe41a13662a51053bd850f0c613e728997c9ac038682f1936936881402ba11d5fa3365a7d3613f7db731699432374004d289777d994233ca8e

View File

@ -0,0 +1,12 @@
---
- name: Install required packages
dnf:
name: >
httpd, mod_proxy_cluster
- name: Comment out mod_proxy_balancer
command: sed -i 's@LoadModule proxy_balancer_module@#LoadModule proxy_balancer_module@g' /etc/httpd/conf.modules.d/00-proxy.conf
- name: Configure mod_proxy_cluster
command: mv /etc/httpd/conf.d/mod_proxy_cluster.conf.sample /etc/httpd/conf.d/mod_proxy_cluster.conf

22
tests/tests.yml Normal file
View File

@ -0,0 +1,22 @@
- hosts: localhost
remote_user: root
tags:
- classic
roles:
- role: Test_Setup
- role: standard-test-basic
tests:
- verify_httpd_up:
dir: .
run: "curl http://localhost/ &> testfile.log || true && grep '<strong>Test Page</strong>' testfile.log"
- check_error_log_for_unexpected_errors:
dir: .
run: "! sudo grep -i error /var/log/httpd/error_log | grep -v \"AH01276\""
- check_mod_proxy_cluster_configured:
dir: .
run: "grep -e \"mod_cluster/.* configured -- resuming normal operations\" /var/log/httpd/error_log"
required_packages:
- mod_proxy_cluster
- httpd
required_services:
- httpd