From 096fa081458642be9eefdbb3f2096b1e8c6ef7ac Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 23 Jul 2020 14:20:57 +0200 Subject: duplicate v1 stuff --- .gitignore | 9 ++ Makefile | 4 + composer.json | 65 +++++++++ makesrc.sh | 74 ++++++++++ php-monolog2.spec | 407 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 559 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 composer.json create mode 100755 makesrc.sh create mode 100644 php-monolog2.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f0400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..91b0fd5 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..e171e20 --- /dev/null +++ b/composer.json @@ -0,0 +1,65 @@ +{ + "name": "monolog/monolog", + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "keywords": ["log", "logging", "psr-3"], + "homepage": "http://github.com/Seldaek/monolog", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "require": { + "php": ">=5.3.0", + "psr/log": "~1.0" + }, + "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", + "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" + }, + "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", + "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", + "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" + }, + "autoload": { + "psr-4": {"Monolog\\": "src/Monolog"} + }, + "autoload-dev": { + "psr-4": {"Monolog\\": "tests/Monolog"} + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "scripts": { + "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" + ] + }, + "lock": false +} diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..ce6064d --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,74 @@ +#/bin/sh + +GIT=`which git` +RPM=`which rpm` + +if [ -z "$GIT" ] +then + echo "ERROR: 'git' command not found" 1>&2 + exit 1 +elif [ -z "$RPM" ] +then + echo "ERROR: 'rpm' command not found" 1>&2 + exit 1 +fi + +function print { + echo -e "\e[0;33m>>>>> ${1}\e[0m" +} + +if [ -x "$1" ] +then + SPEC=$1 +else + SPEC=`ls *.spec | head -1` +fi + +SPEC_DIR=`pwd` + +print "SPEC_DIR = $SPEC_DIR" + +NAME=`echo $SPEC | sed 's#\.spec##'` +VERSION=`egrep '%global\s*github_version' $SPEC | awk '{print $3}'` + +print "SPEC = $SPEC" +print "NAME = $NAME" + +GIT_OWNER=`egrep '%global\s*github_owner' $SPEC | awk '{print $3}'` +GIT_NAME=`egrep '%global\s*github_name' $SPEC | awk '{print $3}'` +GIT_COMMIT=`egrep '%global\s*github_commit' $SPEC | awk '{print $3}'` +GIT_REPO=https://github.com/${GIT_OWNER}/${GIT_NAME} +GIT_DIR=`echo $GIT_REPO | sed 's#.*/##'` + +print "GIT_OWNER = $GIT_OWNER" +print "GIT_NAME = $GIT_NAME" +print "GIT_COMMIT = $GIT_COMMIT" +print "GIT_REPO = $GIT_REPO" +print "GIT_DIR = $GIT_DIR" + +TEMP_DIR=$(mktemp --dir) + +pushd $TEMP_DIR + print "Cloning git repo..." + $GIT clone $GIT_REPO + + pushd $GIT_DIR + print "Checking out commit..." + $GIT checkout $GIT_COMMIT + cp composer.json ${SPEC_DIR} + popd + + TAR_DIR=${GIT_NAME}-${GIT_COMMIT} + print "TAR_DIR = $TAR_DIR" + + mv $GIT_DIR $TAR_DIR + + TAR_FILE=${SPEC_DIR}/${NAME}-${VERSION}-${GIT_COMMIT}.tar.gz + print "TAR_FILE = $TAR_FILE" + + [ -e $TAR_FILE ] && rm -f $TAR_FILE + tar --exclude-vcs -czf $TAR_FILE $TAR_DIR + chmod 0644 $TAR_FILE +popd + +rm -rf $TEMP_DIR diff --git a/php-monolog2.spec b/php-monolog2.spec new file mode 100644 index 0000000..0a3e564 --- /dev/null +++ b/php-monolog2.spec @@ -0,0 +1,407 @@ +# remirepo spec file for php-Monolog, from +# +# Fedora spec file for php-Monolog +# +# Copyright (c) 2012-2020 Shawn Iwinski +# +# License: MIT +# http://opensource.org/licenses/MIT +# +# Please preserve changelog entries +# + +%global github_owner Seldaek +%global github_name monolog +%global github_version 1.25.5 +%global github_commit 1817faadd1846cd08be9a49e905dc68823bc38c0 + +%global composer_vendor monolog +%global composer_project monolog + +# "php": ">=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 +# "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 + +# Build using "--without tests" to disable tests +%bcond_without tests + +%{!?phpdir: %global phpdir %{_datadir}/php} + +Name: php-Monolog +Version: %{github_version} +Release: 1%{?dist} +Summary: Sends your logs to files, sockets, inboxes, databases and various web services + +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 +# 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} +## 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 +## Autoloader +BuildRequires: php-composer(fedora/autoloader) +%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 +# 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} + +# 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) +Suggests: php-pecl(amqp) +Suggests: php-pecl(mongo) +%endif + +%description +Monolog sends your logs to files, sockets, inboxes, databases and various web +services. Special handlers allow you to build advanced logging strategies. + +This library implements the PSR-3 [1] interface that you can type-hint against +in your own libraries to keep a maximum of interoperability. You can also use it +in your applications to make sure you can always use another compatible logger +at a later time. + +[1] http://www.php-fig.org/psr/psr-3/ + + +%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 + - 1.25.5-1 +- update to 1.25.5 + +* Thu Nov 14 2019 Remi Collet - 1.25.2-1 +- update to 1.25.2 + +* Mon Jul 8 2019 Remi Collet - 1.24.0-1 +- update to 1.24.0 + +* Sun Jul 09 2017 Shawn Iwinski - 1.23.0-1 +- Update to 1.23.0 (RHBZ #1432274) +- Test with SCLs if available + +* Tue Jun 20 2017 Remi Collet - 1.23.0-1 +- Update to 1.23.0 +- add max version for build dependencies + +* Mon Mar 13 2017 Remi Collet - 1.22.1-1 +- Update to 1.22.1 + +* Sat Nov 26 2016 Remi Collet - 1.22.0-1 +- update to 1.22.0 +- switch from symfony/class-loader to fedora/autoloader +- allow aws/aws-sdk-php version 3 + +* Sun Nov 06 2016 Shawn Iwinski - 1.21.0-2 +- Fix test suite for php-sentry >= 0.16.0 +- Modified php-psr-log dependency (min version 1.0.0-8 => 1.0.1) + +* Mon Aug 08 2016 Shawn Iwinski - 1.21.0-1 +- Updated to 1.21.0 (RHBZ #1362318) + +* Fri Aug 5 2016 Remi Collet - 1.21.0-1 +- update to 1.21.0 + +* Tue Jul 5 2016 Remi Collet - 1.20.0-1.1 +- sync with Fedora, re-add dependency on raven + (sentry is only a rename) + +* Mon Jul 04 2016 Shawn Iwinski - 1.20.0-1 +- Updated to 1.20.0 (RHBZ #1352494) +- Updated autoloader to not use "@include_once" + +* Sun Jul 3 2016 Remi Collet - 1.20.0-1 +- update to 1.20.0 +- drop dependency on raven (upstream switch to sentry) + +* Thu Apr 14 2016 Remi Collet - 1.19.0-1 +- update to 1.19.0 +- updated autoloader dependency loading + +* Mon Apr 04 2016 Shawn Iwinski - 1.18.2-1 +- Updated to 1.18.2 (RHBZ #1313579) +- Removed patch (accepted upstream and applied to this version) +- Added additional weak dependencies (AMQP and MongoDB) + +* Sat Apr 2 2016 Remi Collet - 1.18.2-1 +- update to 1.18.2 + +* Fri Apr 01 2016 Shawn Iwinski - 1.18.1-2 +- Increased PSR log min version for autoloader +- Updated autoloader +- Added weak dependencies + +* Fri Mar 25 2016 Remi Collet - 1.18.1-1 +- update to 1.18.1 +- use php-swiftmailer instead of old php-swift-Swift +- install optional dependencies during the build for tests +- add patch for missing property, breaking test suite + open https://github.com/Seldaek/monolog/pull/757 + +* Thu Oct 15 2015 Shawn Iwinski - 1.17.2-1 +- Updated to 1.17.2 (RHBZ #1271882) + +* Thu Oct 15 2015 Remi Collet - 1.17.2-1 +- update to 1.17.2 + +* Sun Sep 13 2015 Shawn Iwinski - 1.17.1-1 +- Updated to 1.17.1 (RHBZ #1258230) + +* Tue Aug 11 2015 Shawn Iwinski - 1.16.0-1 +- Updated to 1.16.0 (RHBZ #1251783) +- Updated autoloader to load dependencies after self registration + +* Mon Aug 10 2015 Remi Collet - 1.16.0-1 +- update to 1.16.0 + +* Mon Jul 20 2015 Shawn Iwinski - 1.15.0-2 +- Fix autoloader + +* Sun Jul 19 2015 Shawn Iwinski - 1.15.0-1 +- Updated to 1.15.0 (RHBZ #1199105) +- Added autoloader + +* Sun Jan 04 2015 Shawn Iwinski - 1.12.0-1 +- Updated to 1.12.0 (BZ #1178410) + +* Sun Nov 9 2014 Shawn Iwinski - 1.11.0-1 +- Updated to 1.11.0 (BZ #1148336) +- Added php-composer(psr/log-implementation) virtual provide +- %%license usage + +* Sun Jun 8 2014 Remi Collet 1.10.0-1 +- backport 1.10.0 for remi repo + +* Sat Jun 07 2014 Shawn Iwinski - 1.10.0-1 +- Updated to 1.10.0 (BZ #1105816) +- Removed max PHPUnit dependency +- Added php-composer(monolog/monolog) virtual provide + +* Mon Apr 28 2014 Remi Collet 1.9.1-1 +- backport 1.9.1 for remi repo + +* Fri Apr 25 2014 Shawn Iwinski 1.9.1-1 +- Updated to 1.9.1 (BZ #1080872) +- Added option to build without tests ("--without tests") + +* Thu Jan 16 2014 Shawn Iwinski 1.7.0-3 +- Properly obsolete sub-packages + +* Wed Jan 15 2014 Shawn Iwinski 1.7.0-2 +- Removed sub-packages (optional dependencies note in description instead) + +* Mon Dec 30 2013 Remi Collet 1.7.0-1 +- backport 1.7.0 for remi repo + +* Mon Dec 30 2013 Shawn Iwinski 1.7.0-1 +- Updated to 1.7.0 (BZ #1030923) +- Added dynamo sub-package +- Spec cleanup + +* Tue Aug 20 2013 Remi Collet 1.6.0-1 +- backport 1.6.0 for remi repo + +* Sat Aug 17 2013 Shawn Iwinski 1.6.0-1 +- Updated to version 1.6.0 +- Added phpcompatinfo build requires +- php-common -> php(language) +- No conditional php-filter require +- Added php-hash require +- Global raven min and max versions +- Removed MongoDBHandlerTest because it requires a running MongoDB server + +* Tue Apr 2 2013 Remi Collet 1.4.1-1 +- backport 1.4.1 for remi repo + +* Mon Apr 01 2013 Shawn Iwinski 1.4.1-1 +- Updated to version 1.4.1 +- Updates for "new" Fedora GitHub guidelines +- Updated summary and description +- Added php-PsrLog require +- Added tests (%%check) +- Removed tests sub-package +- Added raven sub-package + +* Sun Nov 25 2012 Remi Collet 1.2.1-1 +- backport 1.2.1 for remi repo + +* Sat Nov 17 2012 Shawn Iwinski 1.2.1-1 +- Updated to upstream version 1.2.1 +- Changed %%{libname} from monolog to Monolog +- Fixed license +- GitHub archive source +- Added php-pear(pear.swiftmailer.org/Swift), php-curl, and php-sockets requires +- Added optional packages note in %%{description} +- Simplified %%prep +- Added subpackages for AMQP and MongoDB handlers +- Changed RPM_BUILD_ROOT to %%{buildroot} + +* Sun Jul 22 2012 Shawn Iwinski 1.1.0-1 +- Initial package -- cgit