[packages/php-recaptcha] v1.1.2; switch to google/recaptcha library
glen
glen at pld-linux.org
Thu Sep 15 13:09:08 CEST 2016
commit db2a77e6babfc0da795934d05359756338e591a3
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Thu Sep 15 14:07:42 2016 +0300
v1.1.2; switch to google/recaptcha library
- package using google/recaptcha library
- previous library also package for some time
autoload.patch | 19 +++++++++++++++++
php-recaptcha.spec | 62 ++++++++++++++++++++++++++++++++++++------------------
2 files changed, 60 insertions(+), 21 deletions(-)
---
diff --git a/php-recaptcha.spec b/php-recaptcha.spec
index a07d604..d4d4f62 100644
--- a/php-recaptcha.spec
+++ b/php-recaptcha.spec
@@ -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
diff --git a/autoload.patch b/autoload.patch
new file mode 100644
index 0000000..c71e817
--- /dev/null
+++ b/autoload.patch
@@ -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;
+ }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-recaptcha.git/commitdiff/db2a77e6babfc0da795934d05359756338e591a3
More information about the pld-cvs-commit
mailing list