Compare commits

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

2 commits

Author SHA1 Message Date
Miroslav Lisik
d2809642a1 Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
2021-10-06 17:34:38 +02:00
Miroslav Lisik
d08a40eb57 Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
2021-08-17 15:27:32 +02:00
5 changed files with 168 additions and 106 deletions

6
.gitignore vendored
View file

@ -79,3 +79,9 @@
/pcs-0.10.8.tar.gz
/pcs-web-ui-0.1.5.tar.gz
/pcs-web-ui-node-modules-0.1.5.tar.xz
/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

View file

@ -0,0 +1,26 @@
From 5f95befc87e2a2d51f364614200aa53f57daab23 Mon Sep 17 00:00:00 2001
From: Miroslav Lisik <mlisik@redhat.com>
Date: Tue, 17 Aug 2021 10:47:30 +0200
Subject: [PATCH] configure.ac: remove checks for rexml and webrick
* they are part of ruby < 3.0, not standalone rubygems
---
configure.ac | 2 --
1 file changed, 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index fe12fe5f..14225e3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -385,8 +385,6 @@ if test "x$tests_only" != "xyes"; then
PCS_CHECK_GEM([sinatra])
PCS_CHECK_GEM([tilt])
PCS_CHECK_GEM([thin])
- PCS_CHECK_GEM([rexml])
- PCS_CHECK_GEM([webrick])
fi
if test "x$local_build" = "xyes" && test $(wc -l < Gemfile) -gt 2; then
--
2.31.1

214
pcs.spec
View file

@ -1,40 +1,37 @@
Name: pcs
Version: 0.10.8
Release: 4%{?dist}
Version: 0.10.11
Release: 1%{?dist}
# https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/
# https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#Good_Licenses
# GPLv2: pcs
# MIT: ember, handlebars, jquery, jquery-ui
# MIT: dacite, ember, handlebars, jquery, jquery-ui
License: GPLv2 and MIT
URL: https://github.com/ClusterLabs/pcs
Group: System Environment/Base
Summary: Pacemaker Configuration System
%global version_or_commit %{version}
# %%global version_or_commit 67591ed1487cb0aefa181fdfc166c8a66b55d25a
# %%global version_or_commit %%{version}.210-9862
%global pcs_source_name %{name}-%{version_or_commit}
# ui_commit can be determined by hash, tag or branch
%global ui_commit 0.1.5
%global ui_commit 0.1.9
%global ui_modules_version 0.1.9
%global ui_src_name pcs-web-ui-%{ui_commit}
%global pcs_snmp_pkg_name pcs-snmp
%global pyagentx_version 0.4.pcs.2
%global pyagentx_version 0.4.pcs.2
%global dacite_version 1.6.0
# bundled libraries for old web-ui
# javascript bundled libraries for old web-ui
%global ember_version 1.4.0
%global jquery_version 1.9.1
%global jquery_ui_version 1.10.1
%global handlebars_version 1.2.1
%global jquery_ui_version 1.12.1
%global jquery_version 3.6.0
# We do not use _libdir macro because upstream is not prepared for it.
# Pcs does not include binaries and thus it should live in /usr/lib. Tornado
# and gems include binaries and thus it should live in /usr/lib64. But the
# path to tornado/gems is hardcoded in pcs sources. Modify hard links in pcs
# sources is not the way since then rpmdiff complains that the same file has
# different content in different architectures.
%global pcs_libdir %{_prefix}/lib
%global bundled_src_dir pcs/bundled
%global pcs_bundled_dir pcs_bundled
%global pcsd_public_dir pcsd/public
#part after last slash is recognized as filename in look-aside repository
@ -42,16 +39,17 @@ Summary: Pacemaker Configuration System
Source0: %{url}/archive/%{version_or_commit}/%{pcs_source_name}.tar.gz
Source41: https://github.com/ondrejmular/pyagentx/archive/v%{pyagentx_version}/pyagentx-%{pyagentx_version}.tar.gz
Source44: https://github.com/konradhalas/dacite/archive/v%{dacite_version}/dacite-%{dacite_version}.tar.gz
Source42: https://github.com/konradhalas/dacite/archive/v%{dacite_version}/dacite-%{dacite_version}.tar.gz
Source100: https://github.com/idevat/pcs-web-ui/archive/%{ui_commit}/%{ui_src_name}.tar.gz
Source101: https://github.com/idevat/pcs-web-ui/releases/download/%{ui_commit}/pcs-web-ui-node-modules-%{ui_commit}.tar.xz
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
# Patch0: name.patch
Patch0: configure.ac-remove-checks-for-rexml-and-webrick.patch
# git for patches
BuildRequires: make
BuildRequires: git-core
BuildRequires: make
#printf from coreutils is used in makefile
BuildRequires: coreutils
# python for pcs
@ -60,8 +58,16 @@ BuildRequires: python3-dateutil >= 2.7.0
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pycurl
BuildRequires: python3-pip
BuildRequires: python3-pyparsing
BuildRequires: python3-tornado
BuildRequires: python3-cryptography
BuildRequires: python3-lxml
# for building bundled python packages
BuildRequires: python3-wheel
# for bundled python dateutil
BuildRequires: python3-setuptools_scm
BuildRequires: python3-distro
# ruby and gems for pcsd
BuildRequires: ruby >= 2.2.0
BuildRequires: ruby-devel
@ -70,24 +76,24 @@ BuildRequires: rubygem-ethon
BuildRequires: rubygem-ffi
BuildRequires: rubygem-io-console
BuildRequires: rubygem-json
BuildRequires: rubygem-mustermann
BuildRequires: rubygem-open4
BuildRequires: rubygem-rack
BuildRequires: rubygem-rack-protection
BuildRequires: rubygem-rack-test
BuildRequires: rubygem-sinatra
BuildRequires: rubygem-thin
BuildRequires: rubygem-tilt
%if 0%{?fedora} >= 34 || 0%{?eln} || 0%{?rhel} >= 9
BuildRequires: rubygem(rexml)
BuildRequires: rubygem(webrick)
%endif
BuildRequires: rubygem-sinatra
BuildRequires: rubygem-tilt
# ruby libraries for tests
BuildRequires: rubygem-test-unit
# for touching patch files (sanitization function)
BuildRequires: diffstat
# for post, preun and postun macros
BuildRequires: systemd
# for tests
BuildRequires: python3-lxml
BuildRequires: python3-pyOpenSSL
# pcsd fonts and font management tools for creating symlinks to fonts
BuildRequires: fontconfig
BuildRequires: liberation-sans-fonts
@ -96,8 +102,18 @@ BuildRequires: overpass-fonts
# for building web ui
BuildRequires: npm
# cluster stack packages for pkg-config
BuildRequires: booth
BuildRequires: corosync-qdevice-devel
BuildRequires: corosynclib-devel >= 3.0
BuildRequires: fence-agents-common
BuildRequires: pacemaker-libs-devel >= 2.0.0
BuildRequires: resource-agents
BuildRequires: sbd
# python and libraries for pcs, setuptools for pcs entrypoint
Requires: python3 >= 3.6
Requires: python3-cryptography
Requires: python3-dateutil >= 2.7.0
Requires: python3-lxml
Requires: python3-setuptools
@ -126,10 +142,8 @@ Requires: rubygem-eventmachine
Requires: rubygem-thin
# for killall
Requires: psmisc
# for working with certificates (validation etc.)
Requires: openssl
Requires: python3-pyOpenSSL
# cluster stack and related packages
Requires: pcmk-cluster-manager >= 2.0.0
Suggests: pacemaker
Requires: (corosync >= 2.99 if pacemaker)
# pcs enables corosync encryption by default so we require libknet1-plugins-all
@ -145,8 +159,11 @@ Requires: pam
# pcsd fonts
Requires: liberation-sans-fonts
Requires: overpass-fonts
# needs logrotate for /etc/logrotate.d/pcsd
Requires: logrotate
Provides: bundled(dacite) = %{dacite_version}
# javascript bundled libraries for old web-ui
Provides: bundled(ember) = %{ember_version}
Provides: bundled(handlebars) = %{handlebars_version}
Provides: bundled(jquery) = %{jquery_version}
@ -158,6 +175,7 @@ easily view, modify and create pacemaker based clusters.
# 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
# GPLv2: pcs
@ -196,7 +214,11 @@ update_times(){
unset file_list[0]
for fname in ${file_list[@]}; do
touch -r $reference_file $fname
# 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
done
}
@ -215,57 +237,62 @@ update_times_patch(){
update_times ${patch_file_name} `diffstat -p1 -l ${patch_file_name}`
}
# update_times_patch %%{PATCH0}
update_times_patch %{PATCH0}
# prepare dirs/files necessary for building web ui
# inside SOURCE100 is only directory %%{ui_src_name}
tar -xzf %SOURCE100 -C %{pcsd_public_dir}
tar -xf %SOURCE101 -C %{pcsd_public_dir}/%{ui_src_name}
# 3) dir for python bundles
mkdir -p %{bundled_src_dir}
# prepare dirs/files necessary for building all bundles
# -----------------------------------------------------
# 1) rubygems sources
# 4) sources for pyagentx
tar -xzf %SOURCE41 -C %{bundled_src_dir}
mv %{bundled_src_dir}/pyagentx-%{pyagentx_version} %{bundled_src_dir}/pyagentx
update_times %SOURCE41 `find %{bundled_src_dir}/pyagentx -follow`
cp %{bundled_src_dir}/pyagentx/LICENSE.txt pyagentx_LICENSE.txt
cp %{bundled_src_dir}/pyagentx/CONTRIBUTORS.txt pyagentx_CONTRIBUTORS.txt
cp %{bundled_src_dir}/pyagentx/README.md pyagentx_README.md
# 7) sources for python dacite
tar -xzf %SOURCE44 -C %{bundled_src_dir}
mv %{bundled_src_dir}/dacite-%{dacite_version} %{bundled_src_dir}/dacite
cp %{bundled_src_dir}/dacite/LICENSE dacite_LICENSE
cp %{bundled_src_dir}/dacite/README.md dacite_README.md
# 2) prepare python bundles
mkdir -p %{pcs_bundled_dir}/src
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 PYTHON=%{__python3}
make all
%install
rm -rf $RPM_BUILD_ROOT
pwd
%make_install
# build web ui and put it to pcsd
make -C %{pcsd_public_dir}/%{ui_src_name} build
mv %{pcsd_public_dir}/%{ui_src_name}/build pcsd/public/ui
make -C %{pcsd_public_dir}/%{ui_src_name} build BUILD_USE_EXISTING_NODE_MODULES=true
mv %{pcsd_public_dir}/%{ui_src_name}/build ${RPM_BUILD_ROOT}%{_libdir}/%{pcsd_public_dir}/ui
rm -r %{pcsd_public_dir}/%{ui_src_name}
# main pcs install
%make_install \
PREFIX=%{_prefix} \
SYSTEMD_UNIT_DIR=%{_unitdir} \
LIB_DIR=%{pcs_libdir} \
PYTHON=%{__python3} \
PYTHON_SITELIB=%{python3_sitelib} \
BASH_COMPLETION_DIR=%{_datadir}/bash-completion/completions \
BUNDLE_PYAGENTX_SRC_DIR=`readlink -f %{bundled_src_dir}/pyagentx` \
BUNDLE_DACITE_SRC_DIR=`readlink -f %{bundled_src_dir}/dacite` \
BUILD_GEMS=false \
SYSTEMCTL_OVERRIDE=true \
hdrdir="%{_includedir}" \
rubyhdrdir="%{_includedir}" \
includedir="%{_includedir}"
# symlink favicon into pcsd directories
ln -fs /etc/favicon.png ${RPM_BUILD_ROOT}%{_libdir}/%{pcsd_public_dir}/images/favicon.png
# 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
# We are not building debug package for pcs but we need to add MiniDebuginfo
# to the bundled shared libraries from rubygem extensions in order to satisfy
# rpmdiff's binary stripping checker.
# Therefore we call find-debuginfo.sh script manually in order to strip
# binaries and add MiniDebugInfo with .gnu_debugdata section
/usr/lib/rpm/find-debuginfo.sh -j2 -m -i -S debugsourcefiles.list
# find-debuginfo.sh generated some files into /usr/lib/debug and
# /usr/src/debug/ that we don't want in the package
rm -rf $RPM_BUILD_ROOT%{_libdir}/debug
rm -rf $RPM_BUILD_ROOT/usr/lib/debug
rm -rf $RPM_BUILD_ROOT%{_prefix}/src/debug
%check
# In the building environment LC_CTYPE is set to C which causes tests to fail
@ -283,20 +310,17 @@ run_all_tests(){
# disabled tests:
#
BUNDLED_LIB_LOCATION=$RPM_BUILD_ROOT%{pcs_libdir}/pcs/bundled/packages \
%{__python3} pcs_test/suite.py --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 \
%{__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 \
test_result_python=$?
#run pcsd tests and remove them
pcsd_dir=$RPM_BUILD_ROOT%{pcs_libdir}/pcsd
# GEM_HOME is not needed anymore since all required gems are in fedora
ruby \
-I${pcsd_dir} \
-I${pcsd_dir}/test \
${pcsd_dir}/test/test_all_suite.rb
GEM_HOME=$RPM_BUILD_ROOT%{_libdir}/%{rubygem_bundle_dir} ruby \
-I$RPM_BUILD_ROOT%{_libdir}/pcsd \
-Ipcsd/test \
pcsd/test/test_all_suite.rb
test_result_ruby=$?
if [ $test_result_python -ne 0 ]; then
@ -306,12 +330,8 @@ run_all_tests(){
}
remove_all_tests() {
pcsd_dir=$RPM_BUILD_ROOT%{pcs_libdir}/pcsd
#remove pcsd tests, we do not distribute them in the rpm
rm -r -v ${pcsd_dir}/test
# remove javascript testing files
rm -r -v ${pcsd_dir}/public/js/dev
rm -r -v $RPM_BUILD_ROOT%{_libdir}/%{pcsd_public_dir}/js/dev
}
run_all_tests
@ -324,6 +344,7 @@ remove_all_tests
%{_bindir}/systemctl daemon-reload
%{_bindir}/systemctl try-restart pcsd.service
%post
%systemd_post pcsd.service
%systemd_post pcsd-ruby.service
@ -351,18 +372,16 @@ remove_all_tests
%doc dacite_README.md
%license dacite_LICENSE
%license COPYING
%{python3_sitelib}/pcs
%{python3_sitelib}/pcs-%{version}-py3.*.egg-info
%{python3_sitelib}/*
%{_sbindir}/pcs
%{_sbindir}/pcsd
%{pcs_libdir}/pcs/pcs_internal
%{pcs_libdir}/pcsd/*
%{pcs_libdir}/pcs/bundled/packages/dacite*
%{_libdir}/pcs/*
%{_libdir}/pcsd/*
%{_unitdir}/pcsd.service
%{_unitdir}/pcsd-ruby.service
%{_datadir}/bash-completion/completions/pcs
%{_sharedstatedir}/pcsd
%{_sysconfdir}/pam.d/pcsd
%config(noreplace) %{_sysconfdir}/pam.d/pcsd
%dir %{_var}/log/pcsd
%config(noreplace) %{_sysconfdir}/logrotate.d/pcsd
%config(noreplace) %{_sysconfdir}/sysconfig/pcsd
@ -375,22 +394,13 @@ remove_all_tests
%ghost %config(noreplace) %attr(0644,root,root) %{_sharedstatedir}/pcsd/pcs_users.conf
%{_mandir}/man8/pcs.*
%{_mandir}/man8/pcsd.*
%exclude %{pcs_libdir}/pcsd/*.debian
%exclude %{pcs_libdir}/pcsd/Gemfile
%exclude %{pcs_libdir}/pcsd/Gemfile.lock
%exclude %{pcs_libdir}/pcsd/Makefile
%exclude %{pcs_libdir}/pcsd/pcsd.conf
%exclude %{pcs_libdir}/pcsd/pcsd.service
%exclude %{pcs_libdir}/pcsd/pcsd-ruby.service
%exclude %{pcs_libdir}/pcsd/pcsd.8
%exclude %{pcs_libdir}/pcsd/public/js/dev/*
%exclude %{python3_sitelib}/pcs/bash_completion
%exclude %{python3_sitelib}/pcs/pcs.8
%exclude %{python3_sitelib}/pcs/pcs
%exclude %{_libdir}/pcs/pcs_snmp_agent
%exclude %{_libdir}/pcs/%{pcs_bundled_dir}/packages/pyagentx*
%files -n %{pcs_snmp_pkg_name}
%{pcs_libdir}/pcs/pcs_snmp_agent
%{pcs_libdir}/pcs/bundled/packages/pyagentx*
%{_libdir}/pcs/pcs_snmp_agent
%{_libdir}/pcs/%{pcs_bundled_dir}/packages/pyagentx*
%{_unitdir}/pcs_snmp_agent.service
%{_datadir}/snmp/mibs/PCMK-PCS*-MIB.txt
%{_mandir}/man8/pcs_snmp_agent.*
@ -402,6 +412,14 @@ remove_all_tests
%license pyagentx_LICENSE.txt
%changelog
* Wed Oct 06 2021 Miroslav Lisik <mlisik@redhat.com> - 0.10.11-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
* Tue Aug 17 2021 Miroslav Lisik <mlisik@redhat.com> - 0.10.9-1
- Rebased to latest upstream sources (see CHANGELOG.md)
- Updated pcs-web-ui
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

View file

@ -1,5 +1,5 @@
SHA512 (pyagentx-0.4.pcs.2.tar.gz) = d4194fec9a3e5fefe3793d49b7fec1feafef294c7e613a06046c2993daeefc5cb39d7c5b2b402ff83e49b2d976953f862264288c758c0be09d997b5323cc558a
SHA512 (dacite-1.6.0.tar.gz) = 034255f095589d309fe5805413d8b148f430cd20a0de305b7954083b530d516da1d8f3f00ebb5264a8cfb77f2b2a76f1e2d863e78bd191f1d85021c5553815da
SHA512 (pcs-0.10.8.tar.gz) = 8b9ba62279431e481d062e804d24480d2a274d2f4897a82149df6116ff3df2394d97a3ee77a6dee4c563d915bab0142124a8942524fcc4e894912086e865353c
SHA512 (pcs-web-ui-0.1.5.tar.gz) = ec4adf8ca5858c1f1f82e8f58e36864805bedc6dc10674fab83498aff5422a0497703ecd96fda17b4c1f6beffa64fe5a80a82fb4f75b2102fe1a4753a5d057e9
SHA512 (pcs-web-ui-node-modules-0.1.5.tar.xz) = cf1ef7e9280e7a0e864407e15f33edb98dce72e93d6917b74d5833ba184be248d87f6f309a2667bb2cbba0f33d1afde6a706832473505df87ed65835512da82c
SHA512 (pcs-0.10.11.tar.gz) = 220dcba99c479a6a7c6d35c7a4c04e46a336c0ff6454da997560c1e9c8fd39f41d16cbcc247502baa9508ac7e6a4cf7357f4d5bfccafc3d36164dbc7334877a4
SHA512 (pcs-web-ui-0.1.9.tar.gz) = 6572c9afcc31cac4be89e474e6abb31f0e21ebbc4ebf6cbcff4d391496003b8abbfb44e99752447741b3ca8bab551d55ddd442a7ead94fa44240f9879776fc60
SHA512 (pcs-web-ui-node-modules-0.1.9.tar.xz) = de1adaeb0c6e93f9487ccfa20f6c517d71d0a3d40ede98c09dac2fa4d7f3f1e58eb4d47b598b56e4d07ace5faf157229c53878e095eb0d11806dfa539e90261d

View file

@ -18,7 +18,7 @@
- name: Start pcsd
systemd:
state: started
name: pcsd.service
name: pcsd
daemon_reload: yes
roles:
@ -30,16 +30,25 @@
- automake
- make
- rpm-build
- git
- ruby-devel
- git-core
- booth-site
- fence-agents-apc
- fence-agents-ipmilan
- fence-agents-scsi
- fence-virt
- fontconfig
- openssl
- pcs
- pcs-snmp
- python3-pip
- python3-setuptools_scm
- python3-wheel
- rubygem-json
- rubygem-test-unit
- wget
required_services:
- pcsd.service
- pcsd
tests:
# dir: . -> dot means tests dir in distgit
- prepare-source:
@ -48,15 +57,18 @@
- flatten-source:
dir: ./
run: shopt -s dotglob; mv {{tenv_workdir}}/source/*/* {{tenv_workdir}}/source
- build_sources:
dir: ./source
run: "export PYTHONPATH=/usr/lib64/pcs/pcs_bundled/packages/; export GEM_HOME=/usr/lib64/pcsd/vendor/bundle/; ./autogen.sh && ./configure"
- remove_sources:
dir: ./source
run: rm -rfv pcs
- run_upstream_tier0_tests:
dir: ./source
run: pcs_test/suite.py --tier0 -v --vanilla --installed
run: pcs_test/suite --tier0 -v --vanilla --installed
- run_upstream_tier1_tests:
dir: ./source
run: pcs_test/suite.py --tier1 -v --vanilla --installed
run: pcs_test/suite --tier1 -v --vanilla --installed
- run_smoke_tests:
dir: ./source
run: pcs_test/smoke.sh