summaryrefslogtreecommitdiffstats
path: root/php-Monolog.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-Monolog.spec')
-rw-r--r--php-Monolog.spec102
1 files changed, 44 insertions, 58 deletions
diff --git a/php-Monolog.spec b/php-Monolog.spec
index fbcea9b..92b4590 100644
--- a/php-Monolog.spec
+++ b/php-Monolog.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-Monolog
#
-# Copyright (c) 2012-2016 Shawn Iwinski <shawn.iwinski@gmail.com>
+# Copyright (c) 2012-2017 Shawn Iwinski <shawn.iwinski@gmail.com>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -12,28 +12,28 @@
%global github_owner Seldaek
%global github_name monolog
-%global github_version 1.22.1
-%global github_commit 1e044bc4b34e91743943479f1be7a1d5eb93add0
+%global github_version 1.23.0
+%global github_commit fd8c787753b3a2ad11bc60c063cff1358a32a3b4
%global composer_vendor monolog
%global composer_project monolog
# "php": ">=5.3.0"
-%global php_min_ver 5.3.0
+%global php_min_ver 5.3.0
# "psr/log": "~1.0"
# NOTE: Min version not 1.0 because autoloader required
-%global psrlog_min_ver 1.0.1
-%global psrlog_max_ver 2.0
-# "raven/raven": "^0.13"
-%global raven_min_ver 0.13
-%global raven_max_ver 1.0
+%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
+%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_min_ver 5.3
+%global swift_max_ver 6
# Build using "--without tests" to disable tests
%global with_tests 0%{!?_without_tests:1}
@@ -56,18 +56,21 @@ Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_co
# https://github.com/Seldaek/monolog/pull/880
Patch0: %{name}-tests-sentry-gte-0-16-0.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Tests
%if %{with_tests}
## composer.json
-BuildRequires: php(language) >= %{php_min_ver}
+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_min_ver}
+BuildRequires: php-composer(psr/log) < %{psrlog_max_ver}
## optional
BuildRequires: php-composer(swiftmailer/swiftmailer) >= %{swift_min_ver}
-BuildRequires: php-composer(raven/raven) >= %{raven_min_ver}
-BuildRequires: php-composer(aws/aws-sdk-php) >= %{aws_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
@@ -86,7 +89,7 @@ BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
-Requires: php(language) >= %{php_min_ver}
+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)
@@ -124,17 +127,11 @@ Provides: %{name}-raven = %{version}-%{release}
# Weak dependencies
%if 0%{?fedora} >= 21
Suggests: php-composer(aws/aws-sdk-php)
-Suggests: php-composer(raven/raven)
+Suggests: php-composer(sentry/sentry)
Suggests: php-composer(swiftmailer/swiftmailer)
Suggests: php-pecl(amqp)
Suggests: php-pecl(mongo)
%endif
-Conflicts: php-aws-sdk < %{aws_min_ver}
-Conflicts: php-aws-sdk >= %{aws_max_ver}
-Conflicts: php-Raven < %{raven_min_ver}
-Conflicts: php-Raven >= %{raven_max_ver}
-Conflicts: php-swiftmailer < %{swift_min_ver}
-Conflicts: php-swiftmailer >= %{swift_max_ver}
%description
Monolog sends your logs to files, sockets, inboxes, databases and various web
@@ -154,6 +151,8 @@ at a later time.
: Fix tests for sentry/sentry >= 0.16.0
%patch0 -p1
+
+%build
: Create autoloader
cat <<'AUTOLOAD' | tee src/Monolog/autoload.php
<?php
@@ -161,7 +160,6 @@ cat <<'AUTOLOAD' | tee src/Monolog/autoload.php
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
*/
-
require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Monolog\\', __DIR__);
@@ -169,6 +167,7 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Dependencies::required(array(
'%{phpdir}/Psr/Log/autoload.php',
));
+
\Fedora\Autoloader\Dependencies::optional(array(
array(
'%{phpdir}/Aws3/autoload.php',
@@ -180,15 +179,9 @@ require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
AUTOLOAD
-%build
-# Empty build section, nothing to build
-
-
%install
-rm -rf %{buildroot}
-
mkdir -p %{buildroot}%{phpdir}
-cp -pr src/* %{buildroot}%{phpdir}/
+cp -pr src/Monolog %{buildroot}%{phpdir}/
%check
@@ -206,42 +199,27 @@ rm -f tests/Monolog/Handler/MongoDBHandlerTest.php
: Remove GitProcessorTest because it requires a git repo
rm -f tests/Monolog/Processor/GitProcessorTest.php
-: Remove know to fail with PHP 7.1 and fixed in upstream master
-sed -e 's/testUseMicrosecondTimestamps/SKIP_testUseMicrosecondTimestamps/' \
- -i tests/Monolog/LoggerTest.php
-
: Skip tests known to fail
%if 0%{?rhel} > 0
sed 's/function testThrowsOnInvalidEncoding/function SKIP_testThrowsOnInvalidEncoding/' \
-i tests/Monolog/Formatter/NormalizerFormatterTest.php
%endif
-ret=0
-run=0
-if which php71; then
- php71 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1
- run=1
-fi
-if which php56; then
- php56 %{_bindir}/phpunit --bootstrap bootstrap.php || ret=1
- run=1
-fi
-if [ $run -eq 0 ]; then
-%{_bindir}/phpunit --verbose --bootstrap bootstrap.php
-fi
-
-exit $ret;
+: Upstream tests
+RETURN_CODE=0
+PHPUNIT=$(which phpunit)
+for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do
+ if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then
+ $PHP_EXEC $PHPUNIT --verbose --bootstrap bootstrap.php || RETURN_CODE=1
+ fi
+done
+exit $RETURN_CODE
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -251,6 +229,14 @@ rm -rf %{buildroot}
%changelog
+* Sun Jul 09 2017 Shawn Iwinski <shawn.iwinski@gmail.com> - 1.23.0-1
+- Update to 1.23.0 (RHBZ #1432274)
+- Test with SCLs if available
+
+* Tue Jun 20 2017 Remi Collet <remi@remirepo.net> - 1.23.0-1
+- Update to 1.23.0
+- add max version for build dependencies
+
* Mon Mar 13 2017 Remi Collet <remi@remirepo.net> - 1.22.1-1
- Update to 1.22.1