diff options
| -rw-r--r-- | .gitignore | 8 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | composer.json | 42 | ||||
| -rw-r--r-- | php-symfony-monolog-bundle.spec | 213 | 
4 files changed, 267 insertions, 0 deletions
| diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /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..c2d5894 --- /dev/null +++ b/composer.json @@ -0,0 +1,42 @@ +{ +    "name": "symfony/monolog-bundle", +    "type": "symfony-bundle", +    "description": "Symfony MonologBundle", +    "keywords": ["log", "logging"], +    "homepage": "http://symfony.com", +    "license": "MIT", +    "authors": [ +        { +            "name": "Fabien Potencier", +            "email": "fabien@symfony.com" +        }, +        { +            "name": "Symfony Community", +            "homepage": "http://symfony.com/contributors" +        } +    ], +    "require": { +        "php": ">=5.6", +        "symfony/monolog-bridge": "~2.7|~3.3|~4.0", +        "symfony/dependency-injection": "~2.7|~3.4.10|^4.0.10", +        "symfony/config": "~2.7|~3.3|~4.0", +        "symfony/http-kernel": "~2.7|~3.3|~4.0", +        "monolog/monolog": "~1.22" +    }, +    "require-dev": { +        "symfony/yaml": "~2.7|~3.3|~4.0", +        "symfony/console": "~2.7|~3.3|~4.0", +        "symfony/phpunit-bridge": "^3.3|^4.0" +    }, +    "autoload": { +        "psr-4": { "Symfony\\Bundle\\MonologBundle\\": "" }, +        "exclude-from-classmap": [ +            "/Tests/" +        ] +    }, +    "extra": { +        "branch-alias": { +            "dev-master": "3.x-dev" +        } +    } +} diff --git a/php-symfony-monolog-bundle.spec b/php-symfony-monolog-bundle.spec new file mode 100644 index 0000000..30a09bb --- /dev/null +++ b/php-symfony-monolog-bundle.spec @@ -0,0 +1,213 @@ +# remirepo/fedora spec file for php-symfony-monolog-bundle +# +# Copyright (c) 2018 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global gh_commit    572e143afc03419a75ab002c80a2fd99299195ff +%global gh_short     %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner     symfony +%global gh_project   monolog-bundle +# Packagist +%global pk_vendor    %{gh_owner} +%global pk_project   %{gh_project} +# Namespace +%global ns_vendor    Symfony +%global ns_sub       Bundle +%global ns_project   MonologBundle +%global php_home     %{_datadir}/php +# Test +%global with_tests   0%{!?_without_tests:1} + +Name:           php-%{pk_vendor}-%{pk_project} +Version:        3.3.1 +Release:        1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist} +Summary:        Symfony MonologBundle + +License:        MIT +URL:            https://github.com/%{gh_owner}/%{gh_project} +Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{?gh_short}.tar.gz + +BuildArch:      noarch +%if %{with_tests} +# For tests +BuildRequires:  php(language) >= 5.6 +BuildRequires:  php-json +BuildRequires:  php-pcre +BuildRequires:  php-spl +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >=8 +BuildRequires: (php-composer(%{pk_vendor}/monolog-bridge)       >= 2.7    with php-composer(%{pk_vendor}/monolog-bridge)       < 5) +BuildRequires: (php-composer(%{pk_vendor}/dependency-injection) >= 2.7    with php-composer(%{pk_vendor}/dependency-injection) < 5) +BuildRequires: (php-composer(%{pk_vendor}/config)               >= 2.7    with php-composer(%{pk_vendor}/config)               < 5) +BuildRequires: (php-composer(%{pk_vendor}/http-kernel)          >= 2.7    with php-composer(%{pk_vendor}/http-kernel)          < 5) +BuildRequires: (php-composer(monolog/monolog)                   >= 1.22   with php-composer(monolog/monolog)                   < 2) +# remirepo:7 +%else +BuildRequires:  php-symfony3-monolog-bridge         >= 3.3 +BuildRequires:  php-symfony3-dependency-injection   >= 3.3 +BuildRequires:  php-symfony3-config                 >= 3.3 +BuildRequires:  php-symfony3-http-kernel            >= 3.3 +BuildRequires:  php-Monolog                         >= 1.22 +%endif +# From composer.json, "require-dev": { +#        "symfony/yaml": "~2.7|~3.3|~4.0", +#        "symfony/console": "~2.7|~3.3|~4.0", +#        "symfony/phpunit-bridge": "^3.3|^4.0" +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >=8 +%global phpunit %{_bindir}/phpunit7 +BuildRequires: (php-composer(%{pk_vendor}/yaml)                 >= 2.7    with php-composer(%{pk_vendor}/yaml)                 < 5) +BuildRequires: (php-composer(%{pk_vendor}/console)              >= 2.7    with php-composer(%{pk_vendor}/console)              < 5) +BuildRequires: (php-composer(%{pk_vendor}/phpunit-bridge)       >= 2.7    with php-composer(%{pk_vendor}/phpunit-bridge)       < 5) +# remirepo:6 +%else +%global phpunit %{_bindir}/phpunit +BuildRequires:  php-symfony3-yaml                   >= 3.3 +BuildRequires:  php-symfony3-console                >= 3.3 +BuildRequires:  php-symfony3-phpunit-bridge         >= 3.3 +%endif +BuildRequires: %{phpunit} +# Autoloader +BuildRequires:  php-composer(fedora/autoloader) +%endif + +# From composer.json, "require": { +#        "php": ">=5.6", +#        "symfony/monolog-bridge": "~2.7|~3.3|~4.0", +#        "symfony/dependency-injection": "~2.7|~3.4.10|^4.0.10", +#        "symfony/config": "~2.7|~3.3|~4.0", +#        "symfony/http-kernel": "~2.7|~3.3|~4.0", +#        "monolog/monolog": "~1.22" +Requires:       php(language) >= 5.6 +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >=8 +Requires:      (php-composer(%{pk_vendor}/monolog-bridge)       >= 2.7    with php-composer(%{pk_vendor}/monolog-bridge)       < 5) +Requires:      (php-composer(%{pk_vendor}/dependency-injection) >= 2.7    with php-composer(%{pk_vendor}/dependency-injection) < 5) +Requires:      (php-composer(%{pk_vendor}/config)               >= 2.7    with php-composer(%{pk_vendor}/config)               < 5) +Requires:      (php-composer(%{pk_vendor}/http-kernel)          >= 2.7    with php-composer(%{pk_vendor}/http-kernel)          < 5) +Requires:      (php-composer(monolog/monolog)                   >= 1.22   with php-composer(monolog/monolog)                   < 2) +# remirepo:7 +%else +Requires:       php-symfony3-monolog-bridge         >= 3.3 +Requires:       php-symfony3-dependency-injection   >= 3.3 +Requires:       php-symfony3-config                 >= 3.3 +Requires:       php-symfony3-http-kernel            >= 3.3 +Requires:       php-Monolog                         >= 1.22 +%endif +# From phpcompatinfo report for version 3.3.1 +Requires:       php-json +Requires:       php-pcre +Requires:       php-spl +# Autoloader +Requires:       php-composer(fedora/autoloader) + +Provides:       php-composer(%{pk_vendor}/%{pk_project}) = %{version} + + +%description +The MonologBundle provides integration of the Monolog library +into the Symfony framework. + +Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_sub}/%{ns_project}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + + +%build +: Create autoloader +cat <<'AUTOLOAD' | tee autoload.php +<?php +/* Autoloader for %{name} and its dependencies */ +require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php'; + +\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_sub}\\%{ns_project}\\', __DIR__); +\Fedora\Autoloader\Dependencies::required([ +    [ +        '%{_datadir}/php/Symfony4/Bridge/Monolog/autoload.php', +        '%{_datadir}/php/Symfony3/Bridge/Monolog/autoload.php', +        '%{_datadir}/php/Symfony/Bridge/Monolog/autoload.php', +    ], +    [ +        '%{_datadir}/php/Symfony4/Component/DependencyInjection/autoload.php', +        '%{_datadir}/php/Symfony3/Component/DependencyInjection/autoload.php', +        '%{_datadir}/php/Symfony/Component/DependencyInjection/autoload.php', +    ], +    [ +        '%{_datadir}/php/Symfony4/Component/Config/autoload.php', +        '%{_datadir}/php/Symfony3/Component/Config/autoload.php', +        '%{_datadir}/php/Symfony/Component/Config/autoload.php', +    ], +    [ +        '%{_datadir}/php/Symfony4/Component/HttpKernel/autoload.php', +        '%{_datadir}/php/Symfony3/Component/HttpKernel/autoload.php', +        '%{_datadir}/php/Symfony/Component/HttpKernel/autoload.php', +    ], +    '%{_datadir}/php/Monolog/autoload.php', +]); +AUTOLOAD + + +%install +mkdir -p                   %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_sub}/%{ns_project} +for i in *php DependencyInjection Resources SwiftMailer +do +  cp -pr $i                 %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_sub}/%{ns_project}/$i +done + + +%check +%if %{with_tests} +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php +<?php +require_once '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_sub}/%{ns_project}/autoload.php'; +\Fedora\Autoloader\Dependencies::required([ +    [ +        '%{_datadir}/php/Symfony4/Component/Yaml/autoload.php', +        '%{_datadir}/php/Symfony3/Component/Yaml/autoload.php', +        '%{_datadir}/php/Symfony/Component/Yaml/autoload.php', +    ], [ +        '%{_datadir}/php/Symfony4/Component/Console/autoload.php', +        '%{_datadir}/php/Symfony3/Component/Console/autoload.php', +        '%{_datadir}/php/Symfony/Component/Console/autoload.php', +    ], [ +        '%{_datadir}/php/Symfony4/Bridge/PhpUnit/autoload.php', +        '%{_datadir}/php/Symfony3/Bridge/PhpUnit/autoload.php', +        '%{_datadir}/php/Symfony/Bridge/PhpUnit/autoload.php', +    ], +]); +EOF + +ret=0 +for cmd in php php71 php72 php73; do +  if which $cmd; then +    $cmd %{phpunit} \ +      --no-coverage \ +      --verbose +  fi +done +exit $ret +%else +: Test suite disabled +%endif + + +%files +# remirepo:1 +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc composer.json +%doc *.md +%dir %{php_home}/%{ns_vendor}/ +%dir %{php_home}/%{ns_vendor}/%{ns_sub} +     %{php_home}/%{ns_vendor}/%{ns_sub}/%{ns_project} + + +%changelog +* Wed Nov 28 2018 Remi Collet <remi@remirepo.net> - 3.3.1-1 +- initial package, version 3.3.1 | 
