# remirepo spec for php-behat-mink, from Fedora: # # Fedora spec file for php-behat-mink # # Copyright (c) 2015-2020 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT # # Please preserve changelog entries # %global github_owner minkphp %global github_name Mink %global github_version 1.8.1 %global github_commit 07c6a9fe3fa98c2de074b25d9ed26c22904e3887 %global composer_vendor behat %global composer_project mink %global testsuite_github_owner minkphp %global testsuite_github_name driver-testsuite %global testsuite_github_commit 9ce01154e5331640d2a4f2b9791baf19bb0f4a5d %if 0%{?fedora} >= 32 || 0%{?rhel} >= 8 %global with_symfony2 0 %else %global with_symfony2 1 %endif # "php": ">=5.3.1" %global php_min_ver 5.3.1 # "symfony/css-selector": "^2.7|^3.0|^4.0|^5.0" %if %{with_symfony2} # NOTE: Min version not 2.7 because autoloader required %global symfony_min_ver 2.7.1 %else %global symfony_min_ver 3.0 %endif %global symfony_max_ver 6.0 # PHPUnit %if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 %global phpunit_require phpunit7 %global phpunit_exec phpunit7 %else %global phpunit_require php-composer(phpunit/phpunit) %global phpunit_exec phpunit %endif # Build using "--without tests" to disable tests %global with_tests 0%{!?_without_tests:1} # Range dependencies supported? %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 %global with_range_dependencies 1 %else %global with_range_dependencies 0 %endif %{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} Release: 1%{?dist} Summary: Browser controller/emulator abstraction for PHP License: MIT URL: http://mink.behat.org/ # GitHub export does not include tests # Run php-behat-mink-get-source.sh to create full source Source0: %{name}-%{github_version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh # Test suite Source2: https://github.com/%{testsuite_github_owner}/%{testsuite_github_name}/archive/%{testsuite_github_commit}/%{name}-testsuite-%{testsuite_github_commit}.tar.gz BuildArch: noarch # Tests %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: %{phpunit_require} %if %{with_range_dependencies} BuildRequires: (php-composer(symfony/css-selector) >= %{symfony_min_ver} with php-composer(symfony/css-selector) < %{symfony_max_ver}) %else BuildRequires: php-composer(symfony/css-selector) < %{symfony_max_ver} BuildRequires: php-composer(symfony/css-selector) >= %{symfony_min_ver} %endif ## phpcompatinfo (computed from version 1.8.1) BuildRequires: php-dom BuildRequires: php-mbstring BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl ### Test suite (computed from commit 9ce01154e5331640d2a4f2b9791baf19bb0f4a5d) BuildRequires: php-date BuildRequires: php-gd BuildRequires: php-json BuildRequires: php-session ## Autoloader BuildRequires: php-composer(fedora/autoloader) %endif # composer.json Requires: php(language) >= %{php_min_ver} %if %{with_range_dependencies} Requires: (php-composer(symfony/css-selector) >= %{symfony_min_ver} with php-composer(symfony/css-selector) < %{symfony_max_ver}) %else Requires: php-composer(symfony/css-selector) >= %{symfony_min_ver} Requires: php-composer(symfony/css-selector) < %{symfony_max_ver} %endif # phpcompatinfo (computed from version 1.8.1) Requires: php-mbstring Requires: php-pcre Requires: php-spl # Autoloader Requires: php-composer(fedora/autoloader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} # Obsolete test suite sub-package Obsoletes: %{name}-driver-testsuite < %{version}-%{release} %description One of the most important parts in the web is a browser. Browser is the window through which web users interact with web applications and other users. Users are always talking with web applications through browsers. So, in order to test that our web application behaves correctly, we need a way to simulate this interaction between the browser and the web application in our tests. We need a Mink. Mink is an open source browser controller/emulator for web applications, written in PHP. Read Mink at a Glance [1] to learn more about Mink and why you need it. Autoloader: %{phpdir}/Behat/Mink/autoload.php [1] http://mink.behat.org/en/latest/at-a-glance.html %prep %setup -qn %{github_name}-%{github_commit} -a 2 %build : Create library autoloader cat <<'AUTOLOAD' | tee src/autoload.php /d' \ phpunit.xml.dist > phpunit.xml : Upstream tests RETURN_CODE=0 PHPUNIT=$(which %{phpunit_exec}) for PHP_EXEC in "" %{?rhel:php54 php55 php56 php70} php71 php72 php73 php74; do if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then $PHP_EXEC $PHPUNIT --verbose || RETURN_CODE=1 fi done exit $RETURN_CODE %else : Tests skipped %endif %files %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md %doc composer.json %dir %{phpdir}/Behat %{phpdir}/Behat/Mink %changelog * Tue Mar 17 2020 Shawn Iwinski - 1.8.1-1 - Update to 1.8.1 (RHBZ #1812690) - Obsolete test suite sub-package - Testsuite as source to ensure proper version/commit - Conditionally use range dependencies - Conditionally drop Symfony 2 interoperability - Conditionally use PHPUnit 7 * Fri Sep 22 2017 Shawn Iwinski - 1.7.1-5 - Fix autoloader for Symfony 3 * Fri May 12 2017 Shawn Iwinski - 1.7.1-3 - Switch autoloader to php-composer(fedora/autoloader) - Add max versions to build dependencies - Test with SCLs if available * Sat Feb 11 2017 Fedora Release Engineering - 1.7.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Tue Aug 09 2016 Shawn Iwinski - 1.7.1-1 - Updated to 1.7.1 (RHBZ #1314987) * Tue Dec 1 2015 Remi Collet - 1.7.0-1 - backport for remi repository * Wed Nov 25 2015 Shawn Iwinski - 1.7.0-1 - Initial package