From 46297d447b787f8ae35c1da68d2cb433d28beea5 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 10 May 2017 16:45:06 +0200 Subject: sync with fedora --- .gitignore | 7 +++++++ php-di-invoker.spec | 57 +++++++++++++++-------------------------------------- 2 files changed, 23 insertions(+), 41 deletions(-) create mode 100644 .gitignore 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-di-invoker.spec b/php-di-invoker.spec index 87e8ae6..0a46ab8 100644 --- a/php-di-invoker.spec +++ b/php-di-invoker.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-di-invoker # -# Copyright (c) 2016 Shawn Iwinski +# Copyright (c) 2016-2017 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -29,7 +29,7 @@ Name: %{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 1%{?github_release}%{?dist} +Release: 3%{?github_release}%{?dist} Summary: Generic and extensible callable invoker Group: Development/Libraries @@ -41,7 +41,6 @@ URL: https://github.com/%{github_owner}/%{github_name} Source0: %{name}-%{github_version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests %if %{with_tests} @@ -52,7 +51,7 @@ BuildRequires: php-composer(phpunit/phpunit) BuildRequires: php(language) >= 5.3.0 BuildRequires: php-reflection ## Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json @@ -62,7 +61,7 @@ Requires: php-composer(container-interop/container-interop) < %{container_ Requires: php(language) >= 5.3.0 Requires: php-reflection # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT} Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release} @@ -87,73 +86,46 @@ cat <<'AUTOLOAD' | tee src/autoload.php * Autoloader for %{name} and its' dependencies * (created by %{name}-%{version}-%{release}). * - * @return \Symfony\Component\ClassLoader\ClassLoader */ -if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { - if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { - require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php'; - } +require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} - -$fedoraClassLoader->addPrefix('Invoker\\', dirname(__DIR__)); +\Fedora\Autoloader\Autoload::addPsr4('Invoker\\', __DIR__); // Required dependency require_once '%{phpdir}/Interop/Container/autoload.php'; -return $fedoraClassLoader; AUTOLOAD %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{phpdir}/Invoker cp -rp src/* %{buildroot}%{phpdir}/Invoker/ %check %if %{with_tests} -: Make PSR-0 tests -mkdir -p tests-psr0/Invoker -ln -s ../../tests tests-psr0/Invoker/Test - : Create tests bootstrap cat <<'BOOTSTRAP' | tee bootstrap.php addPrefix('Invoker\\Test\\', __DIR__.'/tests-psr0'); +require_once '%{buildroot}%{phpdir}/Invoker/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Invoker\\Test\\', __DIR__.'/tests'); BOOTSTRAP : Run tests -run=0 ret=0 -if which php56; then - php56 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1 - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1 - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --verbose --bootstrap bootstrap.php -fi +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose --bootstrap bootstrap.php || ret=1 + fi +done exit $ret %else : Tests skipped %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md @@ -162,6 +134,9 @@ rm -rf %{buildroot} %changelog +* Wed May 10 2017 Valentin Collet - 1.3.3-3 +- Switch to fedora/autoloader + * Sat Jul 23 2016 Shawn Iwinski - 1.3.3-1 - Updated to 1.3.3 (RHBZ #1341396) -- cgit