From 8690330928a569dac4e190a76dfb9ec969c0b9cb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 15 May 2017 15:32:35 +0200 Subject: sync with Fedora --- .gitignore | 7 +++++ composer.json | 28 ++++++++++++++++++++ php-guzzlehttp-streams.spec | 62 ++++++++++++++++++++------------------------- 3 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 .gitignore create mode 100644 composer.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..6d70343 --- /dev/null +++ b/composer.json @@ -0,0 +1,28 @@ +{ + "name": "guzzlehttp/streams", + "description": "Provides a simple abstraction over streams of data", + "homepage": "http://guzzlephp.org/", + "keywords": ["stream", "guzzle"], + "license": "MIT", + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "autoload": { + "psr-4": { "GuzzleHttp\\Stream\\": "src/" } + }, + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + } +} diff --git a/php-guzzlehttp-streams.spec b/php-guzzlehttp-streams.spec index 1a2bf6f..64ba0ab 100644 --- a/php-guzzlehttp-streams.spec +++ b/php-guzzlehttp-streams.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-guzzlehttp-streams # -# Copyright (c) 2014-2015 Shawn Iwinski +# Copyright (c) 2014-2017 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -28,7 +28,7 @@ Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 6%{?github_release}%{?dist} +Release: 9%{?github_release}%{?dist} Summary: Provides a simple abstraction over streams of data Group: Development/Libraries @@ -41,7 +41,6 @@ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{githu # https://github.com/guzzle/streams/commit/ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch Patch0: %{name}-ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests %if %{with_tests} @@ -53,7 +52,7 @@ BuildRequires: php-hash BuildRequires: php-spl BuildRequires: php-zlib ## Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json @@ -62,71 +61,61 @@ Requires: php(language) >= %{php_min_ver} Requires: php-hash Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %description %{summary}. +Autoloader: %{phpdir}/GuzzleHttp/Stream/autoload.php + %prep %setup -qn %{github_name}-%{github_commit} %patch0 -p1 -b .ad4c07ea55d02789a65ae75f6e4a9ee2cb9dab3f + +%build + : Create autoloader cat <<'AUTOLOAD' | tee src/autoload.php register(); -} - -$fedoraClassLoader->addPrefix('GuzzleHttp\\Stream\\', dirname(dirname(__DIR__))); - -return $fedoraClassLoader; +\Fedora\Autoloader\Autoload::addPsr4('GuzzleHttp\\Stream\\', __DIR__); AUTOLOAD -%build -# Empty build section, nothing required - - %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{phpdir}/GuzzleHttp/Stream cp -pr src/* %{buildroot}%{phpdir}/GuzzleHttp/Stream/ %check %if %{with_tests} -%{_bindir}/phpunit --verbose \ - --bootstrap %{buildroot}%{phpdir}/GuzzleHttp/Stream/autoload.php +: Upstream tests +RETURN_CODE=0 +PHPUNIT=$(which phpunit) +for PHP_EXEC in "" %{?rhel:php55} php56 php70 php71 php72; do + if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then + $PHP_EXEC $PHPUNIT --verbose \ + --bootstrap %{buildroot}%{phpdir}/GuzzleHttp/Stream/autoload.php \ + || RETURN_CODE=1 + fi +done +exit $RETURN_CODE %else : Tests skipped %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.rst @@ -136,6 +125,11 @@ rm -rf %{buildroot} %changelog +* Sun May 14 2017 Shawn Iwinski - 3.0.0-9 +- Switch autoloader to php-composer(fedora/autoloader) +- Add max versions to build dependencies +- Test with SCLs if available + * Tue Sep 22 2015 Shawn Iwinski - 3.0.0-6 - Minor cleanups -- cgit