diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | composer.json | 3 | ||||
-rw-r--r-- | php-fedora-autoloader.spec | 73 |
3 files changed, 59 insertions, 20 deletions
@@ -1,4 +1,7 @@ +clog +package-*.xml *.tgz +*.tar.bz2 *.tar.gz *.tar.xz *.tar.xz.asc diff --git a/composer.json b/composer.json index c7cfd3d..501302f 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.0", - "phpdocumentor/phpdocumentor": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7.11 || ^6.0.5", + "phpunit/phpunit": "^4.8.35 || ^5.7.11 || ^6.0.5 || ^7 || ^8", "theseer/autoload": "^1.22" }, "autoload": { diff --git a/php-fedora-autoloader.spec b/php-fedora-autoloader.spec index d7f9168..1eedf8e 100644 --- a/php-fedora-autoloader.spec +++ b/php-fedora-autoloader.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-fedora-autoloader # -# Copyright (c) 2016-2017 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2016-2021 Shawn Iwinski <shawn@iwin.ski> # Remi Collet <remi@fedoraproject.org> # # License: MIT @@ -13,8 +13,8 @@ %global github_owner php-fedora %global github_name autoloader -%global github_version 1.0.0 -%global github_commit 6075ef68a27dbd9d94a583c2da08a1ae02347a12 +%global github_version 1.0.1 +%global github_commit 7cd61b5a927c8f446df8e820aa288434e18a7f0c %global composer_vendor fedora %global composer_project autoloader @@ -25,44 +25,51 @@ %global phpab_min_ver 1.22 %global phpab_max_ver 2.0 -# Build using "--without tests" to disable tests -%global with_tests 0%{!?_without_tests:1} +%if 0%{?fedora} +%bcond_without tests +%else +%bcond_with tests +%endif %{!?phpdir: %global phpdir %{_datadir}/php} %global phpab_template_dir %{phpdir}/TheSeer/Autoload/templates/ci Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 1%{?dist} +Release: 7%{?dist} Summary: Fedora Autoloader -Group: Development/Libraries License: MIT URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz BuildArch: noarch # Tests -%if %{with_tests} +%if %{with tests} BuildRequires: php-cli ## composer.json BuildRequires: php(language) >= %{php_min_ver} -%if 0%{?fedora} >= 26 -%global phpunit %{_bindir}/phpunit6 +%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8 +%global phpunit %{_bindir}/phpunit8 %else %global phpunit %{_bindir}/phpunit %endif BuildRequires: %{phpunit} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +BuildRequires:(php-composer(theseer/autoload) >= %{phpab_min_ver} with php-composer(theseer/autoload) < %{phpab_max_ver}) +%else +BuildRequires: php-composer(theseer/autoload) < %{phpab_max_ver} BuildRequires: php-composer(theseer/autoload) >= %{phpab_min_ver} +%endif BuildRequires: php-pear -## phpcompatinfo (computed from version 1.0.0) +## phpcompatinfo (computed from version 1.0.1) BuildRequires: php-ctype BuildRequires: php-spl %endif # composer.json Requires: php(language) >= %{php_min_ver} -# phpcompatinfo (computed from version 1.0.0) +# phpcompatinfo (computed from version 1.0.1) Requires: php-ctype Requires: php-spl @@ -82,11 +89,14 @@ required and optional dependencies. %package devel Summary: %{name} devel -Group: Development/Libraries Requires: %{name} = %{version}-%{release} -Requires: php-composer(theseer/autoload) >= %{phpab_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +Requires:(php-composer(theseer/autoload) >= %{phpab_min_ver} with php-composer(theseer/autoload) < %{phpab_max_ver}) +%else Requires: php-composer(theseer/autoload) < %{phpab_max_ver} +Requires: php-composer(theseer/autoload) >= %{phpab_min_ver} +%endif %description devel Provides needed tools to build other packages: @@ -121,14 +131,25 @@ cp -p res/phpab/fedora*.php.tpl %{buildroot}%{phpab_template_dir}/ %check -%if %{with_tests} +%if %{with tests} +: Create tests bootstrap +cat <<'BOOTSTRAP' | tee bootstrap.php +<?php +require '%{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php'; + +if (!class_exists('PHPUnit\\Framework\\TestCase')) { + class_alias('PHPUnit_Framework_TestCase', 'PHPUnit\\Framework\\TestCase'); +} +BOOTSTRAP + +: Upstream tests RETURN_CODE=0 -for PHP_EXEC in "php %{phpunit}" %{?rhel:php54 php55} php56 php70 "php71 %{_bindir}/phpunit6" "php72 %{_bindir}/phpunit6"; do +for PHP_EXEC in "php %{phpunit}" php74 php80 php81; do set $PHP_EXEC if [ "php" == "$1" ] || which $PHP_EXEC; then $1 -d include_path=.:%{buildroot}%{phpdir}:%{phpdir}:%{_datadir}/pear \ - ${2:-%{_bindir}/phpunit} \ - --bootstrap %{buildroot}%{phpdir}/Fedora/Autoloader/autoload.php \ + ${2:-%{_bindir}/phpunit8} \ + --bootstrap bootstrap.php \ --verbose fi done @@ -151,6 +172,22 @@ exit $RETURN_CODE %changelog +* Mon Dec 6 2021 Remi Collet <remi@remirepo.net> - 1.0.1-7 +- disable test suite on EL + +* Mon Mar 8 2021 Remi Collet <remi@remirepo.net> - 1.0.1-5 +- use range dependencies +- switch to phpunit8 + +* Wed Feb 12 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.1-2 +- Add tests bootstrap to fix EPEL6 build + +* Wed Feb 12 2020 Shawn Iwinski <shawn@iwin.ski> - 1.0.1-1 +- Update to 1.0.1 (RHBZ #1802372) + +* Tue Dec 4 2018 Remi Collet <remi@remirepo.net> - 1.0.0-5 +- cleanup for EL-8 + * Thu May 04 2017 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-1 - Update to 1.0.0 |