Fedora 26 related fixes

This commit is contained in:
Tomas Jelinek 2017-05-19 13:31:35 +02:00
parent d9cf0440bb
commit beb8bbb8e0
5 changed files with 90 additions and 3 deletions

1
.gitignore vendored
View File

@ -41,3 +41,4 @@
/pcs-0.9.155.tar.gz
/pcs-0.9.156.tar.gz
/sinatra-1.4.8.gem
/tilt-2.0.6.gem

40
fix-test-2.patch Normal file
View File

@ -0,0 +1,40 @@
From 04bb882073f15148c4bd466fd7b1157fac7a5755 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Fri, 19 May 2017 15:28:21 +0200
Subject: [PATCH] fix tests
---
pcsd/test/test_config.rb | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/pcsd/test/test_config.rb b/pcsd/test/test_config.rb
index 755e35c2..bf75d2b9 100644
--- a/pcsd/test/test_config.rb
+++ b/pcsd/test/test_config.rb
@@ -122,17 +122,12 @@ class TestConfig < Test::Unit::TestCase
]
}'
cfg = PCSConfig.new(text)
- if JSON::VERSION_MAJOR >= 2
- parser_error = "Unable to parse pcs_settings file: 409: unexpected token at '\"rh71-node2\"\n ]\n }\n ]\n}'"
- else
- parser_error = "Unable to parse pcs_settings file: 399: unexpected token at '\"rh71-node2\"\n ]\n }\n ]\n}'"
- end
- assert_equal(
- [[
- 'error',
- parser_error
- ]],
- $logger.log
+ assert_equal(1, $logger.log.length)
+ assert_equal('error', $logger.log[0][0])
+ assert_match(
+ # the number is based on JSON gem version
+ /Unable to parse pcs_settings file: \d+: unexpected token/,
+ $logger.log[0][1]
)
assert_equal(fixture_empty_config, cfg.text)
end
--
2.11.0

View File

@ -1,6 +1,6 @@
Name: pcs
Version: 0.9.156
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2
URL: https://github.com/ClusterLabs/pcs
Group: System Environment/Base
@ -16,6 +16,7 @@ Source12: https://rubygems.org/downloads/rack-1.6.4.gem
Source13: https://rubygems.org/downloads/rpam-ruby19-1.2.1.gem
Source14: https://rubygems.org/downloads/sinatra-1.4.8.gem
Source15: https://rubygems.org/downloads/sinatra-contrib-1.4.7.gem
Source16: https://rubygems.org/downloads/tilt-2.0.6.gem
Patch0: fedfix.patch
Patch1: fix-test.patch
@ -23,6 +24,8 @@ Patch2: fix-libcurl-issues-in-python3.patch
Patch3: fix-linking-fonts-to-pcsd.patch
Patch4: bz1434111-01-web-UI-fixed-XSS-vulnerability-CVE-2017-2661.patch
Patch5: bz1428350-01-clufter.patch
Patch6: fix-test-2.patch
Patch7: readd-tilt.patch
# git for patches
BuildRequires: git
@ -50,7 +53,6 @@ BuildRequires: rubygem-multi_json
BuildRequires: rubygem-open4
BuildRequires: rubygem-rack-protection
BuildRequires: rubygem-rack-test
BuildRequires: rubygem-tilt
# ruby libraries for tests
BuildRequires: rubygem-test-unit
# pam devel for compiling rubygem-rpam-ruby19
@ -86,7 +88,6 @@ Requires: rubygem-multi_json
Requires: rubygem-open4
Requires: rubygem-rack-protection
Requires: rubygem-rack-test
Requires: rubygem-tilt
# pcsd fonts
Requires: liberation-sans-fonts
Requires: overpass-fonts
@ -112,6 +113,7 @@ Provides: bundled(rubygem-rpam-ruby19) = 1.2.1
# doesn't work with rack 1.6.4
Provides: bundled(rubygem-sinatra) = 1.4.8
Provides: bundled(rubygem-sinatra-contrib) = 1.4.7
Provides: bundled(rubygem-tilt) = 2.0.6
%description
pcs is a corosync and pacemaker configuration tool. It permits users to
@ -147,6 +149,10 @@ UpdateTimestamps -p1 %{PATCH3}
UpdateTimestamps -p1 %{PATCH4}
%patch5 -p1
UpdateTimestamps -p1 %{PATCH5}
%patch6 -p1
UpdateTimestamps -p1 %{PATCH6}
%patch7 -p1
UpdateTimestamps -p1 %{PATCH7}
mkdir -p pcsd/.bundle
cp -f %SOURCE1 pcsd/.bundle/config
@ -157,6 +163,7 @@ cp -f %SOURCE12 pcsd/vendor/cache
cp -f %SOURCE13 pcsd/vendor/cache
cp -f %SOURCE14 pcsd/vendor/cache
cp -f %SOURCE15 pcsd/vendor/cache
cp -f %SOURCE16 pcsd/vendor/cache
#ruby gems copied
%build
@ -182,6 +189,16 @@ make install_pcsd \
rm -r -v $RPM_BUILD_ROOT%{PCS_PREFIX}/lib/pcsd/vendor/cache
%check
# 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.
# On the live system either UTF8 locale is set or the warning is emmited
# which breaks pcs. That is the correct behavior since with wrong locales it
# would be probably broken anyway.
# The main concern here is to make the tests pass.
# See https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale for details.
export PYTHONCOERCECLOCALE=0
run_all_tests(){
#prepare environmet for tests
sitelib=$RPM_BUILD_ROOT%{python3_sitelib}
@ -285,6 +302,10 @@ end
%exclude %{python3_sitelib}/pcs/pcs
%changelog
* Tue May 23 2017 Tomas Jelinek <tojeline@redhat.com> - 0.9.156-3
- Fixed python locales issue preventing build-time tests to pass
- Bundle rubygem-tilt which is being retired from Fedora
* Thu Mar 23 2017 Tomas Jelinek <tojeline@redhat.com> - 0.9.156-2
- Fixed Cross-site scripting (XSS) vulnerability in web UI CVE-2017-2661
- Re-added support for clufter as it is now available for Python 3

24
readd-tilt.patch Normal file
View File

@ -0,0 +1,24 @@
From 92664dedc2d4cd6944b6a6967d5b79057e1f34c3 Mon Sep 17 00:00:00 2001
From: Tomas Jelinek <tojeline@redhat.com>
Date: Fri, 19 May 2017 16:06:39 +0200
Subject: [PATCH 2/2] readd tilt rubygem which is now orphaned in fedora
---
pcsd/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/pcsd/Makefile b/pcsd/Makefile
index ad21cb3d..24ce1fe8 100644
--- a/pcsd/Makefile
+++ b/pcsd/Makefile
@@ -6,6 +6,7 @@ build_gems:
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.6.gem \
-- '--with-ldflags="-Wl,-z,now -Wl,-z,relro"'
get_gems:
--
2.11.0

View File

@ -5,3 +5,4 @@ SHA512 (rack-1.6.4.gem) = 304a6ae21bfd38008fd7d147f82c44397f3a1d2e689bd01de689ae
SHA512 (rpam-ruby19-1.2.1.gem) = b403964295e96a6247289518ff46e59bbae6c78bcfb647e12b7dbb247698642b4a1ee04492521b782fb3c594c2ede8143c765819fecde087e2ec850e3aea3503
SHA512 (sinatra-1.4.8.gem) = e56a5a6d7ceb0be4bc537feb6ada2956f1fd64b452dee347b259837aa02041dfa53d9808531cdd0a02a91093ba92f7c505c39f0dd990dfbc6e872681f40bc5e9
SHA512 (sinatra-contrib-1.4.7.gem) = dbb4deaed6844a70352e4fbe0f7b71d000acd525a3f6a20c2dc66d3ddc87b93a3b9c33ac315a0a5f4e30b82631c14196fefc9b6fe29c0aee29ea6db4d000361c
SHA512 (tilt-2.0.6.gem) = 173245f5edd8cf2d31edccd36d375530448e58da1fd744bdf471818ee9b306317f52ecfb9aa8c39ec7746ea3900e600ebfc5f96dfa66724d3e8a4386bd9da260