From c7ad391bad32192268df9890b5bea8663c4aabe8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 10 May 2017 16:20:41 +0200 Subject: switch to fedora/autoloader --- php-JsonSchema.spec | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'php-JsonSchema.spec') diff --git a/php-JsonSchema.spec b/php-JsonSchema.spec index 3cdbe43..4034f48 100644 --- a/php-JsonSchema.spec +++ b/php-JsonSchema.spec @@ -29,7 +29,7 @@ Name: php-%{lib_name} Version: %{github_version} -Release: 4%{?dist} +Release: 6%{?dist} Summary: PHP implementation of JSON schema Group: Development/Libraries @@ -45,7 +45,6 @@ Source2: %{name}-makesrc.sh # https://github.com/justinrainbow/json-schema/pull/292 Patch0: %{name}-pr292.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch %if %{with_tests} # For tests @@ -61,7 +60,7 @@ BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl # Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif Requires: php(language) >= %{php_min_ver} @@ -77,7 +76,7 @@ Requires: php-mbstring Requires: php-pcre Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(justinrainbow/json-schema) = %{version} @@ -100,7 +99,14 @@ See http://json-schema.org for more details. %setup -qn %{github_name}-%{github_commit} %patch0 -p1 -cp -p %{SOURCE1} src/%{lib_name}/autoload.php +: Create autoloader +cat <<'AUTOLOAD' | tee src/%{lib_name}/autoload.php +addPrefix('%{lib_name}\\Tests\\', realpath(__DIR__.'/../tests')); +\Fedora\Autoloader\Autoload::addPsr4('JsonSchema\\Tests\\', __DIR__.'/../tests/JsonSchema/Tests'); EOF -# remirepo:11 -run=0 ret=0 -if which php56; then - php56 %{_bindir}/phpunit || ret=1 - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit || ret=1 - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --verbose -# remirepo:2 -fi +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose || ret=1 + fi +done exit $ret %else : Tests skipped @@ -152,7 +149,6 @@ exit $ret %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc README.md composer.json @@ -163,6 +159,10 @@ exit $ret %changelog +* Wed May 10 2017 Remi Collet - 1.6.1-6 +- switch to fedora/autoloader +- run test suite against PHP SCLs when available + * Thu Jul 21 2016 Remi Collet - 1.6.1-4 - fix failed test, FTBFS detected by Koschei open https://github.com/justinrainbow/json-schema/pull/292 -- cgit