From af332916f62f832f77773bbf8be903a2f7ab900d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 24 Feb 2020 09:07:25 +0100 Subject: v0.9.1 from Fedora --- php-EasyRdf.spec | 82 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 55 insertions(+), 27 deletions(-) (limited to 'php-EasyRdf.spec') diff --git a/php-EasyRdf.spec b/php-EasyRdf.spec index 617fa4a..6ea79da 100644 --- a/php-EasyRdf.spec +++ b/php-EasyRdf.spec @@ -2,12 +2,16 @@ # # Fedora spec file for php-EasyRdf # -# Copyright (c) 2013-2017 Shawn Iwinski +# Copyright (c) 2013-2020 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT # -# + +%global github_owner njh +%global github_name easyrdf +%global github_version 0.9.1 +%global github_commit acd09dfe0555fbcfa254291e433c45fdd4652566 %global composer_vendor easyrdf %global composer_project easyrdf @@ -35,18 +39,32 @@ %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-EasyRdf -Version: 0.9.0 -Release: 8%{?dist} +Version: 0.9.1 +Release: 1%{?dist} Summary: A PHP library designed to make it easy to consume and produce RDF -Group: Development/Libraries License: BSD URL: http://www.easyrdf.org -Source0: %{url}/downloads/easyrdf-%{version}.tar.gz + +# GitHub export does not include tests. +# Run php-EasyRdf-get-source.sh to create full source. +Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +Source1: %{name}-get-source.sh # Upstream patches +## Fix PHP 7.1 bug +## https://github.com/njh/easyrdf/commit/4ed264051ed407d59c2fde4128be176e96e8f22a +## https://github.com/njh/easyrdf/commit/4ed264051ed407d59c2fde4128be176e96e8f22a.patch Patch0: 4ed264051ed407d59c2fde4128be176e96e8f22a.patch +## Fix potential bugs and incomplete docs +## https://github.com/njh/easyrdf/commit/5eb5154fec8b3d3df666628ba2f3636c0fa385c3 +## https://github.com/njh/easyrdf/commit/5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch Patch1: 5eb5154fec8b3d3df666628ba2f3636c0fa385c3.patch +## Fix PHP 7.4 deprecation +## https://github.com/njh/easyrdf/commit/656a86feff97afaff2b1ff7dbc7cc696b66e8a06 +## https://github.com/njh/easyrdf/commit/656a86feff97afaff2b1ff7dbc7cc696b66e8a06.patch +## NOTE: Modified for un-namespaced version 0.9: `lib/ParsedUri.php` => `lib/EastRdf/ParsedUri.php` +Patch2: %{name}-fix-php-7-4.patch BuildArch: noarch # Tests @@ -60,7 +78,7 @@ BuildRequires: php-redland ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -## phpcompatinfo (computed from version 0.9.0) +## phpcompatinfo (computed from version 0.9.1) BuildRequires: php-ctype BuildRequires: php-date BuildRequires: php-dom @@ -78,7 +96,7 @@ BuildRequires: php-composer(fedora/autoloader) # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo requires (computed from version 0.9.0) +# phpcompatinfo requires (computed from version 0.9.1) Requires: php-ctype Requires: php-date Requires: php-dom @@ -131,16 +149,20 @@ Autoloader: %{phpdir}/EasyRdf/autoload.php %package doc Summary: Documentation for %{name} -Group: Documentation %description doc %{summary}. %prep -%setup -qn easyrdf-%{version} +%setup -qn %{github_name}-%{github_commit} + +# Fix PHP 7.1 bug %patch0 -p1 +# Fix potential bugs and incomplete docs %patch1 -p1 +# Fix PHP 7.4 deprecation +%patch2 -p1 %build @@ -164,12 +186,6 @@ cp -rp lib/* %{buildroot}%{phpdir}/ %check %if %{with_tests} -: Skip tests that sometimes cause timeout exceptions -sed -e 's/testSerialiseSvg/SKIP_testSerialiseSvg/' \ - -e 's/testSerialiseGif/SKIP_testSerialiseGif/' \ - -e 's/testSerialiseSvg/SKIP_testSerialisePng/' \ - -i test/EasyRdf/Serialiser/GraphVizTest.php - : Create PHPUnit config cat <<'PHPUNIT' | tee phpunit.xml @@ -184,23 +200,32 @@ cat <<'PHPUNIT' | tee phpunit.xml PHPUNIT +: Skip tests that sometimes cause timeout exceptions +sed -e 's/testSerialiseSvg/SKIP_testSerialiseSvg/' \ + -e 's/testSerialiseSvg/SKIP_testSerialisePng/' \ + -i test/EasyRdf/Serialiser/GraphVizTest.php + +%if 0%{?fedora} >= 31 +: Skip test known to fail on f31+ +sed 's/function testAddInvalidObject/function SKIP_testAddInvalidObject/' \ + -i test/EasyRdf/GraphTest.php \ + -i test/EasyRdf/ResourceTest.php +%endif + %if !%{redland_support} : No redland support rm -f test/EasyRdf/Parser/RedlandTest.php %endif : Upstream tests -%{_bindir}/phpunit --verbose - -: Upstream tests with SCLs if available -SCL_RETURN_CODE=0 -# Note: No php71 because of skipped tests above -for SCL in %{?rhel:php54 php55} php56 php70 php71 php72; do - if which $SCL; then - $SCL %{_bindir}/phpunit || SCL_RETURN_CODE=1 +RETURN_CODE=0 +PHPUNIT=$(which phpunit) +for PHP_EXEC in php php71 php72 php73 php74; do + if [ "php" == "$PHP_EXEC" ] || which $PHP_EXEC; then + $PHP_EXEC $PHPUNIT --verbose || RETURN_CODE=1 fi done -exit $SCL_RETURN_CODE +exit $RETURN_CODE %else : Tests skipped %endif @@ -212,17 +237,20 @@ exit $SCL_RETURN_CODE %doc CHANGELOG.md %doc README.md %doc composer.json -%doc doap.rdf %{phpdir}/EasyRdf.php %{phpdir}/EasyRdf %files doc -%defattr(-,root,root,-) %doc docs %doc examples %changelog +* Sat Feb 22 2020 Shawn Iwinski - 0.9.1-1 +- Update to 0.9.1 +- Switch source to GitHub as download from www.easyrdf.org is corrupt +- Fix FTBFS (RHBZ #1799864) + * Thu Nov 2 2017 Remi Collet - 0.9.0-8 - add upstream patch for PHP 7.1 - add upstream patch for PHP 7.2 -- cgit