diff options
-rw-r--r-- | php-sentry.spec | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/php-sentry.spec b/php-sentry.spec index 8ef7a35..d4de11b 100644 --- a/php-sentry.spec +++ b/php-sentry.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-sentry # -# Copyright (c) 2016 Shawn Iwinski <shawn@iwin.ski> +# Copyright (c) 2016-2020 Shawn Iwinski <shawn@iwin.ski> # # License: MIT # http://opensource.org/licenses/MIT @@ -22,19 +22,27 @@ %global php_min_ver 5.2.4 # "monolog/monolog": "*" # NOTE: Min version because autoloader required +# NOTE: Adding max version to force v1 %global monolog_min_ver 1.15.0 +%global monolog_max_ver 2 # 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_project} Version: %{github_version} -Release: 1%{?github_release}%{?dist} +Release: 11%{?github_release}%{?dist} Summary: PHP client for Sentry -Group: Development/Libraries # ASL 2.0: # - lib/Raven/Serializer.php # BSD: @@ -47,7 +55,6 @@ URL: https://github.com/%{github_owner}/%{github_name} Source0: %{name}-%{github_version}-%{github_commit}.tar.gz Source1: %{name}-get-source.sh -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch # Library version value check BuildRequires: php-cli @@ -56,8 +63,12 @@ BuildRequires: php-cli ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -BuildRequires: php-composer(monolog/monolog) >= %{monolog_min_ver} BuildRequires: php-curl +%if %{with_range_dependencies} +BuildRequires: (php-composer(monolog/monolog) >= %{monolog_min_ver} with php-composer(monolog/monolog) < %{monolog_max_ver}) +%else +BuildRequires: php-Monolog >= %{monolog_min_ver} +%endif ## phpcompatinfo (computed from version 0.22.0) BuildRequires: php-date BuildRequires: php-hash @@ -67,22 +78,20 @@ BuildRequires: php-reflection BuildRequires: php-session BuildRequires: php-spl BuildRequires: php-zlib -%if 0%{?fedora} >= 25 -# Required for PHPUnit with PHP 7 -# See https://github.com/getsentry/sentry-php/pull/365 -BuildRequires: php-uopz -%endif # Conflict because Monolog will load obsoleted package's autoloader and classes. BuildConflicts: php-Raven %endif Requires: php-cli -# use path as ca-certificates doesn't exists on EL-5 -Requires: /etc/pki/tls/cert.pem +Requires: ca-certificates # composer.json Requires: php(language) >= %{php_min_ver} -Requires: php-composer(monolog/monolog) >= %{monolog_min_ver} Requires: php-curl +%if %{with_range_dependencies} +Requires: (php-composer(monolog/monolog) >= %{monolog_min_ver} with php-composer(monolog/monolog) < %{monolog_max_ver}) +%else +Requires: php-Monolog >= %{monolog_min_ver} +%endif # phpcompatinfo (computed from version 0.22.0) Requires: php-date Requires: php-hash @@ -141,8 +150,6 @@ AUTOLOAD %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{phpdir} cp -rp lib/* %{buildroot}%{phpdir}/ @@ -170,33 +177,21 @@ require_once '%{buildroot}%{phpdir}/Raven/autoload.php'; BOOTSTRAP : Run tests -# remirepo:11 -run=0 ret=0 -if which php56; then - php56 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1 - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1 - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --verbose --bootstrap bootstrap.php -# remirepo:2 -fi +for cmd in php php70 php71 php72 php73; do + if which $cmd; then + $cmd %{_bindir}/phpunit \ + --filter '^((?!(testCanTraceParamContext|testDoesFixFrameInfo)).)*$' \ + --verbose --bootstrap bootstrap.php || ret=1 + fi +done exit $ret %else : Tests skipped %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.rst @@ -209,6 +204,12 @@ rm -rf %{buildroot} %changelog +* Fri Sep 04 2020 Shawn Iwinski <shawn@iwin.ski> - 0.22.0-11 +- Add max Monolog version + +* Thu Dec 6 2018 Remi Collet <remi@remirepo.net> - 0.22.0-6 +- skip test relying on uopz extension + * Sun Nov 6 2016 Remi Collet <remi@remirepo.net> - 0.22.0-1 - add backport stuff for remi repo. |