From e3cd194f8431e9d0de84051528f6661f6e79c388 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Jul 2016 20:05:25 +0200 Subject: php-zendframework-zend-expressive-zendrouter: 1.1.0 (New Package) --- Makefile | 3 + composer.json | 50 +++++++ makesrc.sh | 28 ++++ ...dframework-zend-expressive-zendrouter-pr7.patch | 113 +++++++++++++++ php-zendframework-zend-expressive-zendrouter.spec | 159 +++++++++++++++++++++ ...ndframework-zend-expressive-zendviewrouter.spec | 157 ++++++++++++++++++++ 6 files changed, 510 insertions(+) create mode 100644 Makefile create mode 100644 composer.json create mode 100755 makesrc.sh create mode 100644 php-zendframework-zend-expressive-zendrouter-pr7.patch create mode 100644 php-zendframework-zend-expressive-zendrouter.spec create mode 100644 php-zendframework-zend-expressive-zendviewrouter.spec diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a2cd659 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..210cf0d --- /dev/null +++ b/composer.json @@ -0,0 +1,50 @@ +{ + "name": "zendframework/zend-expressive-zendrouter", + "description": "zend-mvc router support for Expressive", + "type": "library", + "license": "BSD-3-Clause", + "keywords": [ + "expressive", + "http", + "middleware", + "psr", + "psr-7", + "zf2" + ], + "extra": { + "branch-alias": { + "dev-master": "1.1-dev", + "dev-develop": "1.2-dev" + } + }, + "require": { + "php": "^5.5 || ^7.0", + "psr/http-message": "^1.0", + "zendframework/zend-expressive-router": "^1.0", + "zendframework/zend-router": "^2.5", + "zendframework/zend-psr7bridge": "^0.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.7", + "squizlabs/php_codesniffer": "^2.3" + }, + "autoload": { + "psr-4": { + "Zend\\Expressive\\Router\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendTest\\Expressive\\Router\\": "test/" + } + }, + "scripts": { + "check": [ + "@cs", + "@test" + ], + "cs": "phpcs", + "cs-fix": "phpcbf", + "test": "phpunit" + } +} diff --git a/makesrc.sh b/makesrc.sh new file mode 100755 index 0000000..87d223d --- /dev/null +++ b/makesrc.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +NAME=$(basename $PWD) +OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec) +PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec) +VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec) +COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec) +SHORT=${COMMIT:0:7} + +echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION\n" + +echo "Cloning..." +rm -rf $PROJECT-$COMMIT +git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT + +echo "Getting commit..." +pushd $PROJECT-$COMMIT +git checkout $COMMIT +cp composer.json ../composer.json +popd + +echo "Archiving..." +tar czf $NAME-$VERSION-$SHORT.tgz --exclude .git $PROJECT-$COMMIT + +echo "Cleaning..." +rm -rf $PROJECT-$COMMIT + +echo "Done." diff --git a/php-zendframework-zend-expressive-zendrouter-pr7.patch b/php-zendframework-zend-expressive-zendrouter-pr7.patch new file mode 100644 index 0000000..3a24d1b --- /dev/null +++ b/php-zendframework-zend-expressive-zendrouter-pr7.patch @@ -0,0 +1,113 @@ +From 05be4a48f85f8ac5b39fd4db5984aa4ec7d4ae23 Mon Sep 17 00:00:00 2001 +From: gabbydgab +Date: Tue, 7 Jun 2016 10:34:50 +0800 +Subject: [PATCH 1/3] upgrade versions and fix test + +--- + composer.json | 12 ++++++------ + src/ZendRouter.php | 4 ++-- + test/ZendRouterTest.php | 4 ++-- + 3 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/composer.json b/composer.json +index 210cf0d..9a0cf73 100644 +--- a/composer.json ++++ b/composer.json +@@ -18,15 +18,15 @@ + } + }, + "require": { +- "php": "^5.5 || ^7.0", ++ "php": "^5.6 || ^7.0", + "psr/http-message": "^1.0", +- "zendframework/zend-expressive-router": "^1.0", +- "zendframework/zend-router": "^2.5", +- "zendframework/zend-psr7bridge": "^0.2.0" ++ "zendframework/zend-expressive-router": "^1.2", ++ "zendframework/zend-router": "^3.0", ++ "zendframework/zend-psr7bridge": "^0.2.2" + }, + "require-dev": { +- "phpunit/phpunit": "^4.7", +- "squizlabs/php_codesniffer": "^2.3" ++ "phpunit/phpunit": "^5.4", ++ "squizlabs/php_codesniffer": "^2.4" + }, + "autoload": { + "psr-4": { +diff --git a/src/ZendRouter.php b/src/ZendRouter.php +index 36321ee..70913b0 100644 +--- a/src/ZendRouter.php ++++ b/src/ZendRouter.php +@@ -11,8 +11,8 @@ + + use Psr\Http\Message\ServerRequestInterface as PsrRequest; + use Zend\Expressive\Exception; +-use Zend\Mvc\Router\Http\TreeRouteStack; +-use Zend\Mvc\Router\RouteMatch; ++use Zend\Router\Http\TreeRouteStack; ++use Zend\Router\RouteMatch; + use Zend\Psr7Bridge\Psr7ServerRequest; + + /** +diff --git a/test/ZendRouterTest.php b/test/ZendRouterTest.php +index 7dfea92..d1450a6 100644 +--- a/test/ZendRouterTest.php ++++ b/test/ZendRouterTest.php +@@ -16,8 +16,8 @@ + use Zend\Expressive\Router\RouteResult; + use Zend\Expressive\Router\ZendRouter; + use Zend\Http\Request as ZendRequest; +-use Zend\Mvc\Router\Http\TreeRouteStack; +-use Zend\Mvc\Router\RouteMatch; ++use Zend\Router\Http\TreeRouteStack; ++use Zend\Router\RouteMatch; + + class ZendRouterTest extends TestCase + { + +From e97ff9cb611b658ae9df3105ca06d4c3488643f4 Mon Sep 17 00:00:00 2001 +From: gabbydgab +Date: Tue, 7 Jun 2016 10:45:14 +0800 +Subject: [PATCH 2/3] revert php version + +--- + composer.json | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/composer.json b/composer.json +index 9a0cf73..3c895ad 100644 +--- a/composer.json ++++ b/composer.json +@@ -18,7 +18,7 @@ + } + }, + "require": { +- "php": "^5.6 || ^7.0", ++ "php": "^5.5 || ^7.0", + "psr/http-message": "^1.0", + "zendframework/zend-expressive-router": "^1.2", + "zendframework/zend-router": "^3.0", + +From 1bd0c52c7d3f5227af470ac9c19524d17274c36a Mon Sep 17 00:00:00 2001 +From: gabbydgab +Date: Tue, 7 Jun 2016 10:54:50 +0800 +Subject: [PATCH 3/3] revert phpunit version + +--- + composer.json | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/composer.json b/composer.json +index 3c895ad..626b2d7 100644 +--- a/composer.json ++++ b/composer.json +@@ -25,7 +25,7 @@ + "zendframework/zend-psr7bridge": "^0.2.2" + }, + "require-dev": { +- "phpunit/phpunit": "^5.4", ++ "phpunit/phpunit": "^4.8", + "squizlabs/php_codesniffer": "^2.4" + }, + "autoload": { diff --git a/php-zendframework-zend-expressive-zendrouter.spec b/php-zendframework-zend-expressive-zendrouter.spec new file mode 100644 index 0000000..e5900d1 --- /dev/null +++ b/php-zendframework-zend-expressive-zendrouter.spec @@ -0,0 +1,159 @@ +# remirepo/Fedora spec file for php-zendframework-zend-expressive-zendrouter +# +# Copyright (c) 2016 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global bootstrap 0 +%global gh_commit 0fd6c5f6b22b614960a94beceaa58742444f84b4 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner zendframework +%global gh_project zend-expressive-zendrouter +%global php_home %{_datadir}/php +%global library Expressive +%global sublib Router +%if %{bootstrap} +%global with_tests 0%{?_with_tests:1} +%else +%global with_tests 0%{!?_without_tests:1} +%endif + +Name: php-%{gh_owner}-%{gh_project} +Version: 1.1.0 +Release: 1%{?dist} +Summary: zend-mvc router support for %{library} + +Group: Development/Libraries +License: BSD +URL: https://framework.zend.com/ +Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz +Source1: makesrc.sh + +# to allow ZF3 and raise dependencies +Patch0: %{name}-pr7.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildArch: noarch +# Tests +%if %{with_tests} +BuildRequires: php(language) >= 5.6 +BuildRequires: php-composer(psr/http-message) >= 1.0 +BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.2 +BuildRequires: php-composer(%{gh_owner}/zend-router) >= 3.0 +BuildRequires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.2 +BuildRequires: php-pcre +# From composer, "require-dev": { +# "phpunit/phpunit": "^4.7", +# "squizlabs/php_codesniffer": "^2.3" +BuildRequires: php-composer(phpunit/phpunit) >= 4.7 +%endif + +# From composer, "require": { +# "php": "^5.6 || ^7.0", +# "psr/http-message": "^1.0", +# "zendframework/zend-expressive-router": "^1.2", +# "zendframework/zend-router": "^3.0", +# "zendframework/zend-psr7bridge": "^0.2.2" +Requires: php(language) >= 5.6 +Requires: php-composer(psr/http-message) >= 1.0 +Requires: php-composer(psr/http-message) < 2 +Requires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.2 +Requires: php-composer(%{gh_owner}/zend-expressive-router) < 2 +Requires: php-composer(%{gh_owner}/zend-router) >= 3.0 +Requires: php-composer(%{gh_owner}/zend-router) < 4 +Requires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.2 +# From phpcompatinfo report for version 1.2.0 +Requires: php-pcre +%if ! %{bootstrap} +# Autoloader +Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5 +%endif + +Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} + + +%description +Provides ZF2's MVC router integration for zend-expressive. + +Documentation: +https://zendframework.github.io/zend-expressive/features/router/zf2/ + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +%patch0 -p1 + +mv LICENSE.md LICENSE + +# psr/http-message load by zend-expressive-router + + +%build +# Empty build section, nothing required + + +%install +rm -rf %{buildroot} + +mkdir -p %{buildroot}%{php_home}/Zend/%{library} +cp -pr src %{buildroot}%{php_home}/Zend/%{library}/%{sublib} + + +%check +%if %{with_tests} +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php + array( + 'namespaces' => array( + 'ZendTest\\%{library}\\%{sublib}' => dirname(__DIR__).'/test/', + 'Zend\\%{library}\\%{sublib}' => '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}' +)))); +require_once '%{php_home}/Zend/autoload.php'; +EOF + +# remirepo:11 +run=0 +ret=0 +if which php56; then + php56 %{_bindir}/phpunit --verbose || ret=1 + run=1 +fi +if which php71; then + php70 %{_bindir}/phpunit --verbose || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then +%{_bindir}/phpunit --verbose +# remirepo:2 +fi +exit $ret +%else +: Test suite disabled +%endif + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc *.md +%doc composer.json +%{php_home}/Zend/%{library}/%{sublib}/Zend* + + +%changelog +* Fri Jul 1 2016 Remi Collet - 1.1.0-1 +- initial package + diff --git a/php-zendframework-zend-expressive-zendviewrouter.spec b/php-zendframework-zend-expressive-zendviewrouter.spec new file mode 100644 index 0000000..b2f9c85 --- /dev/null +++ b/php-zendframework-zend-expressive-zendviewrouter.spec @@ -0,0 +1,157 @@ +# remirepo/Fedora spec file for php-zendframework-zend-expressive-zendrouter +# +# Copyright (c) 2016 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global bootstrap 0 +%global gh_commit 0fd6c5f6b22b614960a94beceaa58742444f84b4 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner zendframework +%global gh_project zend-expressive-zendrouter +%global php_home %{_datadir}/php +%global library Expressive +%global sublib Router +%if %{bootstrap} +%global with_tests 0%{?_with_tests:1} +%else +%global with_tests 0%{!?_without_tests:1} +%endif + +Name: php-%{gh_owner}-%{gh_project} +Version: 1.1.0 +Release: 1%{?dist} +Summary: zend-mvc router support for %{library} + +Group: Development/Libraries +License: BSD +URL: https://framework.zend.com/ +Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz +Source1: makesrc.sh + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +BuildArch: noarch +# Tests +%if %{with_tests} +BuildRequires: php(language) >= 5.5 +BuildRequires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.0 +BuildRequires: php-composer(%{gh_owner}/zend-router) >= 2.5 +BuildRequires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.0 +BuildRequires: php-pcre +# From composer, "require-dev": { +# "phpunit/phpunit": "^4.7", +# "squizlabs/php_codesniffer": "^2.3" +BuildRequires: php-composer(phpunit/phpunit) >= 4.7 +# Autoloader +BuildRequires: php-composer(%{gh_owner}/zend-loader) >= 2.5 +%endif + +# From composer, "require": { +# "php": "^5.5 || ^7.0", +# "psr/http-message": "^1.0", +# "zendframework/zend-expressive-router": "^1.0", +# "zendframework/zend-router": "^2.5", +# "zendframework/zend-psr7bridge": "^0.2.0" +Requires: php(language) >= 5.5 +Requires: php-composer(psr/http-message) >= 1.0 +Requires: php-composer(psr/http-message) < 2 +Requires: php-composer(%{gh_owner}/zend-expressive-router) >= 1.0 +Requires: php-composer(%{gh_owner}/zend-expressive-router) < 2 +Requires: php-composer(%{gh_owner}/zend-router) >= 2.5 +Requires: php-composer(%{gh_owner}/zend-router) < 3 +Requires: php-composer(%{gh_owner}/zend-psr7bridge) >= 0.2.0 +Requires: php-composer(%{gh_owner}/zend-psr7bridge) < 1 +# From phpcompatinfo report for version 1.2.0 +Requires: php-pcre +%if ! %{bootstrap} +# Autoloader +Requires: php-composer(%{gh_owner}/zend-loader) >= 2.5 +Requires: php-zendframework-zend-loader >= 2.5.1-3 +%endif + +Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version} + + +%description +Provides ZF2's MVC router integration for zend-expressive. + +Documentation: +https://zendframework.github.io/zend-expressive/features/router/zf2/ + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +mv LICENSE.md LICENSE + +# psr/http-message load by zend-expressive-router + + +%build +# Empty build section, nothing required + + +%install +rm -rf %{buildroot} + +mkdir -p %{buildroot}%{php_home}/Zend/%{library} +cp -pr src %{buildroot}%{php_home}/Zend/%{library}/%{sublib} + + +%check +%if %{with_tests} +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php + array( + 'namespaces' => array( + 'ZendTest\\%{library}\\%{sublib}' => dirname(__DIR__).'/test/', + 'Zend\\%{library}\\%{sublib}' => '%{buildroot}%{php_home}/Zend/%{library}/%{sublib}' +)))); +require_once '%{php_home}/Zend/autoload.php'; +EOF + +# remirepo:11 +run=0 +ret=0 +if which php56; then + php56 %{_bindir}/phpunit --verbose || ret=1 + run=1 +fi +if which php71; then + php70 %{_bindir}/phpunit --verbose || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then +%{_bindir}/phpunit --verbose +# remirepo:2 +fi +exit $ret +%else +: Test suite disabled +%endif + + +%clean +rm -rf %{buildroot} + + +%files +%defattr(-,root,root,-) +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc *.md +%doc composer.json +%{php_home}/Zend/%{library}/%{sublib}/Zend* + + +%changelog +* Fri Jul 1 2016 Remi Collet - 1.1.0-1 +- initial package + -- cgit