diff --git a/php-sabre-http-autoload.php b/php-sabre-http-autoload.php index 898fded..f305e1a 100644 --- a/php-sabre-http-autoload.php +++ b/php-sabre-http-autoload.php @@ -1,26 +1,15 @@ register(); -} - -$fedoraClassLoader->addPrefix('Sabre\\HTTP\\', dirname(dirname(__DIR__))); +\Fedora\Autoloader\Autoload::addPsr4('Sabre\\HTTP\\', __DIR__); // Functions require_once __DIR__ . '/functions.php'; -// dependencies -require_once $vendorDir . '/Sabre/Event/autoload.php'; -require_once $vendorDir . '/Sabre/Uri/autoload.php'; +\Fedora\Autoloader\Dependencies::required(array( + '/usr/share/php/Sabre/Event/autoload.php', + '/usr/share/php/Sabre/Uri/autoload.php', +)); diff --git a/php-sabre-http.spec b/php-sabre-http.spec index 9b7e578..8803b36 100644 --- a/php-sabre-http.spec +++ b/php-sabre-http.spec @@ -1,6 +1,6 @@ # remirepo/fedora spec file for php-sabre-http # -# Copyright (c) 2013-2015 Remi Collet +# Copyright (c) 2013-2016 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -16,7 +16,7 @@ Name: php-%{gh_project} Summary: Library for dealing with http requests and responses Version: 4.2.1 -Release: 1%{?dist} +Release: 2%{?dist} URL: https://github.com/%{gh_owner}/%{gh_project} License: BSD @@ -39,7 +39,7 @@ BuildRequires: php-pcre BuildRequires: php-spl BuildRequires: php-xml # Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) BuildRequires: php-composer(sabre/event) >= 2.0.2 %endif @@ -65,7 +65,7 @@ Requires: php-pcre Requires: php-spl Requires: php-xml # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Requires: php-composer(sabre/event) >= 2.0.2 # Was split from php-sabre-dav in version 1.9 @@ -97,6 +97,8 @@ For output: What this library provides, is a Request object, and a Response object. The objects are extendable and easily mockable. +Autoloader: %{_datadir}/php/Sabre/HTTP/autoload.php + %prep %setup -q -n %{gh_project}-%{gh_commit} @@ -109,6 +111,7 @@ cp %{SOURCE1} lib/autoload.php %install + # Install as a PSR-0 library mkdir -p %{buildroot}%{_datadir}/php/Sabre cp -pr lib %{buildroot}%{_datadir}/php/Sabre/HTTP @@ -116,17 +119,11 @@ cp -pr lib %{buildroot}%{_datadir}/php/Sabre/HTTP %check %if %{with_tests} -: Run upstream test suite against installed library cd tests +: Run upstream test suite against installed library %{_bindir}/phpunit \ --bootstrap=%{buildroot}%{_datadir}/php/Sabre/HTTP/autoload.php \ --verbose - -if which php70; then - php70 %{_bindir}/phpunit \ - --bootstrap=%{buildroot}%{_datadir}/php/Sabre/HTTP/autoload.php \ - --verbose -fi %else : Skip upstream test suite %endif @@ -141,6 +138,9 @@ fi %changelog +* Sat Oct 29 2016 Remi Collet - 4.2.1-2 +- switch from symfony/class-loader to fedora/autoloader + * Fri Mar 11 2016 Remi Collet - 4.2.1-1 - update to 4.2.1 - add dependency on sabre/uri