summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-07-23 15:12:20 +0200
committerRemi Collet <remi@remirepo.net>2020-07-23 15:12:20 +0200
commite1dca683bd57a76c102b5877f947adabff702071 (patch)
tree28610a058dad8e88c329ced08295675d526f253b
parent096fa081458642be9eefdbb3f2096b1e8c6ef7ac (diff)
update to 2.1.1HEADmaster
rename to php-monolog2 install in /usr/share/php/Monolog2 raise dependency on PHP 7.2 switch to classmap autoloader
-rw-r--r--composer.json40
-rw-r--r--php-monolog2.spec220
2 files changed, 132 insertions, 128 deletions
diff --git a/composer.json b/composer.json
index e171e20..9e54787 100644
--- a/composer.json
+++ b/composer.json
@@ -13,33 +13,37 @@
}
],
"require": {
- "php": ">=5.3.0",
- "psr/log": "~1.0"
+ "php": ">=7.2",
+ "psr/log": "^1.0.1"
},
"require-dev": {
- "phpunit/phpunit": "~4.5",
- "graylog2/gelf-php": "~1.0",
- "sentry/sentry": "^0.13",
- "ruflin/elastica": ">=0.90 <3.0",
- "doctrine/couchdb": "~1.0@dev",
"aws/aws-sdk-php": "^2.4.9 || ^3.0",
+ "doctrine/couchdb": "~1.0@dev",
+ "elasticsearch/elasticsearch": "^6.0",
+ "graylog2/gelf-php": "^1.4.2",
"php-amqplib/php-amqplib": "~2.4",
- "swiftmailer/swiftmailer": "^5.3|^6.0",
"php-console/php-console": "^3.1.3",
- "php-parallel-lint/php-parallel-lint": "^1.0"
+ "php-parallel-lint/php-parallel-lint": "^1.0",
+ "phpspec/prophecy": "^1.6.1",
+ "phpunit/phpunit": "^8.5",
+ "predis/predis": "^1.1",
+ "rollbar/rollbar": "^1.3",
+ "ruflin/elastica": ">=0.90 <3.0",
+ "swiftmailer/swiftmailer": "^5.3|^6.0"
},
"suggest": {
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
- "sentry/sentry": "Allow sending log messages to a Sentry server",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server",
+ "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client",
"php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
- "ext-mongo": "Allow sending log messages to a MongoDB server",
- "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver",
+ "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)",
+ "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)",
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"rollbar/rollbar": "Allow sending log messages to Rollbar",
- "php-console/php-console": "Allow sending log messages to Google Chrome"
+ "php-console/php-console": "Allow sending log messages to Google Chrome",
+ "ext-mbstring": "Allow to work properly with unicode symbols"
},
"autoload": {
"psr-4": {"Monolog\\": "src/Monolog"}
@@ -52,14 +56,20 @@
},
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "2.x-dev"
}
},
"scripts": {
+ "lint": [
+ "parallel-lint . --exclude vendor"
+ ],
"test": [
- "parallel-lint . --exclude vendor --exclude src/Monolog/Handler/FormattableHandlerInterface.php --exclude src/Monolog/Handler/FormattableHandlerTrait.php --exclude src/Monolog/Handler/ProcessableHandlerInterface.php --exclude src/Monolog/Handler/ProcessableHandlerTrait.php",
"phpunit"
]
},
+ "config": {
+ "sort-packages": true,
+ "platform-check": false
+ },
"lock": false
}
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 <shawn.iwinski@gmail.com>
+# Remi Collet <remi@remirepo.net>
#
# 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
-<?php
-/**
- * Autoloader for %{name} and its' dependencies
- * (created by %{name}-%{version}-%{release}).
- */
-require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
+phpab -t fedora \
+ -o src/Monolog/autoload.php \
+ src/Monolog
-\Fedora\Autoloader\Autoload::addPsr4('Monolog\\', __DIR__);
+cat <<'AUTOLOAD' | tee -a src/Monolog/autoload.php
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Psr/Log/autoload.php',
));
-\Fedora\Autoloader\Dependencies::optional(array(
- array(
+\Fedora\Autoloader\Dependencies::optional([
+ [
'%{phpdir}/Aws3/autoload.php',
'%{phpdir}/Aws/autoload.php',
- ),
- '%{phpdir}/Raven/autoload.php',
- '%{phpdir}/Swift/swift_required.php',
-));
+ ], [
+ '%{phpdir}/Swift6/autoload.php',
+ '%{phpdir}/Swift/swift_required.php',
+ ],
+ '%{phpdir}/MongoDB/autoload.php',
+]);
AUTOLOAD
%install
mkdir -p %{buildroot}%{phpdir}
-cp -pr src/Monolog %{buildroot}%{phpdir}/
+cp -pr src/Monolog %{buildroot}%{phpdir}/Monolog%{major}
%check
%if %{with tests}
+mkdir vendor
: Create tests bootstrap
-cat <<'BOOTSTRAP' | tee bootstrap.php
+cat << 'BOOTSTRAP' | tee vendor/autoload.php
<?php
-require_once '%{buildroot}%{phpdir}/Monolog/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('Monolog\\', __DIR__ . '/tests/Monolog');
+require_once '%{buildroot}%{phpdir}/Monolog%{major}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Monolog\\', dirname(__DIR__) . '/tests/Monolog');
BOOTSTRAP
: Remove MongoDBHandlerTest because it requires a running MongoDB server
rm -f tests/Monolog/Handler/MongoDBHandlerTest.php
+: Remove RedisHandlerTest because it requires a running Redis server
+rm -f tests/Monolog/Handler/RedisHandlerTest.php
+
: Remove GitProcessorTest because it requires a git repo
rm -f tests/Monolog/Processor/GitProcessorTest.php
: Mocking issues
rm -f tests/Monolog/Handler/SocketHandlerTest.php
-
-: Trying to access array offset on value of type null in Raven lib
-rm -f tests/Monolog/Handler/RavenHandlerTest.php
-
-: Skip tests known to fail
-%if 0%{?rhel} == 6 || 0%{?rhel} == 7
-sed 's/function testThrowsOnInvalidEncoding/function SKIP_testThrowsOnInvalidEncoding/' \
- -i tests/Monolog/Formatter/NormalizerFormatterTest.php
-%endif
+rm -f tests/Monolog/Handler/RollbarHandlerTest.php
: Upstream tests
RETURN_CODE=0
-PHPUNIT=$(which phpunit)
-for PHP_EXEC in "" %{?rhel:php54 php55 php56 php70 php71} php72 php73 php74; do
+PHPUNIT=$(which phpunit8)
+for PHP_EXEC in "" php72 php73 php74; do
if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
- $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php || RETURN_CODE=1
+ $PHP_EXEC $PHPUNIT --verbose || RETURN_CODE=1
fi
done
exit $RETURN_CODE
@@ -225,15 +211,23 @@ exit $RETURN_CODE
%files
+# remirepo:1
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
%doc doc
%doc composer.json
-%{phpdir}/Monolog
+%{phpdir}/Monolog%{major}
%changelog
+* Thu Jul 23 2020 Remi Collet <remi@remirepo.net> - 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 <remi@remirepo.net> - 1.25.5-1
- update to 1.25.5