Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Michal Pospíšil
747fab5801 pcs-0.11.10-1.fc41
- Rebased to the latest sources (see CHANGELOG.md)
- Updated pcs-web-ui to 0.1.23
2025-09-16 17:32:29 +02:00
Michal Pospíšil
542cbafe5b pcs-0.11.9-1
- Rebased to the latest sources (see CHANGELOG.md)
- Updated pcs-web-ui to 0.1.22

- Support tilde in version - for correct sorting of prerelease upstream version by RPM - %{version} expands with the tilde, use %{clean_version} to get upstream version
- Added pkgconfig file for pcs
- Removed Requires: rubygem-rack-test - this is a build requirement.
- Improved BuildRequires for systemd scriptlet macros according to packaging guidelines
- Replaced ${RPM_BUILD_ROOT} in favor of %buildroot to match the upstream spec
- Revamped and unified tarball version management between pcs and pcs-web-ui - version numbers are needed for untagged releases, as git-version-gen takes the version from a git tag present in official released tarballs. To build an unreleased version of pcs, a commit hash is declared in a macro and .tarball-version is generated from rpm version and the hash. For tagged releases, .tarball-version is not generated but rpm version is used for file names and such. Pcs-web-ui uses a different version than pcs, so the rpm version cannot be used. Instead, pcs-web-ui version always has to be declared in the spec file anyway, so it will now serve as the fallback version for generating the .tarball-version for pcs-web-ui.
- Added BuildRequires: pkgconf as autotools need to process pc files from cluster packages
- The path to webui_public_dir passed to pcs-web-ui autotools is hardcoded. The pcs.pc file is not available since pcs is built in the same SRPM. It is not possible to get the path from a compiled pc file after running configure from pcs because the %files section is not shell interpreted. It only accepts RPM macros which are replaced by the preprocessor before pcs is compiled. Technically, %files accept a file with paths and pkg-config could be run manually after pcs is compiled outputting the directory to a temporary file. This hack is too ugly. Another solution would be to hardcode the paths both to pcs and ps-web-ui via autotools. This however doesn;t change the structure of the pcs tarball and is not safe either.
2025-02-13 16:41:27 +01:00
6 changed files with 149 additions and 3755 deletions

7
.gitignore vendored
View file

@ -118,3 +118,10 @@
/pcs-0.11.8.tar.gz
/pcs-web-ui-0.1.20.tar.gz
/pcs-web-ui-node-modules-0.1.20.tar.xz
/pcs-web-ui-0.1.22.tar.gz
/pcs-web-ui-node-modules-0.1.22.tar.xz
/pcs-0.11.9.tar.gz
/dacite-1.9.2.tar.gz
/pcs-web-ui-node-modules-0.1.23.tar.xz
/pcs-web-ui-0.1.23.tar.gz
/pcs-0.11.10.tar.gz

View file

@ -0,0 +1,32 @@
From ad83707072df9e9f2bcfece27342ab361fddc8fa Mon Sep 17 00:00:00 2001
From: Miroslav Lisik <mlisik@redhat.com>
Date: Thu, 10 Jul 2025 19:48:28 +0200
Subject: [PATCH] fix ruby NameError exception in pcsd/pcsd.rb occuring with
older rack
---
pcsd/pcsd.rb | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/pcsd/pcsd.rb b/pcsd/pcsd.rb
index a62434c62..c7b5357ef 100644
--- a/pcsd/pcsd.rb
+++ b/pcsd/pcsd.rb
@@ -74,9 +74,11 @@ configure do
CAPABILITIES_PCSD = capabilities_pcsd.freeze
end
-error Rack::QueryParser::QueryLimitError do
- $logger.warn(env['sinatra.error'].message)
- return 400, env['sinatra.error'].message
+if Rack.const_defined?(:QueryParser) and Rack::QueryParser.const_defined?(:QueryLimitError)
+ error Rack::QueryParser::QueryLimitError do
+ $logger.warn(env['sinatra.error'].message)
+ return 400, env['sinatra.error'].message
+ end
end
def run_cfgsync
--
2.50.1

File diff suppressed because it is too large Load diff

168
pcs.spec
View file

@ -1,5 +1,5 @@
Name: pcs
Version: 0.11.8
Version: 0.11.10
Release: 1%{?dist}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
@ -11,33 +11,51 @@ Group: System Environment/Base
Summary: Pacemaker/Corosync Configuration System
BuildArch: noarch
# When specifying a commit, use its long hash
%global version_or_commit %{version}
# %%global version_or_commit 10069ca47e5c9f4ac1abd8bc4cd99281ead047b7
# Remove a tilde used by RPM to get the correct upstream version
%global clean_version %(echo %{version} | sed 's/~//')
# To build an official pcs release, comment out branch_or_commit
# Use long commit hash or branch name to build an unreleased version
# %%global branch_or_commit 1353dfbb3af82d77f4de17a3fa4cbde185bb2b2d
%if 0%{?branch_or_commit:1}
%global version_or_commit %{branch_or_commit}
%else
%global version_or_commit %{clean_version}
%endif
%global pcs_source_name %{name}-%{version_or_commit}
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.20
%global ui_modules_version 0.1.20
%global ui_src_name pcs-web-ui-%{ui_commit}
# To build an official pcs-web-ui release, comment out ui_branch_or_commit
# Last tagged version, also used as fallback version for untagged tarballs
%global ui_version 0.1.23
%global ui_modules_version 0.1.23
# Use long commit hash or branch name to build an unreleased version
# %%global ui_branch_or_commit 34372d1268f065ed186546f55216aaa2d7e76b54
%if 0%{?ui_branch_or_commit:1}
%global ui_version_or_commit %{ui_branch_or_commit}
%else
%global ui_version_or_commit %{ui_version}
%endif
%global ui_src_name pcs-web-ui-%{ui_version_or_commit}
%global pyagentx_version 0.4.pcs.2
%global dacite_version 1.8.1
%global dacite_version 1.9.2
%global required_pacemaker_version 2.1.0
%global pcs_bundled_dir pcs_bundled
%global pcsd_public_dir pcsd/public
%global ui_build_dir_standalone build_standalone
%global ui_build_dir_cockpit build_cockpit
%global ui_cockpit_dest ha-cluster
%global ui_appstream_metainfo org.clusterlabs.cockpit_pcs_web_ui.metainfo.xml
%global pcsd_webui_dir %{_prefix}/lib/pcsd/public/ui
%global cockpit_dir %{_datadir}/cockpit/
%global metainfo_dir %{_datadir}/metainfo
%global ui_metainfo_name org.clusterlabs.cockpit_pcs_web_ui.metainfo.xml
%global ui_metainfo %{metainfo_dir}/%{ui_metainfo_name}
%global pkg_pcs_snmp pcs-snmp
%global pkg_cockpit_ha_cluster cockpit-ha-cluster
# prepend v for folder in GitHub link when using tagged tarball
%if "%{version}" == "%{version_or_commit}"
%if "%{clean_version}" == "%{version_or_commit}"
%global v_prefix v
%endif
@ -47,12 +65,12 @@ Source0: %{url}/archive/%{?v_prefix}%{version_or_commit}/%{pcs_source_name}.tar.
Source41: https://github.com/ondrejmular/pyagentx/archive/v%{pyagentx_version}/pyagentx-%{pyagentx_version}.tar.gz
Source42: https://github.com/konradhalas/dacite/archive/v%{dacite_version}/dacite-%{dacite_version}.tar.gz
Source100: https://github.com/ClusterLabs/pcs-web-ui/archive/%{ui_commit}/%{ui_src_name}.tar.gz
Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_commit}/pcs-web-ui-node-modules-%{ui_modules_version}.tar.xz
Source100: https://github.com/ClusterLabs/pcs-web-ui/archive/%{ui_version_or_commit}/%{ui_src_name}.tar.gz
Source101: https://github.com/ClusterLabs/pcs-web-ui/releases/download/%{ui_version_or_commit}/pcs-web-ui-node-modules-%{ui_modules_version}.tar.xz
# pcs patches: <= 200
# Patch0: name.patch
Patch0: overhaul-fence-agents-mocking.patch
# Patch1: name.patch
Patch1: fix-pcsd-not-starting-with-older-rack.patch
# ui patches: >200
# Patch201: name-web-ui.patch
@ -65,6 +83,8 @@ BuildRequires: automake
BuildRequires: make
# printf from coreutils is used in makefile, head is used in spec
BuildRequires: coreutils
# find is used in Makefile and also somewhere else
BuildRequires: findutils
# python for pcs
BuildRequires: python3 >= 3.9
BuildRequires: python3-dateutil >= 2.7.0
@ -100,17 +120,20 @@ BuildRequires: rubygem(rexml)
BuildRequires: rubygem-test-unit
# for touching patch files (sanitization function)
BuildRequires: diffstat
# for post, preun and postun macros
BuildRequires: systemd
# for systemd scriptlet macros
BuildRequires: systemd-rpm-macros
# pam is used for authentication inside daemon (python ctypes)
# needed for tier0 tests during build
BuildRequires: pam
# for working with qdevice certificates (certutil) - used in configure.ac
BuildRequires: nss-tools
# pcs now provides a pc file
BuildRequires: pkgconfig
# for building web ui
BuildRequires: nodejs-npm
# cluster stack packages for pkg-config
# corosync has different package names on distributions but all provide
# corosync-devel
@ -144,7 +167,6 @@ Requires: rubygem-mustermann
Requires: rubygem-puma
Requires: rubygem-rack
Requires: rubygem-rack-protection
Requires: rubygem-rack-test
Requires: rubygem-sinatra
Requires: rubygem-tilt
%if 0%{?fedora} || 0%{?rhel} >= 9
@ -159,10 +181,6 @@ Requires: (corosync >= 3.0 if pacemaker)
# pcs enables corosync encryption by default so we require libknet1-plugins-all
Requires: (libknet1-plugins-all if corosync)
Requires: pacemaker-cli >= %{required_pacemaker_version}
# for post, preun and postun macros
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
# pam is used for authentication inside daemon (python ctypes)
# more details: https://bugzilla.redhat.com/show_bug.cgi?id=1717113
Requires: pam
@ -175,6 +193,7 @@ Requires: nss-tools
Provides: bundled(dacite) = %{dacite_version}
# pcs-snmp subpackage definition
%package -n %{pkg_pcs_snmp}
Group: System Environment/Base
@ -209,6 +228,7 @@ Requires: pcs = %{version}-%{release}
Requires: cockpit-bridge
%description
pcs is a corosync and pacemaker configuration tool. It permits users to
easily view, modify and create pacemaker based clusters.
@ -221,8 +241,9 @@ SNMP agent that provides information about pacemaker cluster to the master agent
Cockpit application for managing Pacemaker based clusters. Uses
Pacemaker/Corosync Configuration System (pcs) in the background.
%prep
%prep
# -- following is inspired by python-simplejon.el5 --
# Update timestamps on the files touched by a patch, to avoid non-equal
# .pyc/.pyo files across the multilib peers within a build
@ -266,20 +287,34 @@ update_times_patch(){
# * http://ftp.rpm.org/max-rpm/s1-rpm-inside-macros.html
# * https://rpm-software-management.github.io/rpm/manual/autosetup.html
# patch web-ui sources
%autosetup -D -T -b 100 -a 101 -S git -n %{ui_src_name} -N
# -n <name> — Set Name of Build Directory
# -T — Do Not Perform Default Archive Unpacking
# -b <n> — Unpack The nth Sources Before Changing Directory
# -a <n> — Unpack The nth Sources After Changing Directory
# -N — disables automatic patch application, use autopatch to apply patches
#
# 1. unpack sources (-b 100)
# 2. then cd into sources tree (the setup macro itself)
# 3. then unpack node_modules into sources tree (-a 101).
%autosetup -T -b 100 -a 101 -N -n %{ui_src_name}
%autopatch -p1 -m 201
# update_times_patch %%{PATCH201}
# patch pcs sources
%autosetup -S git -n %{pcs_source_name} -N
%autopatch -p1 -M 200
# update_times_patch %%{PATCH0}
update_times_patch %{PATCH0}
# update_times_patch %%{PATCH1}
update_times_patch %{PATCH1}
# generate .tarball-version if building from an untagged commit, not a released version
# autogen uses git-version-gen which uses .tarball-version for generating version number
%if "%{version}" != "%{version_or_commit}"
echo "%version+$(echo "%{version_or_commit}" | head -c 8)" > %{_builddir}/%{pcs_source_name}/.tarball-version
%if "%{clean_version}" != "%{version_or_commit}"
echo "%{clean_version}+$(echo "%{version_or_commit}" | head -c 8)" > %{_builddir}/%{pcs_source_name}/.tarball-version
%endif
%if "x%{?ui_branch_or_commit}" != "x"
echo "%{ui_version}+$(echo "%{ui_branch_or_commit}" | head -c 8)" > %{_builddir}/%{ui_src_name}/.tarball-version
%endif
# prepare dirs/files necessary for building python bundles
@ -288,47 +323,40 @@ cp -f %SOURCE41 rpm/
cp -f %SOURCE42 rpm/
%build
%define debug_package %{nil}
./autogen.sh
%{configure} --enable-local-build --enable-use-local-cache-only \
--enable-individual-bundling \
--enable-individual-bundling --enable-webui \
--with-pcsd-default-cipherlist='PROFILE=SYSTEM' \
--with-pcs-lib-dir="%{_prefix}/lib" PYTHON=%{__python3}
make all
# build pcs-web-ui
export BUILD_USE_CURRENT_NODE_MODULES=true
# Web UI installation
# Switch to web ui folder first
cd ../%{ui_src_name}
./autogen.sh
%{configure} \
--with-pcsd-webui-dir=%{pcsd_webui_dir} \
--with-cockpit-dir=%{cockpit_dir} \
--with-metainfo-dir=%{metainfo_dir}
make all
## standalone
export BUILD_DIR=%{_builddir}/%{ui_src_name}/%{ui_build_dir_standalone}
make -C %{_builddir}/%{ui_src_name} build
## cockpit
export BUILD_DIR=%{_builddir}/%{ui_src_name}/%{ui_build_dir_cockpit}
export BUILD_FOR_COCKPIT=true
make -C %{_builddir}/%{ui_src_name} build
%install
rm -rf $RPM_BUILD_ROOT
rm -rf %{buildroot}
pwd
# Install cockpit pcs-web-ui
cd ../%{ui_src_name}
%make_install
# install standalone pcs-web-ui
cp -r %{_builddir}/%{ui_src_name}/%{ui_build_dir_standalone} \
${RPM_BUILD_ROOT}%{_prefix}/lib/%{pcsd_public_dir}/ui
# install cockpit pcs-web-ui
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/cockpit/%{ui_cockpit_dest}
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/metainfo
cp -r %{_builddir}/%{ui_src_name}/%{ui_build_dir_cockpit}/* \
${RPM_BUILD_ROOT}%{_datadir}/cockpit/%{ui_cockpit_dest}
cp -r %{_builddir}/%{ui_src_name}/packages/app/%{ui_appstream_metainfo} \
${RPM_BUILD_ROOT}%{_datadir}/metainfo/
# Install pcs
cd ../%{pcs_source_name}
%make_install
# prepare license files
cp %{pcs_bundled_dir}/src/pyagentx-*/LICENSE.txt pyagentx_LICENSE.txt
@ -339,9 +367,10 @@ cp %{pcs_bundled_dir}/src/dacite-*/LICENSE dacite_LICENSE
cp %{pcs_bundled_dir}/src/dacite-*/README.md dacite_README.md
%check
# Run validation of cockpit metainfo
appstream-util validate-relax --nonet ${RPM_BUILD_ROOT}%{_datadir}/metainfo/%{ui_appstream_metainfo}
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{ui_metainfo_name}
# In the building environment LC_CTYPE is set to C which causes tests to fail
# due to python prints a warning about it to stderr. The following environment
@ -366,7 +395,7 @@ run_all_tests(){
#run pcsd tests and remove them
ruby \
-I$RPM_BUILD_ROOT%{_prefix}/lib/pcsd \
-I%{buildroot}%{_prefix}/lib/pcsd \
-Ipcsd/test \
pcsd/test/test_all_suite.rb
test_result_ruby=$?
@ -379,6 +408,8 @@ run_all_tests(){
run_all_tests
%posttrans
# Make sure the new version of the daemon is running.
# Also, make sure to start pcsd-ruby if it hasn't been started or even
@ -386,7 +417,6 @@ run_all_tests
%{_bindir}/systemctl daemon-reload
%{_bindir}/systemctl try-restart pcsd.service
%post
%systemd_post pcsd.service
%systemd_post pcsd-ruby.service
@ -408,6 +438,8 @@ run_all_tests
%postun -n %{pkg_pcs_snmp}
%systemd_postun_with_restart pcs_snmp_agent.service
%files
%doc CHANGELOG.md
%doc README.md
@ -418,6 +450,7 @@ run_all_tests
%{_sbindir}/pcs
%{_sbindir}/pcsd
%{_prefix}/lib/pcs/*
%{_prefix}/lib/pkgconfig/pcs.pc
%{_prefix}/lib/pcsd/*
%{_unitdir}/pcsd.service
%{_unitdir}/pcsd-ruby.service
@ -438,8 +471,8 @@ run_all_tests
%{_mandir}/man8/pcsd.*
%exclude %{_prefix}/lib/pcs/pcs_snmp_agent
%exclude %{_prefix}/lib/pcs/%{pcs_bundled_dir}/packages/pyagentx*
%exclude %{_datadir}/cockpit
%exclude %{_datadir}/metainfo/%{ui_appstream_metainfo}
%exclude %{cockpit_dir}
%exclude %{ui_metainfo}
%files -n %{pkg_pcs_snmp}
%{_prefix}/lib/pcs/pcs_snmp_agent
@ -455,11 +488,20 @@ run_all_tests
%license pyagentx_LICENSE.txt
%files -n %{pkg_cockpit_ha_cluster}
%{_datadir}/cockpit/%{ui_cockpit_dest}
%{_datadir}/metainfo/%{ui_appstream_metainfo}
%{cockpit_dir}
%{ui_metainfo}
%changelog
* Tue Sep 16 2025 Michal Pospíšil <mpospisi@redhat.com> - 0.11.10-1
- Rebased to the latest sources (see CHANGELOG.md)
- Updated pcs-web-ui to 0.1.23
* Mon Feb 10 2025 Michal Pospíšil <mpospisi@redhat.com> - 0.11.9-1
- Rebased to the latest sources (see CHANGELOG.md)
- Updated pcs-web-ui to 0.1.22
* Tue Aug 6 2024 Michal Pospíšil <mpospisi@redhat.com> - 0.11.8-1
- Rebased to the latest sources (see CHANGELOG.md)
- Updated pcs-web-ui to 0.1.20

View file

@ -16,7 +16,7 @@ export GEM_HOME=/usr/lib/pcsd/vendor/bundle/
# autogen and configure with expanded TMT_SOURCE_DIR will match that too
./autogen.sh
./configure --enable-local-build --enable-use-local-cache-only \
--enable-individual-bundling --with-pcs-lib-dir=/usr/lib
--enable-individual-bundling --enable-webui --with-pcs-lib-dir=/usr/lib
# Remove pcs sources to make sure tests are not using any of those files
rm -rf pcs
touch ../tests-prepared-stamp

View file

@ -1,5 +1,5 @@
SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a
SHA512 (dacite-1.8.1.tar.gz) = 4b40c0bdcf5490bcc77de9e7f04b7267642bcfd41e4168607a5457f38abe3ad4b3041d8a23cb43af76de14eabee45f900ad5ddf7af8f70a2be4850bccc2d3af1
SHA512 (pcs-0.11.8.tar.gz) = 2705b612c602e9052405e448dc189f632f0266bf0d8381981a1dca709f3e851e90745bc02c2f9dfaa9e84d9ab0f3f1287467388d7d584e7e9e5ec4a46b8c2076
SHA512 (pcs-web-ui-0.1.20.tar.gz) = 83117eafbe694b133228dfd8d7de30a7cc58693b8844f7d1af9c12c02618a7af8dd10c374b56c3e722d84c5691488f25bfc3389f22954935a2e6dd42b16c7b2c
SHA512 (pcs-web-ui-node-modules-0.1.20.tar.xz) = 94cd6a306a6784c3decc351b1469efe98beadd43efbfa7848ccc6146be32f704281432669589e2c666b431a32bd6caf101fa08fb05deaab2b58a8cda8b40b85d
SHA512 (dacite-1.9.2.tar.gz) = 69513bc1acd43e45a208ce4b4186072f92d9057a6a88c77d56f21405fbed7964d94fe4f6a37c99754a793caa2bd0584664dfab69169ef0d3564bb09d37769e59
SHA512 (pcs-web-ui-node-modules-0.1.23.tar.xz) = f39dd1fd391f10b874b5fec34da1a2f2496d66b31af736ee1dfc2ef6e0b518efd03053fd00312c84e10a33ffda492e12d48a898a21efb6241e5459828e500e80
SHA512 (pcs-web-ui-0.1.23.tar.gz) = 6bc709926f26a02d33fb3865d15a1cf15db51a07dd9b25c63f33277c427c3403c189e2ac5e7adc795b254ad0bdb50f1bc4be70f1385bc8522ca502142d41fc26
SHA512 (pcs-0.11.10.tar.gz) = 2b2cd6f0bc03f7c0096460b44e8779b2eba228581682feee87a9695b97409bd61cf0fa7dfd049336e17417c4cf4578d0ab0e3bf1d3d3f68b10a80174ec06c82f