diff options
-rw-r--r-- | composer.json | 55 | ||||
-rwxr-xr-x | makesrc.sh | 28 | ||||
-rw-r--r-- | php-zendframework-zend-loader.spec | 55 |
3 files changed, 110 insertions, 28 deletions
diff --git a/composer.json b/composer.json index 73966b3..350f7c6 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,30 @@ { "name": "zendframework/zend-loader", - "description": " ", + "description": "Autoloading and plugin loading strategies", "license": "BSD-3-Clause", "keywords": [ - "zf2", + "zf", + "zendframework", "loader" ], - "homepage": "https://github.com/zendframework/zend-loader", - "autoload": { - "psr-4": { - "Zend\\Loader\\": "src/" - } + "support": { + "docs": "https://docs.zendframework.com/zend-loader/", + "issues": "https://github.com/zendframework/zend-loader/issues", + "source": "https://github.com/zendframework/zend-loader", + "rss": "https://github.com/zendframework/zend-loader/releases.atom", + "chat": "https://zendframework-slack.herokuapp.com", + "forum": "https://discourse.zendframework.com/c/questions/components" }, "require": { - "php": ">=5.3.23" + "php": "^5.6 || ^7.0" }, - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "branch-alias": { - "dev-master": "2.5-dev", - "dev-develop": "2.6-dev" + "require-dev": { + "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4", + "zendframework/zend-coding-standard": "~1.0.0" + }, + "autoload": { + "psr-4": { + "Zend\\Loader\\": "src/" } }, "autoload-dev": { @@ -28,8 +32,23 @@ "ZendTest\\Loader\\": "test/" } }, - "require-dev": { - "fabpot/php-cs-fixer": "1.7.*", - "phpunit/PHPUnit": "~4.0" + "config": { + "sort-packages": true + }, + "extra": { + "branch-alias": { + "dev-master": "2.6.x-dev", + "dev-develop": "2.7.x-dev" + } + }, + "scripts": { + "check": [ + "@cs-check", + "@test" + ], + "cs-check": "phpcs", + "cs-fix": "phpcbf", + "test": "phpunit --colors=always", + "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" } -}
\ No newline at end of file +} 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-loader.spec b/php-zendframework-zend-loader.spec index ed3842f..121c9cf 100644 --- a/php-zendframework-zend-loader.spec +++ b/php-zendframework-zend-loader.spec @@ -1,12 +1,12 @@ # remirepo/Fedora spec file for php-zendframework-zend-loader # -# Copyright (c) 2015-2017 Remi Collet +# Copyright (c) 2015-2018 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # -%global gh_commit c5fd2f071bde071f4363def7dea8dec7393e135c +%global gh_commit 78f11749ea340f6ca316bca5958eef80b38f9b6c %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner zendframework %global gh_project zend-loader @@ -15,28 +15,41 @@ %global with_tests 0%{!?_without_tests:1} Name: php-%{gh_owner}-%{gh_project} -Version: 2.5.1 -Release: 7%{?dist} +Version: 2.6.0 +Release: 1%{?dist} Summary: Zend Framework %{library} component Group: Development/Libraries License: BSD URL: https://zendframework.github.io/%{gh_project}/ -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz +Source0: %{gh_commit}/%{name}-%{version}-%{gh_short}.tgz Source1: %{name}-autoload.php +Source2: makesrc.sh BuildArch: noarch # Tests %if %{with_tests} -BuildRequires: php(language) >= 5.3.23 -BuildRequires: php-cli +BuildRequires: php(language) >= 5.6 +# From composer, "require-dev": { +# "phpbench/phpbench": "^0.13", +# "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1.4", +# "zendframework/zend-coding-standard": "~1.0.0" +# remirepo:1 +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 +%global phpunit %{_bindir}/phpunit7 +BuildRequires: phpunit7 >= 7.1.4 +# remirepo:4 +%else +%global phpunit %{_bindir}/phpunit6 +BuildRequires: phpunit >= 5.7.27 +%endif %endif # Autoloader BuildRequires: php-fedora-autoloader-devel # From composer, "require": { -# "php": ">=5.3.23" -Requires: php(language) >= 5.3.23 +# "php": "^5.6 || ^7.0" +Requires: php(language) >= 5.6 # Autoloader Requires: php-composer(fedora/autoloader) # From phpcompatinfo report for version 2.5.1 @@ -77,7 +90,6 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} %check -%if %{with_tests} : Deprecated autoloader %{_bindir}/php -r ' require "%{buildroot}%{php_home}/Zend/autoload.php"; @@ -88,6 +100,23 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} require "%{buildroot}%{php_home}/Zend/%{library}/autoload.php"; exit (class_exists("Zend\\Loader\\PluginClassLoader" ? 0 : 1)); ' + +%if %{with_tests} +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php +<?php +require_once '%{buildroot}%{php_home}/Zend/%{library}/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('ZendTest\\%{library}\\', dirname(__DIR__) . '/test'); +EOF + +ret=0 +for cmdarg in "php %{phpunit}" "php56 %{_bindir}/phpunit" "php70 %{_bindir}/phpunit6" php71 php72; do + if which $cmdarg; then + set $cmdarg + $1 ${2:-%{_bindir}/phpunit7} --verbose || ret=1 + fi +done +exit $ret %else : Test suite disabled %endif @@ -104,6 +133,12 @@ cp -pr src %{buildroot}%{php_home}/Zend/%{library} %changelog +* Wed May 2 2018 Remi Collet <remi@remirepo.net> - 2.6.0-1 +- update to 2.6.0 +- raise dependency on PHP 5.6 +- run upstream test suite +- sources from git snapshot + * Wed Dec 6 2017 Remi Collet <remi@remirepo.net> - 2.5.1-7 - use fedora/autoloader |