From 6a223231c482deaad6dc3e5f8dc31847a5828b0a Mon Sep 17 00:00:00 2001 From: Shawn Iwinski Date: Thu, 21 Sep 2017 16:38:07 +0000 Subject: Add max versions to BuildRequires / Allow Symfony 3 / Modify tests --- php-goutte.spec | 48 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 16 deletions(-) (limited to 'php-goutte.spec') diff --git a/php-goutte.spec b/php-goutte.spec index 485fb49..d294bcf 100644 --- a/php-goutte.spec +++ b/php-goutte.spec @@ -37,7 +37,7 @@ Name: php-goutte Version: %{github_version} -Release: 1%{?github_release}%{?dist} +Release: 4%{?github_release}%{?dist} Summary: A simple PHP web scraper Group: Development/Libraries @@ -54,8 +54,11 @@ BuildRequires: php-composer(phpunit/phpunit) BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(guzzlehttp/guzzle) < %{guzzle_max_ver} BuildRequires: php-composer(guzzlehttp/guzzle) >= %{guzzle_min_ver} +BuildRequires: php-composer(symfony/browser-kit) < %{symfony_max_ver} BuildRequires: php-composer(symfony/browser-kit) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/css-selector) < %{symfony_max_ver} BuildRequires: php-composer(symfony/css-selector) >= %{symfony_min_ver} +BuildRequires: php-composer(symfony/dom-crawler) < %{symfony_max_ver} BuildRequires: php-composer(symfony/dom-crawler) >= %{symfony_min_ver} ## phpcompatinfo (computed from version 3.2.0) BuildRequires: php-reflection @@ -110,9 +113,18 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; \Fedora\Autoloader\Dependencies::required([ '%{phpdir}/GuzzleHttp6/autoload.php', - '%{phpdir}/Symfony/Component/BrowserKit/autoload.php', - '%{phpdir}/Symfony/Component/CssSelector/autoload.php', - '%{phpdir}/Symfony/Component/DomCrawler/autoload.php', + [ + '%{phpdir}/Symfony3/Component/BrowserKit/autoload.php', + '%{phpdir}/Symfony/Component/BrowserKit/autoload.php', + ], + [ + '%{phpdir}/Symfony3/Component/CssSelector/autoload.php', + '%{phpdir}/Symfony/Component/CssSelector/autoload.php', + ], + [ + '%{phpdir}/Symfony3/Component/DomCrawler/autoload.php', + '%{phpdir}/Symfony/Component/DomCrawler/autoload.php', + ], ]); AUTOLOAD @@ -126,18 +138,17 @@ cp -p Goutte/{autoload,Client}.php %{buildroot}/%{phpdir}/Goutte/ %check %if %{with_tests} -BOOTSTRAP=%{buildroot}/%{phpdir}/Goutte/autoload.php - -%{_bindir}/phpunit --verbose --bootstrap $BOOTSTRAP - -: Upstream tests with SCLs if available -SCL_RETURN_CODE=0 -for SCL in php56 php70 php71; do - if which $SCL; then - $SCL %{_bindir}/phpunit --verbose --bootstrap $BOOTSTRAP || SCL_RETURN_CODE=1 - fi -done -exit $SCL_RETURN_CODE +: Upstream tests +RETURN_CODE=0 +PHPUNIT=$(which phpunit) +for PHP_EXEC in "" php56 php70 php71 php72; do + if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then + $PHP_EXEC $PHPUNIT --verbose \ + --bootstrap %{buildroot}/%{phpdir}/Goutte/autoload.php \ + || RETURN_CODE=1 + fi + done +exit $RETURN_CODE %else : Tests skipped %endif @@ -157,6 +168,11 @@ rm -rf %{buildroot} %changelog +* Thu Sep 21 2017 Shawn Iwinski - 3.2.0-4 +- Add max versions to BuildRequires +- Allow Symfony 3 +- Modify tests + * Thu Jan 5 2017 Remi Collet - 3.2.1-1 - update to 3.2.1 -- cgit