From e1dca683bd57a76c102b5877f947adabff702071 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 23 Jul 2020 15:12:20 +0200 Subject: update to 2.1.1 rename to php-monolog2 install in /usr/share/php/Monolog2 raise dependency on PHP 7.2 switch to classmap autoloader --- php-monolog2.spec | 220 ++++++++++++++++++++++++++---------------------------- 1 file changed, 107 insertions(+), 113 deletions(-) (limited to 'php-monolog2.spec') diff --git a/php-monolog2.spec b/php-monolog2.spec index 0a3e564..ed337e4 100644 --- a/php-monolog2.spec +++ b/php-monolog2.spec @@ -1,8 +1,7 @@ -# remirepo spec file for php-Monolog, from -# -# Fedora spec file for php-Monolog +# remirepo/fedora spec file for php-monolog2 # # Copyright (c) 2012-2020 Shawn Iwinski +# Remi Collet # # License: MIT # http://opensource.org/licenses/MIT @@ -12,35 +11,32 @@ %global github_owner Seldaek %global github_name monolog -%global github_version 1.25.5 -%global github_commit 1817faadd1846cd08be9a49e905dc68823bc38c0 +%global github_version 2.1.1 +%global github_commit f9eee5cec93dfb313a38b6b288741e84e53f02d5 %global composer_vendor monolog %global composer_project monolog +%global major 2 -# "php": ">=5.3.0" -%global php_min_ver 5.3.0 -# "psr/log": "~1.0" -# NOTE: Min version not 1.0 because autoloader required +# "php": ">=7.2" +%global php_min_ver 7.2 +# "psr/log": "^1.0.1" %global psrlog_min_ver 1.0.1 %global psrlog_max_ver 2.0 -# "sentry/sentry": "^0.13" -%global sentry_min_ver 0.13 -%global sentry_max_ver 1.0 # "aws/aws-sdk-php": "^2.4.9 || ^3.0" # NOTE: Min version not 2.4.9 because autoloader required %global aws_min_ver 2.8.13 %global aws_max_ver 4.0 # "swiftmailer/swiftmailer": "~5.3" %global swift_min_ver 5.3 -%global swift_max_ver 6 +%global swift_max_ver 7 # Build using "--without tests" to disable tests %bcond_without tests %{!?phpdir: %global phpdir %{_datadir}/php} -Name: php-Monolog +Name: php-%{composer_project}%{major} Version: %{github_version} Release: 1%{?dist} Summary: Sends your logs to files, sockets, inboxes, databases and various web services @@ -49,87 +45,84 @@ License: MIT URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz -# Fix tests for sentry/sentry >= 0.16.0 (and < 1.0) -# -# Patch adapted for Monolog version 1.21.0 from -# https://github.com/Seldaek/monolog/pull/880 -Patch0: %{name}-tests-sentry-gte-0-16-0.patch - -BuildArch: noarch +BuildArch: noarch # Tests %if %{with tests} ## composer.json -BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-composer(phpunit/phpunit) -BuildRequires: php-composer(psr/log) >= %{psrlog_min_ver} -BuildRequires: php-composer(psr/log) < %{psrlog_max_ver} +BuildRequires: php(language) >= %{php_min_ver} +BuildRequires: phpunit8 >= 8.5 +# remirepo:1 +%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +BuildRequires: (php-composer(psr/log) >= %{psrlog_min_ver} with php-composer(psr/log) < %{psrlog_max_ver}) +BuildRequires: (php-composer(swiftmailer/swiftmailer) >= %{swift_min_ver} with php-composer(swiftmailer/swiftmailer) < %{swift_max_ver}) +BuildRequires: (php-composer(aws/aws-sdk-php) >= %{aws_min_ver} with php-composer(aws/aws-sdk-php) < %{aws_max_ver}) +# remirepo:5 +%else +BuildRequires: php-PsrLog +BuildRequires: php-swiftmailer6 +BuildRequires: php-aws-sdk3 +%endif ## optional -BuildRequires: php-composer(swiftmailer/swiftmailer) >= %{swift_min_ver} -BuildRequires: php-composer(swiftmailer/swiftmailer) < %{swift_max_ver} -BuildRequires: php-composer(sentry/sentry) >= %{sentry_min_ver} -BuildRequires: php-composer(sentry/sentry) < %{sentry_max_ver} -BuildRequires: php-composer(aws/aws-sdk-php) >= %{aws_min_ver} -BuildRequires: php-composer(aws/aws-sdk-php) < %{aws_max_ver} -## phpcompatinfo (computed from version 1.22.0) -BuildRequires: php-curl -BuildRequires: php-date -BuildRequires: php-filter -BuildRequires: php-hash -BuildRequires: php-json -BuildRequires: php-mbstring -BuildRequires: php-openssl -BuildRequires: php-pcre -BuildRequires: php-reflection -BuildRequires: php-sockets -BuildRequires: php-spl -BuildRequires: php-xml +## phpcompatinfo (computed from version 2.1.1) +BuildRequires: php-curl +BuildRequires: php-date +BuildRequires: php-filter +BuildRequires: php-json +BuildRequires: php-mbstring +BuildRequires: php-openssl +BuildRequires: php-pcntl +BuildRequires: php-pcre +BuildRequires: php-posix +BuildRequires: php-reflection +BuildRequires: php-soap +BuildRequires: php-sockets +BuildRequires: php-spl +BuildRequires: php-xml ## Autoloader -BuildRequires: php-composer(fedora/autoloader) +BuildRequires: php-fedora-autoloader-devel %endif # composer.json -Requires: php(language) >= %{php_min_ver} -Requires: php-composer(psr/log) >= %{psrlog_min_ver} -Requires: php-composer(psr/log) < %{psrlog_max_ver} -# phpcompatinfo (computed from version 1.22.0) -Requires: php-curl -Requires: php-date -Requires: php-filter -Requires: php-hash -Requires: php-json -Requires: php-mbstring -Requires: php-openssl -Requires: php-pcre -Requires: php-sockets -Requires: php-spl -Requires: php-xml +Requires: php(language) >= %{php_min_ver} +# remirepo:1 +%if 0%{?fedora} >= 28 || 0%{?rhel} >= 8 +Requires: (php-composer(psr/log) >= %{psrlog_min_ver} with php-composer(psr/log) < %{psrlog_max_ver}) +# remirepo:5 +%else +Requires: php-PsrLog +%endif +# phpcompatinfo (computed from version 2.1.1) +Requires: php-curl +Requires: php-date +Requires: php-filter +Requires: php-json +Requires: php-mbstring +Requires: php-openssl +Requires: php-pcntl +Requires: php-pcre +Requires: php-posix +Requires: php-sockets +Requires: php-spl +Requires: php-xml # Autoloader Requires: php-composer(fedora/autoloader) -# Standard "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" naming -Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release} -Provides: php-%{composer_project} = %{version}-%{release} # Composer -Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} -Provides: php-composer(psr/log-implementation) = 1.0.0 - -# Removed sub-packages -Obsoletes: %{name}-amqp < %{version}-%{release} -Provides: %{name}-amqp = %{version}-%{release} -Obsoletes: %{name}-dynamo < %{version}-%{release} -Provides: %{name}-dynamo = %{version}-%{release} -Obsoletes: %{name}-mongo < %{version}-%{release} -Provides: %{name}-mongo = %{version}-%{release} -Obsoletes: %{name}-raven < %{version}-%{release} -Provides: %{name}-raven = %{version}-%{release} +Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} +Provides: php-composer(psr/log-implementation) = 1.0.0 # Weak dependencies -%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 -Suggests: php-composer(aws/aws-sdk-php) -Suggests: php-composer(sentry/sentry) -Suggests: php-composer(swiftmailer/swiftmailer) +# remirepo:1 +%if 0%{?fedora} >=21 || 0%{?rhel} >= 8 +# TODO graylog2/gelf-php, doctrine/couchdb, ruflin/elastica, elasticsearch/elasticsearch +# rollbar/rollbar, php-console/php-console +Suggests: php-composer(php-amqplib/php-amqplib) Suggests: php-pecl(amqp) Suggests: php-pecl(mongo) +Suggests: php-composer(mongodb/mongodb) +Suggests: php-composer(aws/aws-sdk-php) +Suggests: php-composer(swiftmailer/swiftmailer) +# remirepo:1 %endif %description @@ -143,79 +136,72 @@ at a later time. [1] http://www.php-fig.org/psr/psr-3/ +Autoloader: %{phpdir}/Monolog%{major}/autoload.php + %prep %setup -qn %{github_name}-%{github_commit} -: Fix tests for sentry/sentry >= 0.16.0 -%patch0 -p1 - %build : Create autoloader -cat <<'AUTOLOAD' | tee src/Monolog/autoload.php - - 2.1.1-1 +- update to 2.1.1 +- rename to php-monolog2 +- install in /usr/share/php/Monolog2 +- raise dependency on PHP 7.2 +- switch to classmap autoloader + * Thu Jul 23 2020 Remi Collet - 1.25.5-1 - update to 1.25.5 -- cgit