diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491f..0000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/.gitignore b/.gitignore index fbe8060..dc84d48 100644 --- a/.gitignore +++ b/.gitignore @@ -49,79 +49,4 @@ /pyagentx-0.4.pcs.2.tar.gz /sinatra-contrib-2.0.0.gem /pcs-0.9.164.tar.gz -/pcs-0.10.0.1.tar.gz -/tornado-5.0.2.tar.gz -/pcs-0.10.0.alpha.1.tar.gz -/sinatra-contrib-2.0.3.gem -/pcs-0.10.0.alpha.2.tar.gz -/tilt-2.0.8.gem -/pcs-0.10.0.alpha.6.tar.gz -/pcs-0.10.1.tar.gz -/pcs-0.10.2.tar.gz -/pcs-web-ui-0.1.1.tar.gz -/pcs-web-ui-node-modules-0.1.1.tar.xz -/pcs-0.10.3.tar.gz -/tornado-6.0.3.tar.gz -/pcs-0.10.4.tar.gz -/pcs-0.10.5.tar.gz -/pcs-web-ui-0.1.2.tar.gz -/pcs-web-ui-node-modules-0.1.2.tar.xz -/tilt-2.0.9.gem -/dacite-1.1.0.tar.gz -/pcs-67591ed1487cb0aefa181fdfc166c8a66b55d25a.tar.gz -/dacite-1.5.0.python3.9.fix.tar.gz -/dacite-1.5.1.tar.gz -/pcs-0.10.6.tar.gz -/pcs-web-ui-0.1.3.tar.gz -/pcs-web-ui-node-modules-0.1.3.tar.xz -/pcs-0.10.7.tar.gz -/dacite-1.6.0.tar.gz -/pcs-0.10.8.tar.gz -/pcs-web-ui-0.1.5.tar.gz -/pcs-web-ui-node-modules-0.1.5.tar.xz -/daemons-1.4.0.gem -/eventmachine-1.2.7.gem -/mustermann-1.1.1.gem -/rack-2.2.3.gem -/rack-protection-2.0.8.1.gem -/ruby2_keywords-0.0.5.gem -/sinatra-2.0.8.1.gem -/thin-1.8.1.gem -/tilt-2.0.10.gem -/pcs-0.10.9.tar.gz -/pcs-web-ui-0.1.6.tar.gz -/pcs-web-ui-node-modules-0.1.6-fips-fix.tar.xz -/pcs-0.10.11.tar.gz -/pcs-web-ui-0.1.9.tar.gz -/pcs-web-ui-node-modules-0.1.9.tar.xz -/pcs-web-ui-0.1.12.tar.gz -/pcs-web-ui-node-modules-0.1.12.tar.xz -/pcs-0.11.2.tar.gz -/pcs-0.11.3.tar.gz -/pcs-web-ui-0.1.14.tar.gz -/pcs-web-ui-node-modules-0.1.14.tar.xz -/pcs-0.11.4.15-f7301.tar.gz -/pcs-web-ui-0.1.16.tar.gz -/pcs-web-ui-node-modules-0.1.16.tar.xz -/pcs-ee602830794f09a06880cd7e37a802b27113f185.tar.gz -/dacite-1.8.0.tar.gz -/pcs-0.11.5.tar.gz -/pcs-web-ui-0.1.16.1.tar.gz -/pcs-web-ui-node-modules-0.1.16.1.tar.xz -/pcs-0.11.6.tar.gz -/pcs-web-ui-node-modules-0.1.17.tar.xz -/pcs-web-ui-0.1.17.tar.gz -/dacite-1.8.1.tar.gz -/pcs-0.11.7.tar.gz -/pcs-web-ui-0.1.18.tar.gz -/pcs-web-ui-node-modules-0.1.18.tar.xz -/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-0.12.0.tar.gz -/pcs-web-ui-0.1.22.tar.gz -/pcs-web-ui-node-modules-0.1.22.tar.xz -/dacite-1.9.2.tar.gz -/pcs-0.12.1.tar.gz -/pcs-web-ui-0.1.23.tar.gz -/pcs-web-ui-node-modules-0.1.23.tar.xz +/pcs-0.9.166.tar.gz diff --git a/do-not-require-wheel.patch b/do-not-require-wheel.patch deleted file mode 100644 index 2aab9ce..0000000 --- a/do-not-require-wheel.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 72588f150e89b6f06810321245a13157b7e00b09 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Tue, 29 Jul 2025 23:42:00 +0200 -Subject: [PATCH] Do not require wheel when setuptools is new enough - -Current version of setuptools creates wheels on its own. ---- - README.md | 2 +- - configure.ac | 7 +++++-- - rpm/pcs.spec.in | 2 +- - 3 files changed, 7 insertions(+), 4 deletions(-) - -diff --git a/README.md b/README.md -index a06143eba..636485be6 100644 ---- a/README.md -+++ b/README.md -@@ -47,7 +47,7 @@ Apart from the dependencies listed above, these are also required for - installation: - - * python development files (packages python3-devel, python3-setuptools 66.1+, -- python3-pip, python3-wheel) -+ python3-pip, python3-wheel if python3-setuptools < 71) - * ruby development files (package ruby-devel) - * rubygems - * rubygem bundler (package rubygem-bundler or ruby-bundler or bundler) -diff --git a/configure.ac b/configure.ac -index 4e7d36599..0a782bfa7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -347,12 +347,15 @@ AC_SUBST([PYAGENTX_VERSION]) - - # pip 19.0 required for PEP517 support - PCS_CHECK_PYMOD([pip], [>= 23.0]) --# pip builds a wheel first --PCS_CHECK_PYMOD([wheel]) - - if test "x$tests_only" != "xyes"; then - # setuptools 61.0.0 required for PEP621 support - PCS_CHECK_PYMOD([setuptools], [>= 66.1]) -+ # wheel is required if setuptools < 71 -+ AC_PIP_MODULE([setuptools], [>= 71], [], [], [need_wheel=yes]) -+ if test "x$need_wheel" = "xyes"; then -+ PCS_CHECK_PYMOD([wheel]) -+ fi - PCS_CHECK_PYMOD([cryptography]) - PCS_CHECK_PYMOD([lxml]) - PCS_CHECK_PYMOD([pyparsing], [>= 3.0.0]) -diff --git a/rpm/pcs.spec.in b/rpm/pcs.spec.in -index 55881a398..639a3e974 100644 ---- a/rpm/pcs.spec.in -+++ b/rpm/pcs.spec.in -@@ -86,7 +86,7 @@ BuildRequires: python%{python3_version}-pip >= 23 - BuildRequires: python%{python3_version}-setuptools >= 66.1 - - # for building wheel during make install --BuildRequires: python%{python3_version}-wheel -+BuildRequires: (python%{python3_version}-wheel if python%{python3_version}-setuptools < 71) - - # for bundling dateutil - %if "@cirpmworkarounds@" != "yes" --- -2.50.1 - diff --git a/fedfix.patch b/fedfix.patch new file mode 100644 index 0000000..f973dce --- /dev/null +++ b/fedfix.patch @@ -0,0 +1,311 @@ +From ecdf30a8e657bd40ec901d6ab01d3b2a8d4cdbd4 Mon Sep 17 00:00:00 2001 +From: Ivan Devat +Date: Mon, 19 Feb 2018 17:54:35 +0100 +Subject: [PATCH] fedfix + +Gems for fedora was adapted. +Codebase was adapted for sinatra 2 and rack 2. +--- + pcs/pcs | 2 +- + pcs/test/suite.py | 2 +- + pcsd/Makefile | 36 ++++++++---------------------------- + pcsd/pcsd.rb | 18 +++++------------- + pcsd/pcsd.service-runner | 3 ++- + pcsd/session.rb | 25 ++++++++++++------------- + pcsd/ssl.rb | 1 - + pcsd/test/test_session.rb | 37 +++++++++++++++++++------------------ + 8 files changed, 48 insertions(+), 76 deletions(-) + +diff --git a/pcs/pcs b/pcs/pcs +index 736f9cd2..3dff69a5 100755 +--- a/pcs/pcs ++++ b/pcs/pcs +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + + from __future__ import absolute_import + import os.path +diff --git a/pcs/test/suite.py b/pcs/test/suite.py +index 809596bc..98c5a268 100755 +--- a/pcs/test/suite.py ++++ b/pcs/test/suite.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + from __future__ import ( + absolute_import, + division, +diff --git a/pcsd/Makefile b/pcsd/Makefile +index 21550c5a..c83bd958 100644 +--- a/pcsd/Makefile ++++ b/pcsd/Makefile +@@ -1,33 +1,13 @@ +-FFI_VERSION="1.9.25" +-FFI_C_DIR=vendor/bundle/ruby/gems/ffi-${FFI_VERSION}/ext/ffi_c +- +-build_gems: get_gems +- bundle install --local --deployment +- #ffi makes symlink with absolute path. Let's change it to relative path. +- for fname in `ls ${FFI_C_DIR}/libffi-*/include/ffitarget.h`; do \ +- if [[ -L "$$fname" ]]; then \ +- target=$$(readlink $$fname | sed "s~.*/${FFI_C_DIR}\(/libffi/src/[^/]\+/ffitarget.h\)~../..\1~"); \ +- rm $$fname; \ +- ln -s $$target $$fname; \ +- fi; \ +- done; +- +-build_gems_without_bundler: ++# Comment from specfile from distgit 9b7a65231 Mamoru TASAKA: ++# So it seems that with rubygems 2.7.3 --install-dir option always ++# needs --no-user-install??? ++# tld;dr; added flag --no-user-install, details in the commit ++build_gems: + mkdir -p vendor/bundle/ruby +- gem install --verbose --no-rdoc --no-ri -l --ignore-dependencies -i vendor/bundle/ruby \ +- vendor/cache/backports-3.11.3.gem \ +- vendor/cache/ethon-0.11.0.gem \ +- vendor/cache/ffi-${FFI_VERSION}.gem \ +- vendor/cache/json-2.1.0.gem \ +- vendor/cache/multi_json-1.13.1.gem \ +- vendor/cache/open4-1.3.4.gem \ +- vendor/cache/rack-1.6.10.gem \ +- vendor/cache/rack-protection-1.5.5.gem \ +- vendor/cache/rack-test-0.7.0.gem \ ++ gem install --force --verbose --no-rdoc --no-ri -l --no-user-install -i vendor/bundle/ruby \ ++ vendor/cache/orderedhash-0.0.6.gem \ + vendor/cache/rpam-ruby19-1.2.1.gem \ +- vendor/cache/sinatra-1.4.8.gem \ +- vendor/cache/sinatra-contrib-1.4.7.gem \ +- vendor/cache/tilt-2.0.8.gem \ ++ vendor/cache/sinatra-contrib-2.0.0.gem \ + -- '--with-ldflags="-Wl,-z,now -Wl,-z,relro"' + + get_gems: +diff --git a/pcsd/pcsd.rb b/pcsd/pcsd.rb +index 9f9bd091..712505a8 100644 +--- a/pcsd/pcsd.rb ++++ b/pcsd/pcsd.rb +@@ -86,6 +86,11 @@ before do + $session_storage = env[:__session_storage] + $session_storage_env = env + end ++ begin ++ $session_storage.drop_expired(request) ++ rescue => e ++ $logger.warn("Exception while removing expired sessions: #{e}") ++ end + + # urls which are accesible for everybody including not logged in users + always_accessible = [ +@@ -162,19 +167,6 @@ $thread_cfgsync = Thread.new { + end + } + +-$thread_session_expired = Thread.new { +- while true +- sleep(60 * 5) +- begin +- if $session_storage +- $session_storage.drop_expired($session_storage_env) +- end +- rescue => e +- $logger.warn("Exception while removing expired sessions: #{e}") +- end +- end +-} +- + helpers do + def is_ajax? + return request.env['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' +diff --git a/pcsd/pcsd.service-runner b/pcsd/pcsd.service-runner +index 883d2908..712913ea 100644 +--- a/pcsd/pcsd.service-runner ++++ b/pcsd/pcsd.service-runner +@@ -3,8 +3,9 @@ + # it also serves as a holder of a selinux context + + begin +- # add pcsd to the load path (ruby -I) ++ # add pcsd and bundled gems to the load path (ruby -I) + libdir = File.dirname(__FILE__) ++ $LOAD_PATH.unshift(*Dir[libdir + '/vendor/bundle/ruby/gems/*/lib']) + $LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir) + + # change current directory (ruby -C) +diff --git a/pcsd/session.rb b/pcsd/session.rb +index 8b09ed82..f42bf73e 100644 +--- a/pcsd/session.rb ++++ b/pcsd/session.rb +@@ -1,4 +1,3 @@ +-gem 'rack', '< 2.0.0' + require 'rack/session/pool' + + class SessionPoolLifetime < Rack::Session::Pool +@@ -14,14 +13,14 @@ class SessionPoolLifetime < Rack::Session::Pool + super + end + +- def get_session(env, sid) +- with_lock(env) do ++ def find_session(req, sid) ++ with_lock(req) do + now = Time.now() + # delete the session if expired + if @default_options[:expire_after] and sid and @pool_timestamp[sid] and + @pool_timestamp[sid] < (now - @default_options[:expire_after]) + then +- delete_session(sid) ++ remove_session(sid) + end + # create new session if nonexistent + unless sid and session = @pool[sid] +@@ -34,8 +33,8 @@ class SessionPoolLifetime < Rack::Session::Pool + end + end + +- def set_session(env, session_id, new_session, options) +- with_lock(env) do ++ def write_session(req, session_id, new_session, options) ++ with_lock(req) do + @pool.store session_id, new_session + # bump session's access time + @pool_timestamp[session_id] = Time.now() +@@ -43,30 +42,30 @@ class SessionPoolLifetime < Rack::Session::Pool + end + end + +- def destroy_session(env, session_id, options) +- with_lock(env) do +- delete_session(session_id) ++ def delete_session(req, session_id, options) ++ with_lock(req) do ++ remove_session(session_id) + generate_sid unless options[:drop] + end + end + +- def drop_expired(env) ++ def drop_expired(req) + return unless lifetime = @default_options[:expire_after] +- with_lock(env) { ++ with_lock(req) { + threshold = Time.now() - lifetime + sid_to_delete = [] + @pool_timestamp.each { |sid, timestamp| + sid_to_delete << sid if timestamp < threshold + } + sid_to_delete.each { |sid| +- delete_session(sid) ++ remove_session(sid) + } + } + end + + private + +- def delete_session(sid) ++ def remove_session(sid) + @pool.delete(sid) + @pool_timestamp.delete(sid) + end +diff --git a/pcsd/ssl.rb b/pcsd/ssl.rb +index b834228e..a7d5c0bf 100644 +--- a/pcsd/ssl.rb ++++ b/pcsd/ssl.rb +@@ -2,7 +2,6 @@ require 'rubygems' + require 'webrick' + require 'webrick/https' + require 'openssl' +-gem 'rack', '< 2.0.0' + require 'rack' + require 'socket' + +diff --git a/pcsd/test/test_session.rb b/pcsd/test/test_session.rb +index e72bf012..c212b1a0 100644 +--- a/pcsd/test/test_session.rb ++++ b/pcsd/test/test_session.rb +@@ -2,18 +2,19 @@ require 'test/unit' + + require 'pcsd_test_utils.rb' + require 'session.rb' ++require 'sinatra' + + class TestSessionPool < Test::Unit::TestCase + + def setup() +- @env = { ++ @request = Sinatra::Request.new({ + 'rack.multithread' => true, +- } ++ }) + end + + def fixture_get_pool(lifetime) + pool = SessionPoolLifetime.new(nil, {:expire_after => lifetime,}) +- (1..3).each { |i| pool.set_session(@env, "sid#{i}", {'value' => i}, {}) } ++ (1..3).each { |i| pool.write_session(@request, "sid#{i}", {'value' => i}, {}) } + return pool + end + +@@ -23,14 +24,14 @@ class TestSessionPool < Test::Unit::TestCase + # touch sessions each second + lifetime.times { + sleep(1) +- assert_equal({'value' => 1}, pool.get_session(@env, 'sid1')[1]) +- assert_equal({'value' => 3}, pool.get_session(@env, 'sid3')[1]) ++ assert_equal({'value' => 1}, pool.find_session(@request, 'sid1')[1]) ++ assert_equal({'value' => 3}, pool.find_session(@request, 'sid3')[1]) + } + # after @lifetime passes the unused session gets removed on access + sleep(1) +- assert_equal({'value' => 1}, pool.get_session(@env, 'sid1')[1]) +- assert_equal({'value' => 3}, pool.get_session(@env, 'sid3')[1]) +- assert_equal({}, pool.get_session(@env, 'sid2')[1]) ++ assert_equal({'value' => 1}, pool.find_session(@request, 'sid1')[1]) ++ assert_equal({'value' => 3}, pool.find_session(@request, 'sid3')[1]) ++ assert_equal({}, pool.find_session(@request, 'sid2')[1]) + end + + def test_drop_expired_explicit() +@@ -39,12 +40,12 @@ class TestSessionPool < Test::Unit::TestCase + # touch sessions each second (otherwise they will be removed on access) + lifetime.times { + sleep(1) +- pool.get_session(@env, 'sid2') +- pool.set_session(@env, 'sid3', {'value' => 33}, {}) ++ pool.find_session(@request, 'sid2') ++ pool.write_session(@request, 'sid3', {'value' => 33}, {}) + } + sleep(1) + +- pool.drop_expired(@env) ++ pool.drop_expired(@request) + assert_equal( + { + 'sid2' => {'value' => 2,}, +@@ -57,14 +58,14 @@ class TestSessionPool < Test::Unit::TestCase + def test_no_lifetime() + pool = fixture_get_pool(nil) + sleep(1) +- assert_equal({'value' => 1}, pool.get_session(@env, 'sid1')[1]) +- assert_equal({'value' => 2}, pool.get_session(@env, 'sid2')[1]) +- assert_equal({'value' => 3}, pool.get_session(@env, 'sid3')[1]) ++ assert_equal({'value' => 1}, pool.find_session(@request, 'sid1')[1]) ++ assert_equal({'value' => 2}, pool.find_session(@request, 'sid2')[1]) ++ assert_equal({'value' => 3}, pool.find_session(@request, 'sid3')[1]) + sleep(1) +- pool.drop_expired(@env) +- assert_equal({'value' => 1}, pool.get_session(@env, 'sid1')[1]) +- assert_equal({'value' => 2}, pool.get_session(@env, 'sid2')[1]) +- assert_equal({'value' => 3}, pool.get_session(@env, 'sid3')[1]) ++ pool.drop_expired(@request) ++ assert_equal({'value' => 1}, pool.find_session(@request, 'sid1')[1]) ++ assert_equal({'value' => 2}, pool.find_session(@request, 'sid2')[1]) ++ assert_equal({'value' => 3}, pool.find_session(@request, 'sid3')[1]) + end + + end +-- +2.18.0 + diff --git a/fix-pcsd-not-starting-with-older-rack.patch b/fix-pcsd-not-starting-with-older-rack.patch deleted file mode 100644 index e18f4ef..0000000 --- a/fix-pcsd-not-starting-with-older-rack.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a2899ef0e20bb638f47e74077281e73f4f18faf3 Mon Sep 17 00:00:00 2001 -From: Miroslav Lisik -Date: Thu, 10 Jul 2025 19:48:28 +0200 -Subject: [PATCH 2/2] 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 e8ae9f106..c9f668851 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 - - get '/remote/?:command?' do --- -2.50.1 - diff --git a/gating.yaml b/gating.yaml deleted file mode 100644 index 9dc1f4c..0000000 --- a/gating.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- !Policy -product_versions: - - fedora-* -decision_context: bodhi_update_push_testing -subject_type: koji_build -rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} ---- !Policy -product_versions: - - fedora-* -decision_context: bodhi_update_push_stable -subject_type: koji_build -rules: - - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional} diff --git a/pcs.spec b/pcs.spec index aa227b2..b12f1ff 100644 --- a/pcs.spec +++ b/pcs.spec @@ -1,221 +1,132 @@ Name: pcs -Version: 0.12.1 -Release: 5%{?dist} -# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ -# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses -# GPL-2.0-only: pcs -# MIT: dacite -License: GPL-2.0-only AND MIT +Version: 0.9.166 +Release: 1%{?dist} +License: GPLv2 URL: https://github.com/ClusterLabs/pcs Group: System Environment/Base -Summary: Pacemaker/Corosync Configuration System -BuildArch: noarch - -# 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 -%global version_or_commit %{clean_version} -%if 0%{?branch_or_commit:1} - %global version_or_commit %{branch_or_commit} - %global tarball_version %{clean_version}+%(echo %{branch_or_commit} | head -c 8) -%endif -%global pcs_source_name %{name}-%{version_or_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 -%global ui_version_or_commit %{ui_version} -%if 0%{?ui_branch_or_commit:1} - %global ui_version_or_commit %{ui_branch_or_commit} - %global ui_tarball_version %{ui_version}-%(echo %{ui_branch_or_commit} | head -c 8) -%endif -%global ui_src_name pcs-web-ui-%{ui_version_or_commit} +Summary: Pacemaker Configuration System -%global pyagentx_version 0.4.pcs.2 -%global dacite_version 1.9.2 +%global pcs_snmp_pkg_name pcs-snmp +%global pyagentx_version 0.4.pcs.2 +%global bundled_lib_dir pcs/bundled +%global pyagentx_dir %{bundled_lib_dir}/pyagentx -%global required_pacemaker_version 3.0.0 +#part after last slash is recognized as filename in look-aside repository +#desired name is achived by trick with hash anchor +Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: pcsd-bundle-config-1 -%global pcs_bundled_dir pcs_bundled -%global pcsd_webui_dir %{_prefix}/lib/pcsd/public/ui +Source11: https://rubygems.org/downloads/orderedhash-0.0.6.gem +Source12: https://rubygems.org/downloads/rpam-ruby19-1.2.1.gem +Source13: https://rubygems.org/downloads/sinatra-contrib-2.0.0.gem -%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_pcs_web_ui pcs-web-ui -%global pkg_cockpit_ha_cluster cockpit-ha-cluster - -# prepend v for folder in GitHub link when using tagged tarball -%if "%{clean_version}" == "%{version_or_commit}" - %global v_prefix v -%endif - -# part after the last slash is recognized as filename in look-aside cache -Source0: %{url}/archive/%{?v_prefix}%{version_or_commit}/%{pcs_source_name}.tar.gz - -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_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 -# Patch1: name.patch -Patch1: show-info-page-instead-of-webui.patch -Patch2: fix-pcsd-not-starting-with-older-rack.patch -Patch3: do-not-require-wheel.patch - -# ui patches: >200 -# Patch201: name-web-ui.patch - - -# Split pcs to pcs and pcs-web-ui, all packages that replace pcs must obsolete -# the old monolithic package -# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_one_to_many_replacement -Obsoletes: pcs < 0.12.0 -# Web UI is an add-on that doesn't need to be installed for pcs to function. -# Upgrades from before 0.12 will install it thanks to Obsoletes. But it will -# be possible to uninstall web UI to disable it and then it will not be -# installed during upgrades because it is a weak dependency. -Recommends: %{pkg_pcs_web_ui} == %{version}-%{release} +Source41: https://github.com/ondrejmular/pyagentx/archive/v%{pyagentx_version}.tar.gz#/pyagentx-%{pyagentx_version}.tar.gz +Patch0: fedfix.patch # git for patches -BuildRequires: git-core -# for building pcs tarballs -BuildRequires: autoconf -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 +BuildRequires: git # python for pcs -BuildRequires: python3-dateutil >= 2.7.0 +BuildRequires: python3 BuildRequires: python3-devel BuildRequires: python3-setuptools -BuildRequires: python3-pycurl -BuildRequires: python3-pip -BuildRequires: python3-pyparsing -BuildRequires: python3-tornado -BuildRequires: python3-cryptography +# python libraries for tests BuildRequires: python3-lxml -# for building bundled python packages -# setuptools 71+ builds wheels by itself -BuildRequires: (python3-wheel if python3-setuptools < 71) +BuildRequires: python3-mock +BuildRequires: python3-pycurl +# gcc for compiling custom rubygems +BuildRequires: gcc +BuildRequires: gcc-c++ # ruby and gems for pcsd -BuildRequires: ruby >= 2.5.0 +BuildRequires: ruby BuildRequires: ruby-devel +BuildRequires: rubygem-bundler BuildRequires: rubygem-backports -BuildRequires: rubygem-childprocess BuildRequires: rubygem-ethon BuildRequires: rubygem-ffi +BuildRequires: rubygem-io-console BuildRequires: rubygem-json -BuildRequires: rubygem-mustermann -BuildRequires: rubygem-puma -BuildRequires: (rubygem(rack) < 3 or (rubygem(rack) >= 3 and rubygem(rackup))) +BuildRequires: rubygem-multi_json +BuildRequires: rubygem-open4 +BuildRequires: rubygem-rack BuildRequires: rubygem-rack-protection BuildRequires: rubygem-rack-test BuildRequires: rubygem-sinatra BuildRequires: rubygem-tilt -%if 0%{?fedora} || 0%{?rhel} >= 9 -BuildRequires: rubygem(rexml) -%endif # ruby libraries for tests BuildRequires: rubygem-test-unit -# for touching patch files (sanitization function) +# pam devel for compiling rubygem-rpam-ruby19 +BuildRequires: pam-devel +# pcsd fonts and font management tools for creating symlinks to fonts +BuildRequires: fontconfig +BuildRequires: liberation-sans-fonts +BuildRequires: overpass-fonts +# for post, preun and postun macros +BuildRequires: systemd +# for UpdateTimestamps sanitization function BuildRequires: diffstat -# 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 - - -# cluster stack packages for pkg-config -# corosync has different package names on distributions but all provide -# corosync-devel -# corosync and pacemaker need versions and it's not working in virtual provides -BuildRequires: corosync-devel >= 3.0 -BuildRequires: pacemaker-libs-devel >= %{required_pacemaker_version} -BuildRequires: pkgconfig(booth) -BuildRequires: pkgconfig(corosync-qdevice) -BuildRequires: pkgconfig(sbd) - -# for validating cockpit-ha-cluster metainfo -BuildRequires: libappstream-glib - +# for tests +BuildRequires: corosync +BuildRequires: pacemaker +BuildRequires: pacemaker-cli +BuildRequires: fence-agents-all +BuildRequires: fence-virt +BuildRequires: booth-site +# printf (from package coreutils) is used in make +BuildRequires: coreutils # python and libraries for pcs, setuptools for pcs entrypoint -Requires: python3-cryptography -Requires: python3-dateutil >= 2.7.0 +Requires: python3 Requires: python3-lxml Requires: python3-pycurl -Requires: python3-pyparsing -Requires: python3-tornado +Requires: python3-setuptools # ruby and gems for pcsd -Requires: ruby >= 3.3.0 +Requires: ruby Requires: rubygem-backports -Requires: rubygem-childprocess Requires: rubygem-ethon Requires: rubygem-ffi Requires: rubygem-json -Requires: rubygem-mustermann -Requires: rubygem-puma -Requires: (rubygem(rack) < 3 or (rubygem(rack) >= 3 and rubygem(rackup))) +Requires: rubygem-multi_json +Requires: rubygem-open4 +Requires: rubygem-rack Requires: rubygem-rack-protection +Requires: rubygem-rack-test Requires: rubygem-sinatra Requires: rubygem-tilt -%if 0%{?fedora} || 0%{?rhel} >= 9 -Requires: rubygem(rexml) -%endif +# pcsd fonts +Requires: liberation-sans-fonts +Requires: overpass-fonts # for killall Requires: psmisc +# for working with certificates (validation etc.) +Requires: openssl # cluster stack and related packages -Requires: pcmk-cluster-manager >= %{required_pacemaker_version} -Suggests: pacemaker -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} -# pam is used for authentication inside daemon (python ctypes) -# more details: https://bugzilla.redhat.com/show_bug.cgi?id=1717113 -Requires: pam -# needs logrotate for /etc/logrotate.d/pcsd -Requires: logrotate -# for working with qdevice certificates (certutil) -Requires: nss-tools +Requires: corosync +Requires: pacemaker +Requires: pacemaker-cli +Requires: python3-clufter => 0.70.0 +# for post, preun and postun macros +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +Provides: bundled(rubygem-orderedhash) = 0.0.6 +Provides: bundled(rubygem-rpam-ruby19) = 1.2.1 +Provides: bundled(rubygem-sinatra-contrib) = 2.0.0 -Provides: bundled(dacite) = %{dacite_version} +%description +pcs is a corosync and pacemaker configuration tool. It permits users to +easily view, modify and create pacemaker based clusters. -# pcs-snmp subpackage definition -%package -n %{pkg_pcs_snmp} +# pcs-snmp package definition +%package -n %{pcs_snmp_pkg_name} Group: System Environment/Base Summary: Pacemaker cluster SNMP agent -# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses -# GPL-2.0-only: pcs -# BSD-2-Clause: pyagentx -License: GPL-2.0-only AND BSD-2-Clause +License: GPLv2, BSD 2-clause URL: https://github.com/ClusterLabs/pcs -BuildArch: noarch -# tar for unpacking pyagentx source tarball +# tar for unpacking pyagetx source tar ball BuildRequires: tar Requires: pcs = %{version}-%{release} @@ -224,206 +135,75 @@ Requires: net-snmp Provides: bundled(pyagentx) = %{pyagentx_version} -# pcs-web-ui subpackage definition -%package -n %{pkg_pcs_web_ui} -Summary: Standalone web UI for Pacemaker/Corosync Configuration System -# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/ -# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses -# GPL-2.0-only: pcs -License: GPL-2.0-only -URL: https://github.com/ClusterLabs/pcs-web-ui - -# Split pcs to pcs and pcs-web-ui, all packages that replace pcs must obsolete -# the old monolithic package -# https://docs.fedoraproject.org/en-US/packaging-guidelines/#_one_to_many_replacement -Obsoletes: pcs < 0.12.0 - -Requires: pcs = %{version}-%{release} - -Provides: bundled(pcs-web-ui) = %{!?ui_tarball_version:%{ui_version}}%{?ui_tarball_version} - -# cockpit-ha-cluster subpackage definition -%package -n %{pkg_cockpit_ha_cluster} -Group: System Environment/Base -Summary: Cockpit application for managing Pacemaker based clusters -License: GPL-2.0-only AND CC0-1.0 -URL: https://github.com/ClusterLabs/pcs-web-ui - -BuildRequires: make -BuildRequires: nodejs-npm - -Requires: pcs = %{version}-%{release} -Requires: cockpit-bridge - -Provides: bundled(pcs-web-ui) = %{!?ui_tarball_version:%{ui_version}}%{?ui_tarball_version} - - - -%description -pcs is a configuration tool for Corosync and Pacemaker. It permits users to -easily view, modify and create high availability clusters based on Pacemaker. -This package contains the pcs command-line utility and its server pcsd. - -%description -n %{pkg_pcs_web_ui} -Provides standalone web UI for Pacemaker/Corosync Configuration System (pcs). - -%description -n %{pkg_pcs_snmp} -SNMP agent that provides information about Pacemaker cluster to the main agent -(snmpd). - -%description -n %{pkg_cockpit_ha_cluster} -Cockpit application for managing Pacemaker based clusters. Uses -Pacemaker/Corosync Configuration System (pcs) in the background. - - +%description -n %{pcs_snmp_pkg_name} +SNMP agent that provides information about pacemaker cluster to the master agent (snmpd) +%define PCS_PREFIX /usr %prep -# -- following is inspired by python-simplejon.el5 -- +%setup -q + +# -- following borrowed from 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 - -update_times(){ - # update_times ... - # set the access and modification times of each file_to_touch to the times - # of reference_file - - # put all args to file_list - file_list=("$@") - # first argument is reference_file: so take it and remove from file_list - reference_file=${file_list[0]} - unset file_list[0] - - for fname in ${file_list[@]}; do - # some files could be deleted by a patch therefore we test file for - # existance before touch to avoid exit with error: No such file or - # directory - # diffstat cannot create list of files without deleted files - test -e $fname && touch -r $reference_file $fname +# .pyc/.pyo files across the multilib peers within a build, where "Level" +# is the patch prefix option (e.g. -p1) +UpdateTimestamps() { + Level=$1 + PatchFile=$2 + # Locate the affected files: + for f in $(diffstat $Level -l $PatchFile); do + # Set the files to have the same timestamp as that of the patch: + touch -r $PatchFile $f done } -update_times_patch(){ - # update_times_patch - # set the access and modification times of each file in patch to the times - # of patch_file_name +%patch0 -p1 +UpdateTimestamps -p1 %{PATCH0} - patch_file_name=$1 - - # diffstat - # -l lists only the filenames. No histogram is generated. - # -p override the logic that strips common pathnames, - # simulating the patch "-p" option. (Strip the smallest prefix containing - # num leading slashes from each file name found in the patch file) - update_times ${patch_file_name} `diffstat -p1 -l ${patch_file_name}` -} - -# documentation for setup/autosetup/autopatch: -# * 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 -# -n — Set Name of Build Directory -# -T — Do Not Perform Default Archive Unpacking -# -b — Unpack The nth Sources Before Changing Directory -# -a — Unpack The nth Sources After Changing Directory -# -N — disables automatic patch application, use autopatch to apply patches -# -# 1. unpack sources (-b 0) -# 2. then cd into sources tree (the setup macro itself) -# 3. then unpack node_modules into sources tree (-a 1). -%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 %%{PATCH1} -update_times_patch %{PATCH1} -update_times_patch %{PATCH2} -update_times_patch %{PATCH3} - -# 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 0%{?tarball_version:1} - echo %{tarball_version} > %{_builddir}/%{pcs_source_name}/.tarball-version -%endif - -%if 0%{?ui_tarball_version:1} - echo %{ui_tarball_version} > %{_builddir}/%{ui_src_name}/.tarball-version -%endif - -# prepare dirs/files necessary for building python bundles -mkdir -p %{pcs_bundled_dir}/src -cp -f %SOURCE41 rpm/ -cp -f %SOURCE42 rpm/ +mkdir -p pcsd/.bundle +cp -f %SOURCE1 pcsd/.bundle/config +mkdir -p pcsd/vendor/cache +#copy ruby gems +cp -f %SOURCE11 pcsd/vendor/cache +cp -f %SOURCE12 pcsd/vendor/cache +cp -f %SOURCE13 pcsd/vendor/cache +#ruby gems copied +mkdir -p %{bundled_lib_dir} +tar -xzf %SOURCE41 -C %{bundled_lib_dir} +mv %{bundled_lib_dir}/pyagentx-%{pyagentx_version} %{pyagentx_dir} +cp %{pyagentx_dir}/LICENSE.txt pyagentx_LICENSE.txt +cp %{pyagentx_dir}/CONTRIBUTORS.txt pyagentx_CONTRIBUTORS.txt +cp %{pyagentx_dir}/README.md pyagentx_README.md %build %define debug_package %{nil} -# We left off by setting up pcs, so we are in its directory now -./autogen.sh -%{configure} --enable-local-build --enable-use-local-cache-only \ - --enable-individual-bundling --enable-webui \ - --with-pcsd-default-cipherlist='PROFILE=SYSTEM' \ - --with-pcs-lib-dir="%{_prefix}/lib" PYTHON=%{__python3} -make all - -# 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 - - - %install -rm -rf %{buildroot} +rm -rf $RPM_BUILD_ROOT pwd - -# Install cockpit pcs-web-ui -cd ../%{ui_src_name} -%make_install - -# prepare pcs-web-ui files (not needed for pcs as pcs installs them in Makefile) -mkdir -p %{buildroot}/%{_defaultlicensedir}/%{pkg_cockpit_ha_cluster} -mkdir -p %{buildroot}/%{_defaultlicensedir}/%{pkg_pcs_web_ui} - -cp COPYING %{buildroot}/%{_defaultlicensedir}/%{pkg_cockpit_ha_cluster}/COPYING_WUI.md -mv COPYING %{buildroot}/%{_defaultlicensedir}/%{pkg_pcs_web_ui}/COPYING_WUI.md - -mkdir -p %{buildroot}/%{_docdir}/%{pkg_cockpit_ha_cluster} -mkdir -p %{buildroot}/%{_docdir}/%{pkg_pcs_web_ui} - -cp CHANGELOG.md %{buildroot}/%{_docdir}/%{pkg_cockpit_ha_cluster}/CHANGELOG_WUI.md -mv CHANGELOG.md %{buildroot}/%{_docdir}/%{pkg_pcs_web_ui}/CHANGELOG_WUI.md - -cp README.md %{buildroot}/%{_docdir}/%{pkg_cockpit_ha_cluster}/README_WUI.md -mv README.md %{buildroot}/%{_docdir}/%{pkg_pcs_web_ui}/README_WUI.md - -# Install pcs -cd ../%{pcs_source_name} -%make_install - -# prepare license files -cp %{pcs_bundled_dir}/src/pyagentx-*/LICENSE.txt pyagentx_LICENSE.txt -cp %{pcs_bundled_dir}/src/pyagentx-*/CONTRIBUTORS.txt pyagentx_CONTRIBUTORS.txt -cp %{pcs_bundled_dir}/src/pyagentx-*/README.md pyagentx_README.md - -cp %{pcs_bundled_dir}/src/dacite-*/LICENSE dacite_LICENSE -cp %{pcs_bundled_dir}/src/dacite-*/README.md dacite_README.md - - +make install \ + DESTDIR=$RPM_BUILD_ROOT \ + PREFIX=%{PCS_PREFIX} \ + PYTHON=%{__python3} \ + PYTHON_SITELIB=%{python3_sitelib} \ + SYSTEMCTL_OVERRIDE=true \ + BASH_COMPLETION_DIR=$RPM_BUILD_ROOT/usr/share/bash-completion/completions \ + PYAGENTX_DIR=`readlink -f %{pyagentx_dir}` \ + SYSTEMCTL_OVERRIDE=true +make install_pcsd \ + DESTDIR=$RPM_BUILD_ROOT \ + PREFIX=%{PCS_PREFIX} \ + PYTHON=%{__python3} \ + PYTHON_SITELIB=%{python3_sitelib} \ + SYSTEMCTL_OVERRIDE=true \ + hdrdir="%{_includedir}" \ + rubyhdrdir="%{_includedir}" \ + includedir="%{_includedir}" +#after the ruby gem compilation we do not need ruby gems in the cache +rm -r -v $RPM_BUILD_ROOT%{PCS_PREFIX}/lib/pcsd/vendor/cache %check -# Run validation of cockpit 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 # variable disables the warning. @@ -435,22 +215,125 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{ui_meta export PYTHONCOERCECLOCALE=0 run_all_tests(){ - #run pcs tests + #prepare environmet for tests + sitelib=$RPM_BUILD_ROOT%{python3_sitelib} + pcsd_dir=$RPM_BUILD_ROOT%{PCS_PREFIX}/lib/pcsd + export PYTHONPATH="${PYTHONPATH}:${sitelib}" + + #run pcs tests and remove them, we do not distribute them in the rpm # disabled tests: # - %{__python3} pcs_test/suite --tier0 -v --vanilla --all-but \ - pcs_test.tier0.daemon.app.test_app_remote.SyncConfigMutualExclusive.test_get_not_locked \ - pcs_test.tier0.daemon.app.test_app_remote.SyncConfigMutualExclusive.test_post_not_locked \ + # pcs.test.test_cluster.ClusterTest.testUIDGID + # touches live cluster configuration, cannot run in mock environment + # pcs.test.cib_resource.test_create.Success.test_base_create_with_agent_name_including_systemd_instance + # It requires systemd to be running so pacemaker can connect to it via dbus. + # This is not possible during building. + # AssertionError: 0 != 1 : Expected return code "0", but was "1" + # command: resource create R systemd:lvm2-pvscan@252:2 --no-default-ops + # stdout: Error: Agent 'systemd:lvm2-pvscan@252:2' is not installed or does + # not provide valid metadata: error: crm_abort: systemd_unit_exec: + # Triggered fatal assert at systemd.c:728 : systemd_init(), use --force to + # override + # pcs.lib.commands.test.test_resource_agent.DescribeAgentUtf8.test_describe + # For a unknwon reason this test is passing outside the mock environment. + # TODO: Investigate the issue + # all others: + # resource agents metadata have been changed lately, units (seconds) have + # been added to the intervals etc. (e.g.: interval="10" => interval="10s") + + %{__python3} ${sitelib}/pcs/test/suite.py -v --vanilla --all-but \ + pcs.test.test_cluster.ClusterTest.testUIDGID \ + pcs.test.cib_resource.test_create.Success.test_base_create_with_agent_name_including_systemd_instance \ + pcs.lib.commands.test.test_resource_agent.DescribeAgentUtf8.test_describe \ + pcs.test.cib_resource.test_create.Bundle.test_success \ + pcs.test.cib_resource.test_create.FailOrWarnGroup.test_fail_when_try_use_id_of_another_element \ + pcs.test.cib_resource.test_create.Success.test_base_create \ + pcs.test.cib_resource.test_create.Success.test_base_create_with_default_ops \ + pcs.test.cib_resource.test_create.Success.test_create_disabled \ + pcs.test.cib_resource.test_create.Success.test_create_with_trace_options \ + pcs.test.cib_resource.test_create.Success.test_with_clone \ + pcs.test.cib_resource.test_create.Success.test_with_clone_options \ + pcs.test.cib_resource.test_create.Success.test_with_master \ + pcs.test.cib_resource.test_create.SuccessClone.test_clone_does_not_overshadow_meta_options \ + pcs.test.cib_resource.test_create.SuccessClone.test_clone_does_not_overshadow_operations \ + pcs.test.cib_resource.test_create.SuccessClone.test_clone_places_disabled_correctly \ + pcs.test.cib_resource.test_create.SuccessGroup.test_with_existing_group \ + pcs.test.cib_resource.test_create.SuccessGroup.test_with_group \ + pcs.test.cib_resource.test_create.SuccessGroup.test_with_group_with_after \ + pcs.test.cib_resource.test_create.SuccessGroup.test_with_group_with_before \ + pcs.test.cib_resource.test_create.SuccessMaster.test_disable_is_on_master_element \ + pcs.test.cib_resource.test_create.SuccessMaster.test_do_not_steal_primitive_meta_options \ + pcs.test.cib_resource.test_create.SuccessMaster.test_put_options_after_master_as_its_meta_fix_1 \ + pcs.test.cib_resource.test_create.SuccessOperations.test_completing_monitor_operation \ + pcs.test.cib_resource.test_create.SuccessOperations.test_default_ops_only \ + pcs.test.cib_resource.test_create.SuccessOperations.test_merging_default_ops_explictly_specified \ + pcs.test.cib_resource.test_create.SuccessOperations.test_warn_on_forced_unknown_operation \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_manage_monitor \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_manage_monitor_disabled \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_manage_more \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_manage_nonexistent \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_manage_one \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_unmanage_monitor \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_unmanage_monitor_enabled \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_unmanage_more \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_unmanage_nonexistent \ + pcs.test.cib_resource.test_manage_unmanage.ManageUnmanage.test_unmanage_one \ + pcs.test.cib_resource.test_operation_add.OperationAdd.test_add_with_OCF_CHECK_LEVEL \ + pcs.test.cib_resource.test_operation_add.OperationAdd.test_base_add \ + pcs.test.cib_resource.test_operation_add.OperationAdd.test_can_multiple_operation_add \ + pcs.test.cib_resource.test_operation_add.OperationAdd.test_id_specified \ + pcs.test.test_cluster.ClusterTest.testRemoteNode \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_disallowed_option_appear \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_guest_node_conflicts_with_existing_guest \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_guest_node_conflicts_with_existing_id \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_guest_node_conflicts_with_existing_remote \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_guest_node_name_conflicts_with_existing_remote \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_invalid_interval_appear \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_invalid_port_appear \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_fail_when_option_remote_node_specified \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_success \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_success_when_guest_node_matches_with_existing_guest \ + pcs.test.test_cluster_pcmk_remote.NodeAddGuest.test_success_with_options \ + pcs.test.test_cluster_pcmk_remote.NodeRemoveGuest.test_success_remove_by_node_name \ + pcs.test.test_cluster_pcmk_remote.NodeRemoveGuest.test_success_remove_by_resource_host \ + pcs.test.test_cluster_pcmk_remote.NodeRemoveGuest.test_success_remove_by_resource_id \ + pcs.test.test_resource.CloneMasterUpdate.test_no_op_allowed_in_clone_update \ + pcs.test.test_resource.CloneMasterUpdate.test_no_op_allowed_in_master_update \ + pcs.test.test_resource.ResourceTest.testAddOperation \ + pcs.test.test_resource.ResourceTest.testAddResourcesLargeCib \ + pcs.test.test_resource.ResourceTest.testCloneMaster \ + pcs.test.test_resource.ResourceTest.testCloneRemove \ + pcs.test.test_resource.ResourceTest.testClonedGroup \ + pcs.test.test_resource.ResourceTest.testClonedMasteredGroup \ + pcs.test.test_resource.ResourceTest.testGroupRemoveTest \ + pcs.test.test_resource.ResourceTest.testGroupRemoveWithConstraints2 \ + pcs.test.test_resource.ResourceTest.testMSGroup \ + pcs.test.test_resource.ResourceTest.testMasteredGroup \ + pcs.test.test_resource.ResourceTest.testNoMoveMSClone \ + pcs.test.test_resource.ResourceTest.testOPOption \ + pcs.test.test_resource.ResourceTest.testResourceCloneId \ + pcs.test.test_resource.ResourceTest.testResourceCloneUpdate \ + pcs.test.test_resource.ResourceTest.testResourceEnable \ + pcs.test.test_resource.ResourceTest.testResourceEnableClone \ + pcs.test.test_resource.ResourceTest.testResourceMasterId \ + pcs.test.test_resource.ResourceTest.testResourceMissingValues \ + pcs.test.test_resource.ResourceTest.testUnclone \ + pcs.test.test_resource.ResourceTest.testUpdateOperation \ test_result_python=$? + #remove pcs tests, we do not distribute them in the rpm + find ${sitelib}/pcs -name test -type d -print0|xargs -0 rm -r -v -- + #run pcsd tests and remove them - ruby \ - -I%{buildroot}%{_prefix}/lib/pcsd \ - -Ipcsd/test \ - pcsd/test/test_all_suite.rb + GEM_HOME=${pcsd_dir}/vendor/bundle/ruby ruby \ + -I${pcsd_dir} \ + -I${pcsd_dir}/test \ + ${pcsd_dir}/test/test_all_suite.rb test_result_ruby=$? + #remove pcsd tests, we do not distribute them in the rpm + rm -r -v ${pcsd_dir}/test if [ $test_result_python -ne 0 ]; then return $test_result_python @@ -460,389 +343,83 @@ run_all_tests(){ run_all_tests +%pretrans -p +-- workaround for upgrading from a broken package pcs-0.9.150-1.fc24 +-- taken from https://fedoraproject.org/wiki/Packaging:Directory_Replacement +-- see https://bugzilla.redhat.com/show_bug.cgi?id=1370095 for details +for i, path in pairs({ + "/usr/lib/pcsd/vendor/bundle/ruby/extensions", + "/usr/lib/pcsd/vendor/bundle/ruby/gems", + "/usr/lib/pcsd/vendor/bundle/ruby/specifications" +}) do + st = posix.stat(path) + if st and st.type == "link" then + os.remove(path) + end +end -# Mark pcsd and pcs_snmp_agent for restart after upgrade -%posttrans -%systemd_posttrans_with_restart pcsd.service +%post +%systemd_post pcsd.service -%posttrans -n %{pkg_pcs_snmp} -%systemd_posttrans_with_restart pcs_snmp_agent.service - -# Restart pcsd if it is running to reload the Tornado app so it detects -# presence or absence of the webui backend handler on install/update -# of pcs-web-ui that contains it -# Systemd will not pick-up on this change because pcs-web-ui doesn't contain -# a unit file that would mark it for restart -# https://fedoraproject.org/wiki/Changes/Restart_services_at_end_of_rpm_transaction -%posttrans -n %{pkg_pcs_web_ui} -systemctl try-restart pcsd.service - -# Runs only on pcs-web-ui uninstall -# https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/ -%postun -n %{pkg_pcs_web_ui} -if [ $1 -eq 0 ] ; then - systemctl try-restart pcsd.service -fi +%post -n %{pcs_snmp_pkg_name} +%systemd_post pcs_snmp_agent.service +%preun +%systemd_preun pcsd.service +%postun +%systemd_postun_with_restart pcsd.service %files %doc CHANGELOG.md %doc README.md -%doc dacite_README.md -%license dacite_LICENSE %license COPYING -%{python3_sitelib}/* -%{_bindir}/pcs -%{_bindir}/pcsd -%{_prefix}/lib/pcs/* -%{_prefix}/lib/pkgconfig/pcs.pc -%{_prefix}/lib/pcsd/* -%{_unitdir}/pcsd.service -%{_unitdir}/pcsd-ruby.service -%{_datadir}/bash-completion/completions/pcs -%{_sharedstatedir}/pcsd -%config(noreplace) %{_sysconfdir}/pam.d/pcsd -%dir %{_var}/log/pcsd -%config(noreplace) %{_sysconfdir}/logrotate.d/pcsd -%config(noreplace) %{_sysconfdir}/sysconfig/pcsd -%ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/cfgsync_ctl -%ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/known-hosts -%ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/pcsd.cookiesecret -%ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/pcsd.crt -%ghost %config(noreplace) %attr(0600,root,root) %{_sharedstatedir}/pcsd/pcsd.key -%ghost %config(noreplace) %attr(0644,root,root) %{_sharedstatedir}/pcsd/pcs_settings.conf -%ghost %config(noreplace) %attr(0644,root,root) %{_sharedstatedir}/pcsd/pcs_users.conf +%{python3_sitelib}/pcs +%{python3_sitelib}/pcs-%{version}-py3.*.egg-info +/usr/sbin/pcs +/usr/lib/pcsd/* +/usr/lib/pcsd/.bundle/config +/usr/lib/systemd/system/pcsd.service +/usr/share/bash-completion/completions/pcs +/var/lib/pcsd +/etc/pam.d/pcsd +%dir /var/log/pcsd +%config(noreplace) /etc/logrotate.d/pcsd +%config(noreplace) /etc/sysconfig/pcsd +%ghost %config(noreplace) /var/lib/pcsd/cfgsync_ctl +%ghost %config(noreplace) /var/lib/pcsd/pcsd.cookiesecret +%ghost %config(noreplace) /var/lib/pcsd/pcsd.crt +%ghost %config(noreplace) /var/lib/pcsd/pcsd.key +%ghost %config(noreplace) /var/lib/pcsd/pcs_settings.conf +%ghost %config(noreplace) /var/lib/pcsd/pcs_users.conf +%ghost %config(noreplace) /var/lib/pcsd/tokens %{_mandir}/man8/pcs.* %{_mandir}/man8/pcsd.* -%exclude %{_prefix}/lib/pcs/pcs_snmp_agent -%exclude %{_prefix}/lib/pcs/%{pcs_bundled_dir}/packages/pyagentx* -%exclude %{cockpit_dir} -%exclude %{ui_metainfo} -%exclude %{python3_sitelib}/pcs/daemon/app/webui -%exclude %{pcsd_webui_dir} +%exclude /usr/lib/pcsd/*.debian +%exclude /usr/lib/pcsd/pcsd.service +%exclude /usr/lib/pcsd/pcsd.conf +%exclude /usr/lib/pcsd/pcsd.8 +%exclude %{python3_sitelib}/pcs/bash_completion +%exclude %{python3_sitelib}/pcs/pcs.8 +%exclude %{python3_sitelib}/pcs/pcs -%files -n %{pkg_pcs_web_ui} -%doc CHANGELOG.md -%doc %{_docdir}/%{pkg_pcs_web_ui}/CHANGELOG_WUI.md -%doc %{_docdir}/%{pkg_pcs_web_ui}/README_WUI.md -%license COPYING -%license %{_defaultlicensedir}/%{pkg_pcs_web_ui}/COPYING_WUI.md -%{python3_sitelib}/pcs/daemon/app/webui -%{pcsd_webui_dir} - -%files -n %{pkg_pcs_snmp} -%{_prefix}/lib/pcs/pcs_snmp_agent -%{_prefix}/lib/pcs/%{pcs_bundled_dir}/packages/pyagentx* -%{_unitdir}/pcs_snmp_agent.service -%{_datadir}/snmp/mibs/PCMK-PCS*-MIB.txt +%files -n %{pcs_snmp_pkg_name} +/usr/lib/pcs/pcs_snmp_agent +/usr/lib/pcs/bundled/packages/pyagentx* +/usr/lib/systemd/system/pcs_snmp_agent.service +/usr/share/snmp/mibs/PCMK-PCS*-MIB.txt %{_mandir}/man8/pcs_snmp_agent.* -%config(noreplace) %{_sysconfdir}/sysconfig/pcs_snmp_agent +%config(noreplace) /etc/sysconfig/pcs_snmp_agent +%dir /var/log/pcs +%doc COPYING %doc CHANGELOG.md +%doc pyagentx_LICENSE.txt %doc pyagentx_CONTRIBUTORS.txt %doc pyagentx_README.md -%license COPYING -%license pyagentx_LICENSE.txt - -%files -n %{pkg_cockpit_ha_cluster} -%doc %{_docdir}/%{pkg_cockpit_ha_cluster}/CHANGELOG_WUI.md -%doc %{_docdir}/%{pkg_cockpit_ha_cluster}/README_WUI.md -%license %{_defaultlicensedir}/%{pkg_cockpit_ha_cluster}/COPYING_WUI.md -%{cockpit_dir} -%{ui_metainfo} - - %changelog -* Fri Sep 19 2025 Python Maint - 0.12.1-5 -- Rebuilt for Python 3.14.0rc3 bytecode - -* Fri Aug 15 2025 Python Maint - 0.12.1-4 -- Rebuilt for Python 3.14.0rc2 bytecode - -* Wed Jul 30 2025 Michal Pospíšil - 0.12.1-3 -- Remove BuildRequires: python3-wheel when using setuptools 71+ - -* Fri Jul 25 2025 Fedora Release Engineering - 0.12.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Fri Jul 18 2025 Michal Pospíšil - 0.12.1-1 -- Rebased pcs to the newest major version (see CHANGELOG.md) - Resolves: rhbz#2371770 -- Updated standalone web UI and HA Cluster Management Cockpit application to pcs-web-ui 0.1.23 (see CHANGELOG_WUI.md) -- There is now a changelog for the HA Cluster Management Cockpit application and the standalone web UI in both packages -- The upstream version of pcs-web-ui can now be queried through RPM in both packages - see bundled(pcs-web-ui) -- Updated bundled Python dependency dacite -- Compatibility with rubygem-rack >= 3 - Resolves: rhbz#2372462 - -* Tue Jun 03 2025 Python Maint - 0.12.0-2 -- Rebuilt for Python 3.14 - -* Mon Jan 27 2025 Michal Pospíšil - 0.12.0-1 -- Rebased pcs to the newest major version (see CHANGELOG.md) - Resolves: rhbz#2341012 -- New subpackage pcs-web-ui - enables standalone web UI when the subpackage is installed on the system (default), uninstall the subpackage to disable the web UI -- Updated standalone web UI and HA Cluster Management Cockpit application to pcs-web-ui 0.1.22 -- Fixes for compatibility with Ruby 3.4 - Resolves: rhbz#2331005 - -* Fri Jan 17 2025 Fedora Release Engineering - 0.11.8-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Tue Aug 6 2024 Michal Pospíšil - 0.11.8-1 -- Rebased to the latest sources (see CHANGELOG.md) -- Updated pcs-web-ui to 0.1.20 - -* Thu Jul 18 2024 Fedora Release Engineering - 0.11.7-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sun Jun 09 2024 Python Maint - 0.11.7-4 -- Rebuilt for Python 3.13 - -* Mon Feb 5 2024 Michal Pospisil - 0.11.7-3 -- Fixed a bug preventing the Cockpit Application from being installed from Cockpit - -* Thu Jan 25 2024 Fedora Release Engineering - 0.11.7-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Mon Jan 8 2024 Michal Pospisil - 0.11.7-1 -- Rebased to the latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui to 0.1.18 -- TLS cipher setting in pcsd now follows system-wide crypto policies by default -- Added cockpit-ha-cluster subpackage that adds pcs-web-ui as a Cockpit application - -* Thu Jul 20 2023 Fedora Release Engineering - 0.11.6-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Wed Jun 28 2023 Python Maint - 0.11.6-2 -- Rebuilt for Python 3.12 - -* Wed Jun 21 2023 Michal Pospisil - 0.11.6-1 -- Rebased to the latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Removed dependency fedora-logos - favicon is now correctly provided by pcs-web-ui -- Resolves: rhbz#2109852 rhbz#2170648 - -* Wed Apr 12 2023 Michal Pospisil - 0.11.5-2 -- Fix displaying differences between configuration checkpoints in “pcs config checkpoint diff” command -- Fix “pcs stonith update-scsi-devices” command which was broken since Pacemaker-2.1.5-rc1 -- Fixed loading of cluster status in the web interface when fencing levels are configured -- Fixed a vulnerability in pcs-web-ui-node-modules -- Swapped BuildRequires: npm for BuildRequires: nodejs-npm in Fedora 37 because of NodeJS packaging change -- Removed BuildRequires: rubygem-io-console -- Removed dependency rubygem-eventmachine - -* Thu Feb 16 2023 Michal Pospisil - 0.11.5-1 -- Rebased to the latest upstream sources (see CHANGELOG.md) -- Fixed broken filtering in create resource/fence device wizards in the web interface -- Converted package to noarch -- Added creation of .tarball-version file needed by autotools when building from untagged commits and fixed Source0 link to the tarball on GitHub -- Modified build options of pcs for booth authfile fix for all Fedora versions -- Added BuildRequires: pam for tier0 tests during build -- Added BuildRequires: nodejs-npm for NodeJS packaging change since Fedora 38 -- Removed bundled rubygem thin and its associated BuildRequires: rubygems, rubygem-bundler, rubygem-daemons, gcc, gcc-c++ -- Added dependency rubygem-puma - replacement for rubygem thin -- Added dependency nss-tools - for working with qdevice certificates -- Added dependency fedora-logos - for the web interface favicon -- Removed dependencies: rubygem-daemons, rubygem(webrick) -- Resolves: rhbz#2166266 - -* Thu Jan 19 2023 Fedora Release Engineering - 0.11.4-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Wed Jan 04 2023 Mamoru TASAKA - 0.11.4-2 -- Rebuild for https://fedoraproject.org/wiki/Changes/Ruby_3.2 -- Workaround for dnf dependency resolution confusion between nodejs16 vs nodejs -- Workaround for find-debuginfo.sh failure wrt ruby3.2 gem install change - -* Mon Dec 12 2022 Michal Pospisil - 0.11.4-1 +* Fri Oct 05 2018 Ondrej Mular - 0.9.166-1 - Rebased to latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Added dependency rubygem-childprocess -- Removed dependency rubygem-open4 - -* Mon Dec 12 2022 Mamoru TASAKA - 0.11.3-5 -- Backport upstream patch for rubygem-json 2.6.3 error message format change - -* Wed Sep 07 2022 Miroslav Lisik - 0.11.3-4 -- Fixed ruby socket permissions -- Resolves: rhbz#2123389 - -* Fri Jul 22 2022 Fedora Release Engineering - 0.11.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Tue Jul 19 2022 Zbigniew Jędrzejewski-Szmek - 0.11.3-2 -- Rebuilt for pyparsing-3.0.9 - -* Tue Jun 28 2022 Miroslav Lisik - 0.11.3-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Resolves: rhbz#2068452 - -* Tue Jun 14 2022 Python Maint - 0.11.2-3 -- Rebuilt for Python 3.11 - -* Thu Jun 09 2022 Miroslav Lisik - 0.11.2-2 -- Python 3.11 related fixes -- Resolves: rhbz#bz2093935 - -* Fri Feb 04 2022 Miroslav Lisik - 0.11.2-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Removed old web gui - -* Thu Jan 27 2022 Vít Ondruch - 0.10.11-3 -- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_3.1 - -* Thu Jan 20 2022 Fedora Release Engineering - 0.10.11-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Tue Oct 05 2021 Miroslav Lisik - 0.10.11-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Stop bundling rubygems daemons eventmachine mustermann rack rack-protection ruby2_keywords sinatra tilt - -* Mon Aug 16 2021 Miroslav Lisik - 0.10.9-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Bundle rubygem-sinatra, rubygem-thin and their dependencies because they were orphaned -- Resolves: rhbz#1983359 - -* Thu Jul 22 2021 Fedora Release Engineering - 0.10.8-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Fri Jun 04 2021 Python Maint - 0.10.8-3 -- Rebuilt for Python 3.10 - -* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 0.10.8-2 -- Rebuilt for updated systemd-rpm-macros - See https://pagure.io/fesco/issue/2583. - -* Thu Feb 04 2021 Miroslav Lisik - 0.10.8-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Updated bundled python dependency: dacite -- Changed BuildRequires from git to git-core -- Added conditional (Build)Requires: rubygem(rexml) -- Added conditional Requires: rubygem(webrick) - -* Tue Jan 26 2021 Fedora Release Engineering - 0.10.7-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Thu Jan 7 2021 Vít Ondruch - 0.10.7-3 -- Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_3.0 - -* Thu Nov 26 2020 Ondrej Mular - 0.10.7-2 -- Python 3.10 related fix - -* Wed Sep 30 2020 Miroslav Lisik - 0.10.7-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Added dependency on python packages pyparsing and dateutil -- Fixed virtual bundle provides for ember, handelbars, jquery and jquery-ui -- Removed dependency on python3-clufter - -* Tue Jul 28 2020 Fedora Release Engineering - 0.10.6-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Tue Jul 21 2020 Miroslav Lisik - 0.10.6-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Updated pcs-web-ui -- Stopped bundling tornado (use distribution package instead) -- Stopped bundling rubygem-tilt (use distribution package instead) -- Removed rubygem bundling -- Removed unneeded BuildRequires: execstack, gcc, gcc-c++ -- Excluded some tests for tornado daemon - -* Tue Jul 21 2020 Tom Stellard - 0.10.5-8 -- Use make macros -- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro - -* Wed Jul 15 2020 Ondrej Mular - 0.10.5-7 -- Use fixed upstream version of dacite with Python 3.9 support -- Split upstream tests in gating into tiers - -* Fri Jul 03 2020 Ondrej Mular - 0.10.5-6 -- Use patched version of dacite compatible with Python 3.9 -- Resolves: rhbz#1838327 - -* Tue May 26 2020 Miro Hrončok - 0.10.5-5 -- Rebuilt for Python 3.9 - -* Thu May 07 2020 Ondrej Mular - 0.10.5-4 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Run only tier0 tests in check section - -* Fri Apr 03 2020 Ondrej Mular - 0.10.5-3 -- Enable gating - -* Fri Mar 27 2020 Ondrej Mular - 0.10.5-2 -- Remove usage of deprecated module xml.etree.cElementTree -- Resolves: rhbz#1817695 - -* Wed Mar 18 2020 Miroslav Lisik - 0.10.5-1 -- Rebased to latest upstream sources (see CHANGELOG.md) - -* Wed Jan 29 2020 Fedora Release Engineering - 0.10.4-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Thu Nov 28 2019 Miroslav Lisik - 0.10.4-1 -- Rebased to latest upstream sources (see CHANGELOG.md) - -* Thu Oct 03 2019 Miro Hrončok - 0.10.3-2 -- Rebuilt for Python 3.8.0rc1 (#1748018) - -* Fri Aug 23 2019 Ondrej Mular - 0.10.3-1 -- Rebased to latest upstream sources (see CHANGELOG.md) - -* Mon Aug 19 2019 Miro Hrončok - 0.10.2-3 -- Rebuilt for Python 3.8 - -* Fri Jul 26 2019 Fedora Release Engineering - 0.10.2-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Jun 14 2019 Ondrej Mular - 0.10.2-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Added pam as required package -- An alternative webUI rebased to latest upstream sources -- Improved configuration files permissions in rpm - -* Tue Mar 19 2019 Tomas Jelinek - 0.10.1-4 -- Removed unused dependency rubygem-multi_json -- Removed files needed only for building rubygems from the package - -* Mon Feb 04 2019 Ivan Devát - 0.10.1-3 -- Corrected gem install flags - -* Fri Feb 01 2019 Fedora Release Engineering - 0.10.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Wed Jan 09 2019 Ivan Devát - 0.10.1-1 -- Rebased to latest upstream sources (see CHANGELOG.md) - -* Tue Oct 09 2018 Ondrej Mular - 0.10.0.alpha.6-1 -- Rebased to latest upstream sources (see CHANGELOG.md) -- Resolves: rhbz#1618911 - -* Fri Aug 31 2018 Ivan Devát - 0.10.0.alpha.2-3 -- Started bundling rubygem-tilt (rubygem-tilt is orphaned in fedora due to rubygem-prawn dependency) -- Enabled passing tests - -* Sat Aug 25 2018 Ivan Devát - 0.10.0.alpha.2-2 -- Fixed error with missing rubygem location during pcsd start -- Resolves: rhbz#1618911 - -* Thu Aug 02 2018 Ivan Devát - 0.10.0.alpha.2-1 -- Rebased to latest upstream sources (see CHANGELOG.md) - -* Wed Jul 25 2018 Ivan Devát - 0.9.164-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Fri Jul 13 2018 Fedora Release Engineering - 0.9.164-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 19 2018 Miro Hrončok - 0.9.164-2 -- Rebuilt for Python 3.7 * Mon Apr 09 2018 Ondrej Mular - 0.9.164-1 - Rebased to latest upstream sources (see CHANGELOG.md) diff --git a/plan-gating.fmf b/plan-gating.fmf deleted file mode 100644 index 78d1116..0000000 --- a/plan-gating.fmf +++ /dev/null @@ -1,32 +0,0 @@ -summary: PCS gating test plan -description: Runs upstream tier0, tier1 and smoke tests - -discover: - dist-git-source: true - dist-git-install-builddeps: true - how: shell - tests: - - name: tier0 - test: | - ./prepare-tests.sh - $TMT_SOURCE_DIR/pcs-*/pcs_test/suite --tier0 -v --vanilla --installed - duration: 10m - tier: 0 - tag: fast - - name: tier1 - test: | - ./prepare-tests.sh - $TMT_SOURCE_DIR/pcs-*/pcs_test/suite --tier1 -v --vanilla --installed - duration: 2h - tier: 1 - - name: smoke - test: | - systemctl start pcsd - ./prepare-tests.sh - $TMT_SOURCE_DIR/pcs-*/pcs_test/smoke.sh - duration: 10m - tier: smoke - tag: fast - -execute: - how: tmt diff --git a/prepare-tests.sh b/prepare-tests.sh deleted file mode 100755 index aeb9a8b..0000000 --- a/prepare-tests.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -set -eo xtrace -cd $TMT_SOURCE_DIR -# Use stamp file to abort if this script already ran -if [ -e tests-prepared-stamp ]; then exit 0; fi -# RPM 4.20 changed the builddir structure - unpacked sources go to *-build but -# tmt copies them back to pcs-*, so the pcs-*-build folder is empty -# Remove pcs-web-ui, pcs-*-build for "cd pcs-*" to have exactly one match -rm -rf pcs-web-ui-* pcs-*-build -cd pcs-*/ -# Run autotools, use bundled dependencies from the system -export PYTHONPATH=/usr/lib/pcs/pcs_bundled/packages/ -export GEM_HOME=/usr/lib/pcsd/vendor/bundle/ -# We need to use cd pcs-* because when pcs-web-ui starts using autotools, running -# autogen and configure with expanded TMT_SOURCE_DIR will match that too -./autogen.sh -./configure --enable-webui --enable-local-build --enable-use-local-cache-only \ - --enable-individual-bundling --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 diff --git a/rpminspect.yaml b/rpminspect.yaml deleted file mode 100644 index aab6587..0000000 --- a/rpminspect.yaml +++ /dev/null @@ -1,8 +0,0 @@ -xml: - # exclude ruby templates from checks - exclude_path: .*\.erb$ - -shellsyntax: - # exclude ruby templates from checks - ignore: - - /usr/lib*/pcsd/vendor/bundle/gems/thin*/lib/thin/controllers/*.erb diff --git a/show-info-page-instead-of-webui.patch b/show-info-page-instead-of-webui.patch deleted file mode 100644 index 9125cd1..0000000 --- a/show-info-page-instead-of-webui.patch +++ /dev/null @@ -1,148 +0,0 @@ -From e7fa056f582c992d3d2b289911be20440fb839ac Mon Sep 17 00:00:00 2001 -From: Ivan Devat -Date: Tue, 5 Nov 2024 16:35:02 +0100 -Subject: [PATCH 1/2] show info page instead of webui - ---- - pcs/Makefile.am | 1 + - pcs/daemon/app/webui_info_handler.py | 31 ++++++++++++++++++++++++++++ - pcs/daemon/run.py | 4 +++- - pcs_test/smoke.sh.in | 4 ++-- - pcsd/public/ui_instructions.html | 24 ++++++++++----------- - 5 files changed, 48 insertions(+), 16 deletions(-) - create mode 100644 pcs/daemon/app/webui_info_handler.py - -diff --git a/pcs/Makefile.am b/pcs/Makefile.am -index 1297473ff..8d4b93073 100644 ---- a/pcs/Makefile.am -+++ b/pcs/Makefile.am -@@ -219,6 +219,7 @@ EXTRA_DIST = \ - daemon/app/webui/core.py \ - daemon/app/webui/session.py \ - daemon/app/webui/sinatra_ui.py \ -+ daemon/app/webui_info_handler.py \ - daemon/async_tasks/__init__.py \ - daemon/async_tasks/scheduler.py \ - daemon/async_tasks/task.py \ -diff --git a/pcs/daemon/app/webui_info_handler.py b/pcs/daemon/app/webui_info_handler.py -new file mode 100644 -index 000000000..3ab8275bf ---- /dev/null -+++ b/pcs/daemon/app/webui_info_handler.py -@@ -0,0 +1,31 @@ -+from pcs.daemon.app.common import ( -+ BaseHandler, -+ RoutesType, -+) -+ -+ -+class _WebuiInfoHandler(BaseHandler): -+ __path = None -+ -+ def initialize(self, path): -+ self.__path = path -+ -+ def get(self): -+ self.set_status(404) -+ self.render(self.__path) -+ -+ -+def get_routes(path: str) -> RoutesType: -+ return [ -+ # The following two rules can be compressed into one: r"/(ui/?)?". -+ # However, the content of the parentheses used here should be captured -+ # and passed in to the handler’s get method as an argument. -+ # Unfortunately, it seems that tornado version 6.4.1 don't pass this -+ # argument (unlike version 6.3.3). Maybe it's a bug (it needs further -+ # inspection). These rules are a safe way to avoid surprises. -+ # Moreover, the captured parameter is irrelevant to the functionality -+ # of the handler. -+ (r"/", _WebuiInfoHandler, dict(path=path)), -+ (r"/ui/?", _WebuiInfoHandler, dict(path=path)), -+ (r"/ui/.*", _WebuiInfoHandler, dict(path=path)), -+ ] -diff --git a/pcs/daemon/run.py b/pcs/daemon/run.py -index 558315c23..cfe9999fc 100644 ---- a/pcs/daemon/run.py -+++ b/pcs/daemon/run.py -@@ -33,6 +33,7 @@ from pcs.daemon.app import ( - auth, - sinatra_remote, - sinatra_ui, -+ webui_info_handler, - ) - from pcs.daemon.app import capabilities as capabilities_app - -@@ -168,7 +169,8 @@ def configure_app( # noqa: PLR0913 - # Even with disabled (standalone) webui the following routes must be - # provided because they can be used via unix socket from cockpit. - routes.extend( -- sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper) -+ webui_info_handler.get_routes(webui_fallback) -+ + sinatra_ui.get_routes(auth_provider, ruby_pcsd_wrapper) - ) - - return Application( -diff --git a/pcs_test/smoke.sh.in b/pcs_test/smoke.sh.in -index fdfe8be2c..a9bb83447 100755 ---- a/pcs_test/smoke.sh.in -+++ b/pcs_test/smoke.sh.in -@@ -71,10 +71,10 @@ if [ "$webui_http_code_response" = "200" ]; then - curl --insecure --cookie ${cookie_file} --header "X-Requested-With: XMLHttpRequest" --data "hidden[hidden_input]=&config[stonith-enabled]=false" https://localhost:2224/managec/${cluster_name}/update_cluster_settings > "${output_file}" - cat "${output_file}"; echo "" - [ "$(cat ${output_file})" = "Update Successful" ] --elif [ "$webui_http_code_response" = "401" ]; then -+elif [ "$webui_http_code_response" = "404" ]; then - curl --insecure https://localhost:2224/ui/ > "${output_file}" - cat "${output_file}"; echo "" -- [ "$(cat "${output_file}")" = '{"notauthorized":"true"}' ] -+ grep "HA cluster management has been moved" "${output_file}" - else - echo "Unexpected response from https://localhost:2224/ui/ - http code: '${webui_http_code_response}'" - exit 1 -diff --git a/pcsd/public/ui_instructions.html b/pcsd/public/ui_instructions.html -index a120ed3d4..b9c1c3152 100644 ---- a/pcsd/public/ui_instructions.html -+++ b/pcsd/public/ui_instructions.html -@@ -1,27 +1,25 @@ - - - -- Pcs WebUI instructions -+ Web UI is disabled - - - --

Pcs WebUI instructions

-+

Package pcs-web-ui is not installed

-

-- WebUI is not a part of pcs repository but it has its own -- repository. -+ Since Fedora 42, pcsd web UI is distributed with pcs as pcs-web-ui -+ package. This
package can be uninstalled to disable the web UI. -

-

-- You can clone WebUI repository -- and build the web application into pcs by: -+ To re-enable pcsd web UI, install the pcs-web-ui RPM package. -

--

--    $ npm install
--    $ npm run build
--    $ mv ./build [/path/to/]pcs/pcsd/public/ui
--  
-

-- For more details, see instructions in -- README.md. -+ Another option is to try pcsd web UI as an application for -+ Cockpit -+ - a web-based
graphical interface for servers. The HA Cluster Management -+ application can be
installed from within the Applications pane in -+ Cockpit or by installing the
cockpit-ha-cluster RPM -+ package. -

- - --- -2.50.1 - diff --git a/sources b/sources index c6784fc..d0d6146 100644 --- a/sources +++ b/sources @@ -1,5 +1,6 @@ +SHA512 (pcsd-bundle-config-1) = f2a2df2dab39c2012cc6a91517716dde8f5a48788d1069c4addf619bc4dc45a98fd48f0f7964b5400e43e84fe96f942a550d2762553fea97e63dc7ad9b8be823 +SHA512 (orderedhash-0.0.6.gem) = b2dae648187437ea7d9d9be47b9ff8d0e1a96bc2ff9e50117033d5bd4cf09cfff3c0740c99c322910138cac90f33b425705ee7a30be84aa193e6afd9f576f64a +SHA512 (rpam-ruby19-1.2.1.gem) = b403964295e96a6247289518ff46e59bbae6c78bcfb647e12b7dbb247698642b4a1ee04492521b782fb3c594c2ede8143c765819fecde087e2ec850e3aea3503 +SHA512 (sinatra-contrib-2.0.0.gem) = 2e9c1fccfee050af8ef93ce0fe92504930ee41db3ff5aec3c2260ab49f334474386787057011adcb6cfa7de62f9e24ea228944d25bdf8af316b0b7614008ce03 SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a -SHA512 (dacite-1.9.2.tar.gz) = 69513bc1acd43e45a208ce4b4186072f92d9057a6a88c77d56f21405fbed7964d94fe4f6a37c99754a793caa2bd0584664dfab69169ef0d3564bb09d37769e59 -SHA512 (pcs-0.12.1.tar.gz) = 4f17a8d9c15b8c9208c94a264f5f79f03abc451e3f4ae4ba0fb338055a26407d4961466dd8f3565f6882c2c00f1d6a1ec8fd15dadcb0cf1a5586d37c56c77238 -SHA512 (pcs-web-ui-0.1.23.tar.gz) = 6bc709926f26a02d33fb3865d15a1cf15db51a07dd9b25c63f33277c427c3403c189e2ac5e7adc795b254ad0bdb50f1bc4be70f1385bc8522ca502142d41fc26 -SHA512 (pcs-web-ui-node-modules-0.1.23.tar.xz) = f39dd1fd391f10b874b5fec34da1a2f2496d66b31af736ee1dfc2ef6e0b518efd03053fd00312c84e10a33ffda492e12d48a898a21efb6241e5459828e500e80 +SHA512 (pcs-0.9.166.tar.gz) = afb1f6e95154fc0b20515d1317d07738c1fff4c90e32c3baa2b710ee0ba6aa1d01be477eb631bfbc740e2bdfff1535e6048c022ba3333395bc0f23d7d818334b