diff options
-rw-r--r-- | composer.json | 41 | ||||
-rw-r--r-- | php-zendframework-zendservice-recaptcha-autoload.php | 2 | ||||
-rw-r--r-- | php-zendframework-zendservice-recaptcha.spec | 86 |
3 files changed, 95 insertions, 34 deletions
diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2a53f91 --- /dev/null +++ b/composer.json @@ -0,0 +1,41 @@ +{ + "name": "zendframework/zendservice-recaptcha", + "description": "OOP wrapper for the ReCaptcha web service", + "type": "library", + "keywords": [ + "zf2", + "recaptcha" + ], + "homepage": "http://packages.zendframework.com/", + "license": "BSD-3-Clause", + "autoload": { + "psr-4": { + "ZendService\\ReCaptcha\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "ZendServiceTest\\ReCaptcha\\": "test/" + } + }, + "require": { + "php": "^5.6 || ^7.0", + "zendframework/zend-http": "^2.5.4", + "zendframework/zend-json": "^2.6.1 || ^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0", + "zendframework/zend-coding-standard": "~1.0.0", + "zendframework/zend-config": "^2.0", + "zendframework/zend-validator": "^2.8.2" + }, + "suggest": { + "zendframework/zend-validator": "~2.0, if using ReCaptcha's Mailhide API" + }, + "extra": { + "branch-alias": { + "dev-master": "3.0-dev", + "dev-develop": "3.1-dev" + } + } +} diff --git a/php-zendframework-zendservice-recaptcha-autoload.php b/php-zendframework-zendservice-recaptcha-autoload.php index a0a7585..65a608b 100644 --- a/php-zendframework-zendservice-recaptcha-autoload.php +++ b/php-zendframework-zendservice-recaptcha-autoload.php @@ -6,7 +6,7 @@ Inspired from https://github.com/zendframework/ZendSkeletonApplication Set autoregister_zf for Zend Framework Set fallback_autoloader for dependencies which are PSR-0 compliant */ -require_once '/usr/share/php/Zend//Loader/AutoloaderFactory.php'; +require_once '/usr/share/php/Zend/Loader/AutoloaderFactory.php'; Zend\Loader\AutoloaderFactory::factory(array( 'Zend\Loader\StandardAutoloader' => array( 'fallback_autoloader' => true, diff --git a/php-zendframework-zendservice-recaptcha.spec b/php-zendframework-zendservice-recaptcha.spec index a9858b9..379b0df 100644 --- a/php-zendframework-zendservice-recaptcha.spec +++ b/php-zendframework-zendservice-recaptcha.spec @@ -6,7 +6,7 @@ # # Please, preserve the changelog entries # -%global gh_commit 4324cca8502d9f47b3b43a18acdd3fdbeb965536 +%global gh_commit 6c6877c07c8ac73b187911ea5d264a640b234361 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner zendframework %global gh_project ZendService_ReCaptcha @@ -16,11 +16,8 @@ %global library ReCaptcha %global with_tests 0%{!?_without_tests:1} -############# TODO seems dead / unmaintained - last commit in 2012 ######### - - Name: php-%{gh_owner}-%{pk_project} -Version: 2.0.1 +Version: 3.0.0 Release: 1%{?dist} Summary: Zend Framework %{library} component @@ -35,27 +32,38 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch # Tests %if %{with_tests} -BuildRequires: php(language) >= 5.3.3 -BuildRequires: php-mcrypt -BuildRequires: php-composer(phpunit/phpunit) -BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.0.0 -BuildRequires: php-composer(%{gh_owner}/zend-uri) >= 2.0.0 -BuildRequires: php-composer(%{gh_owner}/zend-version) >= 2.0.0 +BuildRequires: php(language) >= 5.6 +BuildRequires: php-json +BuildRequires: php-composer(%{gh_owner}/zend-http) >= 2.5.4 +BuildRequires: php-composer(%{gh_owner}/zend-json) >= 2.6.1 +# From composer.json, "require-dev": { +# "phpunit/phpunit": "^5.7 || ^6.0", +# "zendframework/zend-coding-standard": "~1.0.0", +# "zendframework/zend-config": "^2.0", +# "zendframework/zend-validator": "^2.8.2" +BuildRequires: php-composer(phpunit/phpunit) >= 5.7 +BuildRequires: php-composer(%{gh_owner}/zend-config) >= 2.0 +BuildRequires: php-composer(%{gh_owner}/zend-validator) >= 2.8.2 # Autoloader BuildRequires: php-composer(%{gh_owner}/zend-loader) %endif # From composer, "require": { -# "php": ">=5.3.3", -# "zendframework/zend-http": ">=2.0.0", -# "zendframework/zend-uri": ">=2.0.0", -# "zendframework/zend-version": ">=2.0.0" -Requires: php(language) >= 5.3.3 -Requires: php-composer(%{gh_owner}/zend-http) >= 2.0.0 -Requires: php-composer(%{gh_owner}/zend-uri) >= 2.0.0 -Requires: php-composer(%{gh_owner}/zend-version) >= 2.0.0 -# From phpcompatinfo report for version 2.0.1 -Requires: php-mcrypt +# "php": "^5.6 || ^7.0", +# "zendframework/zend-http": "^2.5.4", +# "zendframework/zend-json": "^2.6.1 || ^3.0" +Requires: php(language) >= 5.6 +Requires: php-composer(%{gh_owner}/zend-http) >= 2.5.4 +Requires: php-composer(%{gh_owner}/zend-http) < 3 +Requires: php-composer(%{gh_owner}/zend-json) >= 2.6.1 +Requires: php-composer(%{gh_owner}/zend-json) < 4 +# From compsoer, "suggest": { +# "zendframework/zend-validator": "~2.0, if using ReCaptcha's Mailhide API" +%if 0%{?fedora} >= 21 +Suggests: php-composer(%{gh_owner}/zend-validator) +%endif +# From phpcompatinfo report for version 3.0.0 (mcrypt is optional) +Requires: php-json Provides: php-composer(%{gh_owner}/%{pk_project}) = %{version} @@ -67,7 +75,7 @@ Provides: php-composer(%{gh_owner}/%{pk_project}) = %{version} %prep %setup -q -n %{gh_project}-%{gh_commit} -mv LICENSE.txt LICENSE +mv LICENSE.md LICENSE %build @@ -77,8 +85,8 @@ mv LICENSE.txt LICENSE %install rm -rf %{buildroot} -mkdir -p %{buildroot}%{php_home} -cp -pr library/%{namespace} %{buildroot}%{php_home}/%{namespace} +mkdir -p %{buildroot}%{php_home}/%{namespace} +cp -pr src %{buildroot}%{php_home}/%{namespace}/%{library} install -pm 644 %{SOURCE2} %{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php @@ -88,16 +96,24 @@ install -pm 644 %{SOURCE2} %{buildroot}%{php_home}/%{namespace}/%{library}/auto mkdir vendor cat << EOF | tee vendor/autoload.php <?php -require_once '%{php_home}/Zend/Loader/AutoloaderFactory.php'; -Zend\\Loader\\AutoloaderFactory::factory(array( - 'Zend\\Loader\\StandardAutoloader' => array( - 'namespaces' => array( - 'ZendServiceTest\\\\%{library}' => dirname(__DIR__).'/tests/ZendServiceTest/ReCaptcha' -)))); require_once '%{buildroot}%{php_home}/%{namespace}/%{library}/autoload.php'; EOF -cd tests -%{_bindir}/phpunit --include-path=%{buildroot}%{php_home} +# remirepo:11 +run=0 +ret=0 +if which php56; then + php56 %{_bindir}/phpunit || ret=1 + run=1 +fi +if which php71; then + php70 %{_bindir}/phpunit6 || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then +%{_bindir}/phpunit --verbose +# remirepo:2 +fi +exit $ret %else : Test suite disabled %endif @@ -113,9 +129,13 @@ rm -rf %{buildroot} %license LICENSE %doc *.md %doc composer.json -%{php_home}/%{library} +%dir %{php_home}/%{namespace} + %{php_home}/%{namespace}/%{library} %changelog +* Mon Feb 20 2017 Remi Collet <remi@fedoraproject.org> - 3.0.0-1 +- update to 3.0.0 + * Thu Aug 6 2015 Remi Collet <remi@fedoraproject.org> - 2.0.1-1 - initial package |