diff options
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | composer.json | 53 | ||||
-rw-r--r-- | php-symfony-contracts2.spec | 199 | ||||
-rw-r--r-- | src/Cache/composer.json | 38 | ||||
-rw-r--r-- | src/EventDispatcher/composer.json | 38 | ||||
-rw-r--r-- | src/HttpClient/composer.json | 37 | ||||
-rw-r--r-- | src/Service/composer.json | 38 | ||||
-rw-r--r-- | src/Translation/composer.json | 37 |
9 files changed, 460 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..63d3b51 --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + +composer: + tar xf $(shell spectool -l $(NAME).spec | head -n 1 | sed -e 's:.* ::' | sed -e 's:.*/::') --strip-components=1 '*/composer.json' + test -d Cache && mv Cache/composer.json src/Cache && rmdir Cache + test -d EventDispatcher && mv EventDispatcher/composer.json src/EventDispatcher && rmdir EventDispatcher + test -d HttpClient && mv HttpClient/composer.json src/HttpClient && rmdir HttpClient + test -d Service && mv Service/composer.json src/Service && rmdir Service + test -d Translation && mv Translation/composer.json src/Translation && rmdir Translation + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..4ac096e --- /dev/null +++ b/composer.json @@ -0,0 +1,53 @@ +{ + "name": "symfony/contracts", + "type": "library", + "description": "A set of abstractions extracted out of the Symfony components", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1.3", + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "require-dev": { + "symfony/polyfill-intl-idn": "^1.10" + }, + "replace": { + "symfony/cache-contracts": "self.version", + "symfony/event-dispatcher-contracts": "self.version", + "symfony/http-client-contracts": "self.version", + "symfony/service-contracts": "self.version", + "symfony/translation-contracts": "self.version" + }, + "suggest": { + "psr/event-dispatcher": "When using the EventDispatcher contracts", + "symfony/cache-implementation": "", + "symfony/event-dispatcher-implementation": "", + "symfony/http-client-implementation": "", + "symfony/service-implementation": "", + "symfony/translation-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\": "" }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + } +} diff --git a/php-symfony-contracts2.spec b/php-symfony-contracts2.spec new file mode 100644 index 0000000..c8c2986 --- /dev/null +++ b/php-symfony-contracts2.spec @@ -0,0 +1,199 @@ +# remirepo/fedora spec file for php-symfony-contracts +# +# Copyright (c) 2019 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global gh_commit 011c20407c4b99d454f44021d023fb39ce23b73d +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner symfony +%global gh_project contracts +# Packagist +%global pk_vendor %{gh_owner} +%global pk_project %{gh_project} +# Namespace +%global ns_vendor Symfony +%global ns_project Contracts +%global php_home %{_datadir}/php +# Test +%global with_tests 0%{!?_without_tests:1} + +Name: php-%{pk_vendor}-%{pk_project} +Version: 1.1.10 +Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist} +Summary: A set of abstractions extracted out of the Symfony + +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) >= 7.1.3 +BuildRequires: php-reflection +BuildRequires: php-json +BuildRequires: php-pcre +BuildRequires: php-spl +BuildRequires: php-intl +# From composer.json, "require-dev": { +# "symfony/polyfill-intl-idn": "^1.10" +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >=8 +BuildRequires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2) +BuildRequires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2) +# remirepo:4 +%else +BuildRequires: php-psr-cache +BuildRequires: php-psr-container +%endif +%global phpunit %{_bindir}/phpunit7 +BuildRequires: %{phpunit} +# Autoloader +BuildRequires: php-composer(fedora/autoloader) +%endif + +# From composer.json, "require": { +# "php": ">=7.1.3" +# "psr/cache": "^1.0", +# "psr/container": "^1.0" +Requires: php(language) >= 7.1.3 +# From composer.json, "suggest": { +# "psr/event-dispatcher": "When using the EventDispatcher contracts", +# "symfony/cache-implementation": "", +# "symfony/event-dispatcher-implementation": "", +# "symfony/http-client-implementation": "", +# "symfony/service-implementation": "", +# "symfony/translation-implementation": "" +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >=8 +Requires: (php-composer(psr/cache) >= 1.0 with php-composer(psr/cache) < 2) +Requires: (php-composer(psr/container) >= 1.0 with php-composer(psr/container) < 2) +Recommends: (php-composer(psr/event-dispatcher) >= 1.0 with php-composer(psr/event-dispatcher) < 2) +# remirepo:5 +%else +Requires: php-psr-cache +Requires: php-psr-container +Requires: php-psr-event-dispatcher +%endif +# From phpcompatinfo report for version 1.1.0 +Requires: php-reflection +Requires: php-json +Requires: php-pcre +Requires: php-spl +Requires: php-intl +# Autoloader +Requires: php-composer(fedora/autoloader) + +Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version} +Provides: php-composer(%{pk_vendor}/cache-contracts) = %{version} +Provides: php-composer(%{pk_vendor}/event-dispatcher-contracts) = %{version} +Provides: php-composer(%{pk_vendor}/http-client-contracts) = %{version} +Provides: php-composer(%{pk_vendor}/service-contracts) = %{version} +Provides: php-composer(%{pk_vendor}/translation-contracts) = %{version} + + +%description +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components +proved useful - and that already have battle tested implementations. + +Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +for i in */composer.json */LICENSE */README.md +do + mv $i $(dirname $i)_$(basename $i) +done + + +%build +: Create autoloader +cat <<'AUTOLOAD' | tee autoload.php +<?php +/* Autoloader for %{name} and its dependencies */ +require_once '%{php_home}/Fedora/Autoloader/autoload.php'; + +\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\', __DIR__); +\Fedora\Autoloader\Dependencies::optional([ + '%{php_home}/Psr/Cache/autoload.php', + '%{php_home}/Psr/Container/autoload.php', + '%{php_home}/Psr/EventDispatcher/autoload.php', +]); +AUTOLOAD + + +%install +mkdir -p %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project} +for i in autoload.php Cache EventDispatcher HttpClient Service Translation +do + rm -f $i/.gitignore + cp -pr $i %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/$i +done + + +%check +%if %{with_tests} +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php +<?php +require_once '%{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php'; +EOF + +ret=0 +for cmd in php php71 php72 php73 php74; 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}/ + %{php_home}/%{ns_vendor}/%{ns_project} + + +%changelog +* Wed Sep 9 2020 Remi Collet <remi@remirepo.net> - 1.1.10-1 +- update to 1.1.10 + +* Thu Nov 21 2019 Remi Collet <remi@remirepo.net> - 1.1.8-1 +- update to 1.1.8 +- psr/cache and psr/container are mandatory + +* Tue Nov 5 2019 Remi Collet <remi@remirepo.net> - 1.1.7-1 +- update to 1.1.7 +- add missing EventDispatcher and HttpClient directories +- add weak dependency on psr/event-dispatcher + +* Thu Jun 6 2019 Remi Collet <remi@remirepo.net> - 1.1.3-1 +- update to 1.1.3 + +* Mon Jun 3 2019 Remi Collet <remi@remirepo.net> - 1.1.2-1 +- update to 1.1.2 (no change) + +* Tue May 28 2019 Remi Collet <remi@remirepo.net> - 1.1.1-1 +- update to 1.1.1 + +* Thu May 16 2019 Remi Collet <remi@remirepo.net> - 1.1.0-1 +- update to 1.1.0 + +* Mon Jan 7 2019 Remi Collet <remi@remirepo.net> - 1.0.2-1 +- initial package, version 1.0.2 diff --git a/src/Cache/composer.json b/src/Cache/composer.json new file mode 100644 index 0000000..97eabec --- /dev/null +++ b/src/Cache/composer.json @@ -0,0 +1,38 @@ +{ + "name": "symfony/cache-contracts", + "type": "library", + "description": "Generic abstractions related to caching", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1.3", + "psr/cache": "^1.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Cache\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/src/EventDispatcher/composer.json b/src/EventDispatcher/composer.json new file mode 100644 index 0000000..862c256 --- /dev/null +++ b/src/EventDispatcher/composer.json @@ -0,0 +1,38 @@ +{ + "name": "symfony/event-dispatcher-contracts", + "type": "library", + "description": "Generic abstractions related to dispatching event", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1.3" + }, + "suggest": { + "psr/event-dispatcher": "", + "symfony/event-dispatcher-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\EventDispatcher\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/src/HttpClient/composer.json b/src/HttpClient/composer.json new file mode 100644 index 0000000..2382aa7 --- /dev/null +++ b/src/HttpClient/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/http-client-contracts", + "type": "library", + "description": "Generic abstractions related to HTTP clients", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1.3" + }, + "suggest": { + "symfony/http-client-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\HttpClient\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/src/Service/composer.json b/src/Service/composer.json new file mode 100644 index 0000000..58748f3 --- /dev/null +++ b/src/Service/composer.json @@ -0,0 +1,38 @@ +{ + "name": "symfony/service-contracts", + "type": "library", + "description": "Generic abstractions related to writing services", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1.3", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Service\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/src/Translation/composer.json b/src/Translation/composer.json new file mode 100644 index 0000000..7a449e0 --- /dev/null +++ b/src/Translation/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/translation-contracts", + "type": "library", + "description": "Generic abstractions related to translation", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.1.3" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Translation\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} |