From 2d1fd3a3c87d3467bb7d38f07552ba28babcc9c2 Mon Sep 17 00:00:00 2001 From: Shawn Iwinski Date: Wed, 5 Jul 2017 15:18:23 -0400 Subject: Add patch to fix version - Add check for version and run whether tests are skipped or not --- php-guzzlehttp-guzzle6-upstream-pull-1864.patch | 22 ++++++++++++++++ php-guzzlehttp-guzzle6.spec | 34 ++++++++++++++++++++----- 2 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 php-guzzlehttp-guzzle6-upstream-pull-1864.patch diff --git a/php-guzzlehttp-guzzle6-upstream-pull-1864.patch b/php-guzzlehttp-guzzle6-upstream-pull-1864.patch new file mode 100644 index 0000000..42fb35a --- /dev/null +++ b/php-guzzlehttp-guzzle6-upstream-pull-1864.patch @@ -0,0 +1,22 @@ +From 95f4deb816266e4ffac55beeb138caa4d42691fd Mon Sep 17 00:00:00 2001 +From: Shawn Iwinski +Date: Fri, 23 Jun 2017 18:01:13 -0400 +Subject: [PATCH] [ClientInterface] Fix VERSION for 6.3.0 release + +--- + src/ClientInterface.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ClientInterface.php b/src/ClientInterface.php +index 5a67b66bf..2050309de 100644 +--- a/src/ClientInterface.php ++++ b/src/ClientInterface.php +@@ -12,7 +12,7 @@ + */ + interface ClientInterface + { +- const VERSION = '6.2.1'; ++ const VERSION = '6.3.0'; + + /** + * Send an HTTP request. diff --git a/php-guzzlehttp-guzzle6.spec b/php-guzzlehttp-guzzle6.spec index e4c82c1..ff2891c 100644 --- a/php-guzzlehttp-guzzle6.spec +++ b/php-guzzlehttp-guzzle6.spec @@ -39,7 +39,7 @@ Name: php-%{composer_vendor}-%{composer_project}6 Version: %{github_version} -Release: 1%{?github_release}%{?dist} +Release: 2%{?github_release}%{?dist} Summary: PHP HTTP client library Group: Development/Libraries @@ -51,10 +51,14 @@ URL: http://guzzlephp.org Source0: %{name}-%{github_version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh +# [ClientInterface] Fix VERSION for 6.3.0 release +# https://github.com/guzzle/guzzle/pull/1864 +# https://github.com/guzzle/guzzle/pull/1864.patch +Patch0: %{name}-upstream-pull-1864.patch + BuildArch: noarch -# Tests -%if %{with_tests} -BuildRequires: nodejs +# Library version value and autoloader check +BuildRequires: php-cli ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(guzzlehttp/promises) >= %{promises_min_ver} @@ -64,6 +68,11 @@ BuildRequires: php-composer(guzzlehttp/psr7) < %{psr7_max_ver} BuildRequires: php-composer(phpunit/phpunit) BuildRequires: php-composer(psr/log) >= %{psr_log_min_ver} BuildRequires: php-composer(psr/log) < %{psr_log_max_ver} +## Autoloader +BuildRequires: php-composer(fedora/autoloader) +# Tests +%if %{with_tests} +BuildRequires: nodejs ## phpcompatinfo (computed from version 6.3.0) BuildRequires: php-curl BuildRequires: php-date @@ -74,8 +83,6 @@ BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl BuildRequires: php-zlib -## Autoloader -BuildRequires: php-composer(fedora/autoloader) %endif Requires: ca-certificates @@ -122,6 +129,9 @@ Autoloader: %{phpdir}/GuzzleHttp6/autoload.php %prep %setup -qn %{github_name}-%{github_commit} +: [ClientInterface] Fix VERSION for 6.3.0 release +%patch0 -p1 + %build : Create common autoloader @@ -150,6 +160,14 @@ cp -pr src %{buildroot}%{phpdir}/GuzzleHttp6 %check +: Library version value and autoloader check +%{_bindir}/php -r ' + require_once "%{buildroot}%{phpdir}/GuzzleHttp6/autoload.php"; + $version = \GuzzleHttp\ClientInterface::VERSION; + echo "Version $version (expected %{version})\n"; + exit(version_compare("%{version}", "$version", "=") ? 0 : 1); +' + %if %{with_tests} : Create mock Composer autoloader mkdir vendor @@ -186,6 +204,10 @@ exit $RETURN_CODE %changelog +* Wed Jul 05 2017 Shawn Iwinski - 6.3.0-2 +- Add patch to fix version +- Add check for version and run whether tests are skipped or not + * Fri Jun 23 2017 Shawn Iwinski - 6.3.0-1 - Update to 6.3.0 (RHBZ #1464283) - Remove patch -- cgit