diff options
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | php-JsonSchema.spec | 42 |
2 files changed, 28 insertions, 21 deletions
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/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 +<?php +/* Autoloader for %{name} and its' dependencies */ + +require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('JsonSchema\\', __DIR__); +AUTOLOAD %build @@ -127,24 +133,15 @@ mkdir vendor cat << 'EOF' | tee vendor/autoload.php <?php require '%{buildroot}%{phpdir}/%{lib_name}/autoload.php'; -$fedoraClassLoader->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 <remi@remirepo.net> - 1.6.1-6 +- switch to fedora/autoloader +- run test suite against PHP SCLs when available + * Thu Jul 21 2016 Remi Collet <remi@fedoraproject.org> - 1.6.1-4 - fix failed test, FTBFS detected by Koschei open https://github.com/justinrainbow/json-schema/pull/292 |