From 2b5e6dce1719ef774d9d98b0ed26eddfe5812384 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 31 Oct 2016 14:35:14 +0100 Subject: php-sebastian-resource-operations: fedora autoloader --- composer.json | 26 ++++++++++++++++++++++++++ php-sebastian-resource-operations.spec | 34 ++++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..da495d6 --- /dev/null +++ b/composer.json @@ -0,0 +1,26 @@ +{ + "name": "sebastian/resource-operations", + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "require": { + "php": ">=5.6.0" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} + diff --git a/php-sebastian-resource-operations.spec b/php-sebastian-resource-operations.spec index 08fb3e1..9b081ed 100644 --- a/php-sebastian-resource-operations.spec +++ b/php-sebastian-resource-operations.spec @@ -23,7 +23,7 @@ Name: php-sebastian-resource-operations Version: 1.0.0 -%global specrel 1 +%global specrel 2 Release: %{?gh_date:0.%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist} Summary: Provides a list of PHP built-in functions that operate on resources @@ -38,7 +38,7 @@ Source1: https://raw.githubusercontent.com/remicollet/resource-operations BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php(language) >= 5.6 -BuildRequires: %{_bindir}/phpab +BuildRequires: php-fedora-autoloader-devel %if %{with_tests} BuildRequires: %{_bindir}/phpunit %endif @@ -46,6 +46,8 @@ BuildRequires: %{_bindir}/phpunit # from composer.json # "php": ">=5.6.0" Requires: php(language) >= 5.6 +# Autoloader +Requires: php-composer(fedora/autoloader) # from phpcompatinfo report for version 1.0.0: nothing Provides: php-composer(sebastian/resource-operations) = %{version} @@ -64,7 +66,7 @@ cp %{SOURCE1} tests/ %build # Generate the Autoloader -phpab --output src/autoload.php src +phpab --template fedora --output src/autoload.php src %install @@ -75,9 +77,26 @@ cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project} %check %if %{with_tests} -%{_bindir}/php -d include_path=.:%{buildroot}%{php_home}:%{php_home} \ -%{_bindir}/phpunit --bootstrap %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php tests -: No test suite +: Run upstream test suite +# remirepo:13 +run=0 +ret=0 +if which php56; then + php56 -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ + %{_bindir}/phpunit --bootstrap %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php tests || ret=1 + run=1 +fi +if which php71; then + php71 -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ + %{_bindir}/phpunit --bootstrap %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php tests || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then +%{_bindir}/php -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ +%{_bindir}/phpunit --bootstrap %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php tests --verbose +# remirepo:2 +fi +exit $ret %else : bootstrap build with test suite disabled %endif @@ -97,6 +116,9 @@ rm -rf %{buildroot} %changelog +* Mon Oct 31 2016 Remi Collet - 1.0.0-2 +- switch to fedora/autoloader + * Fri Oct 2 2015 Remi Collet - 1.0.0-1 - Update to 1.0.0 (no change) -- cgit