]> git.pld-linux.org Git - packages/php-recaptcha.git/commitdiff
v1.1.2; switch to google/recaptcha library auto/th/php-recaptcha-1.1.2-1
authorElan Ruusamäe <glen@delfi.ee>
Thu, 15 Sep 2016 11:07:42 +0000 (14:07 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 15 Sep 2016 11:07:42 +0000 (14:07 +0300)
- package using google/recaptcha library
- previous library also package for some time

autoload.patch [new file with mode: 0644]
php-recaptcha.spec

diff --git a/autoload.patch b/autoload.patch
new file mode 100644 (file)
index 0000000..c71e817
--- /dev/null
@@ -0,0 +1,19 @@
+--- recaptcha-1.1.2/src/ReCaptcha/autoload.php~        2016-09-15 14:03:34.000000000 +0300
++++ recaptcha-1.1.2/src/ReCaptcha/autoload.php 2016-09-15 14:03:37.164579808 +0300
+@@ -23,15 +23,7 @@
+      * we look here first, so that we don't waste time searching for
+      * test classes in the common case.
+      */
+-    $path = dirname(__FILE__).'/'.$class.'.php';
+-    if (is_readable($path)) {
+-        require_once $path;
+-    }
+-
+-    /* If we didn't find what we're looking for already, maybe it's
+-     * a test class?
+-     */
+-    $path = dirname(__FILE__).'/../tests/'.$class.'.php';
++    $path = dirname(__DIR__).'/'.$class.'.php';
+     if (is_readable($path)) {
+         require_once $path;
+     }
index a07d604aff851a2cbdb5bfd7844c3a2e4e881076..d4d4f62143295f97ba2c0599ab12b2f20ce06163 100644 (file)
@@ -1,20 +1,27 @@
+%define                pkgname recaptcha
 %define                php_min_version 5.0.0
 %include       /usr/lib/rpm/macros.php
-Summary:       reCAPTCHA Library for PHP
-Name:          php-recaptcha
-Version:       1.11
-Release:       3
-License:       MIT
+Summary:       reCAPTCHA is a free service to protect your website from spam and abuse
+Name:          php-%{pkgname}
+Version:       1.1.2
+Release:       1
+Epoch:         1
+# google/recaptcha: BSD
+# recaptcha-php: MIT
+License:       BSD, MIT
 Group:         Development/Languages/PHP
-Source0:       http://recaptcha.googlecode.com/files/recaptcha-php-%{version}.zip
-# Source0-md5: 06dbb91aeb1869b3051d1b87dea0b891
-URL:           http://recaptcha.net/plugins/php/
+Source0:       https://github.com/google/recaptcha/archive/%{version}/%{pkgname}-%{version}.tar.gz
+# Source0-md5: 4528aeab04f7a22df4c1ec208b181b18
+Source1:       http://recaptcha.googlecode.com/files/recaptcha-php-1.11.zip
+# Source1-md5: 06dbb91aeb1869b3051d1b87dea0b891
+Patch0:                autoload.patch
+URL:           http://www.google.com/recaptcha/
 BuildRequires: rpm-php-pearprov >= 4.4.2-11
 BuildRequires: rpmbuild(macros) >= 1.520
 BuildRequires: unzip
 Requires:      php(core) >= %{php_min_version}
 Requires:      php(pcre)
-Suggests:      php-mcrypt
+Suggests:      php(mcrypt)
 BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -22,28 +29,41 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                _noautoreq      php-mcrypt
 
 %description
-Provides a CAPTCHA for PHP using the reCAPTCHA service.
-
-To use reCAPTCHA Mailhide, you need to have the mcrypt php module
-installed.
+reCAPTCHA is a free CAPTCHA service that protect websites from spam
+and abuse. This is Google authored code that provides plugins for
+third-party integration with reCAPTCHA.
 
 %prep
-%setup -q -n recaptcha-php-%{version}
+%setup -q -n recaptcha-%{version} -a1
+
+mv src/{,ReCaptcha/}autoload.php
+%patch0 -p1
+
+mv recaptcha-php-* recaptcha-php
+mv recaptcha-php/LICENSE{,.recaptcha-php}
+mv recaptcha-php/README{,.recaptcha-php}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{php_data_dir}
-cp -a recaptchalib.php $RPM_BUILD_ROOT%{php_data_dir}
+install -d $RPM_BUILD_ROOT{%{php_data_dir},%{_examplesdir}/%{name}-%{version}/recaptcha-php}
 
-# examples
-install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-cp -a example-*.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -a src/* $RPM_BUILD_ROOT%{php_data_dir}
+cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+# old package
+cd recaptcha-php
+cp -a recaptchalib.php $RPM_BUILD_ROOT%{php_data_dir}
+cp -a example-*.php $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/recaptcha-php
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc LICENSE README
-%{php_data_dir}/recaptchalib.php
+%doc README.md CONTRIBUTING.md LICENSE composer.json
+%{php_data_dir}/ReCaptcha
 %{_examplesdir}/%{name}-%{version}
+
+# old package contents
+%doc recaptcha-php/{LICENSE,README}.*
+%{php_data_dir}/recaptchalib.php
This page took 0.087231 seconds and 4 git commands to generate.