diff options
-rw-r--r-- | composer.json | 3 | ||||
-rw-r--r-- | php-solarium-autoload.php | 25 | ||||
-rw-r--r-- | php-solarium.spec | 38 |
3 files changed, 41 insertions, 25 deletions
diff --git a/composer.json b/composer.json index 538895c..1bcf8b7 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,9 @@ "zendframework/zendframework1": "~1.12", "satooshi/php-coveralls": "~1.0" }, + "suggest": { + "minimalcode/search": "Query builder compatible with Solarium, allows simplified solr-query handling" + }, "extra": { "branch-alias": { "dev-develop": "3.3.x-dev" diff --git a/php-solarium-autoload.php b/php-solarium-autoload.php index b5fede0..f3c802d 100644 --- a/php-solarium-autoload.php +++ b/php-solarium-autoload.php @@ -1,22 +1,13 @@ <?php /* Autoloader for solarium/solarium and its dependencies */ -$vendorDir = '/usr/share/php'; -// Use Symfony autoloader -if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { - if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { - require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php'; - } +require_once '/usr/share/php/Fedora/Autoloader/autoload.php'; - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} +\Fedora\Autoloader\Autoload::addPsr4('Solarium\\', __DIR__); +\Fedora\Autoloader\Dependencies::required(array( + array( + '/usr/share/php/Symfony/Component/autoload.php', + '/usr/share/php/Symfony/autoload.php', + ), +)); -$fedoraClassLoader->addPrefix('Solarium\\', dirname(__DIR__)); - -// dependencies -if (file_exists($vendorDir . '/Symfony/Component/autoload.php')) { - require_once $vendorDir . '/Symfony/Component/autoload.php'; -} else { - $fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir); -} diff --git a/php-solarium.spec b/php-solarium.spec index 151051c..8c2e176 100644 --- a/php-solarium.spec +++ b/php-solarium.spec @@ -6,7 +6,7 @@ # # Please, preserve the changelog entries # -%global gh_commit b945cbe4e8f96b639d82c4d1e2cae4ef3ab6fce5 +%global gh_commit 0acdb2838ae551fe87e4e334e449a468973839f2 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner solariumphp %global gh_project solarium @@ -14,7 +14,7 @@ Name: php-%{gh_project} Summary: Solarium PHP Solr client library -Version: 3.6.0 +Version: 3.7.0 Release: 1%{?dist} URL: http://www.solarium-project.org/ @@ -29,7 +29,7 @@ BuildArch: noarch # For tests BuildRequires: php(language) >= 5.3.2 BuildRequires: php-composer(symfony/event-dispatcher) > 2.3 -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) # From composer.json, "require-dev": { # "phpunit/phpunit": "~3.7", # "squizlabs/php_codesniffer": "~1.4", @@ -44,14 +44,20 @@ BuildRequires: php-composer(phpunit/phpunit) >= 3.7 Requires: php(language) >= 5.3.2 Requires: php-composer(symfony/event-dispatcher) > 2.3 Requires: php-composer(symfony/event-dispatcher) < 4 -# From phpcompatinfo report for version 3.4.1 +# From composer.json, "suggest": { +# "minimalcode/search": "Query builder compatible with Solarium, allows simplified solr-query handling" +%if 0%{?fedora}> 21 +Suggests: php-composer(minimalcode/search) +%endif +# From phpcompatinfo report for version 3.7.0 Requires: php-curl Requires: php-date Requires: php-json Requires: php-pcre Requires: php-spl +# php-http optional, and only v1 suppported. # For our autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) Provides: php-composer(solarium/solarium) = %{version} @@ -92,11 +98,22 @@ mkdir vendor ln -s %{buildroot}%{_datadir}/php/Solarium/autoload.php vendor/autoload.php : Run upstream test suite against installed library +# 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 - -if which php70; then - php70 %{_bindir}/phpunit --verbose +# remirepo:2 fi +exit $ret %else : Skip upstream test suite %endif @@ -111,6 +128,11 @@ fi %changelog +* Fri Oct 28 2016 Remi Collet <remi@fedoraproject.org> - 3.7.0-1 +- update to 3.7.0 +- add optional dependency on minimalcode/search +- switch from symfony/class-loader to fedora/autoloader + * Tue May 3 2016 Remi Collet <remi@fedoraproject.org> - 3.6.0-1 - update to 3.6.0 - allow symfony 3 |