[packages/php-google-api] up to 1.1.2

glen glen at pld-linux.org
Fri Jan 23 00:18:43 CET 2015


commit c28ab4f17f368bd8e2bd0a3176ecb577628745ec
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Jan 23 00:07:35 2015 +0200

    up to 1.1.2
    
    - php-5.2 support restored by upstream project

 gapi.patch          | 34 ++++++++++++++--------------------
 php-google-api.spec | 41 ++++++++++++++---------------------------
 php52.patch         | 23 ++++++++++++-----------
 3 files changed, 40 insertions(+), 58 deletions(-)
---
diff --git a/php-google-api.spec b/php-google-api.spec
index dc39091..73a0212 100644
--- a/php-google-api.spec
+++ b/php-google-api.spec
@@ -1,19 +1,16 @@
-# TODO
-# - make it possible to use user config (via local_config.php path)
-
 %define		php_min_version 5.2.2
 %include	/usr/lib/rpm/macros.php
 Summary:	Google APIs Client Library for PHP
 Name:		php-google-api
-Version:	0.6.7
-Release:	2
+Version:	1.1.2
+Release:	0.2
 License:	Apache v2.0
 Group:		Development/Languages/PHP
-Source0:	https://google-api-php-client.googlecode.com/files/google-api-php-client-%{version}.tar.gz
-# Source0-md5:	4ea330e08f91963b7b78fab25314abee
+Source0:	https://github.com/google/google-api-php-client/archive/%{version}/google-api-php-client-%{version}.tar.gz
+# Source0-md5:	44f2252aa279364236823fb3fc129d53
 Patch0:		php52.patch
 Patch1:		gapi.patch
-URL:		https://code.google.com/p/google-api-php-client/
+URL:		https://developers.google.com/api-client-library/php/
 BuildRequires:	rpm-php-pearprov >= 4.4.2-11
 BuildRequires:	rpmbuild(macros) >= 1.461
 BuildRequires:	sed >= 4.0
@@ -33,29 +30,19 @@ BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define		_noautoreq	%{?_noautophpreq} %{?_noautopear}
 
 %description
-The Google API Client Library enables you to work with Google APIs
-such as Analytics, Adsense, Google+, Calendar, Moderator, Tasks, or
-Latitude on your server.
+Google APIs Client Library for PHP provides access to many Google
+APIs. It is designed for PHP client-application developers and offers
+simple, flexible, powerful API access.
 
 %prep
-%setup -qc
-mv google-api-php-client/* .
+%setup -qn google-api-php-client-%{version}
 %patch0 -p1
-%patch1 -p8
-
-grep -rl require_once examples | xargs %{__sed} -i -e '
-	# fixup paths to source
-	/require_once/ s,\.\./\.\./src/,google-api/,
-	/require_once/ s,\.\./src/,google-api/,
-
-	# lower php requirement to 5.2
-	s,__DIR__,dirname(__FILE__),
-'
+%patch1 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_appdir}
-cp -a src/* $RPM_BUILD_ROOT%{_appdir}
+install -d $RPM_BUILD_ROOT%{php_data_dir}
+cp -a src/* $RPM_BUILD_ROOT%{php_data_dir}
 
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
@@ -65,6 +52,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc NOTICE README
-%{_appdir}
+%doc README.md CONTRIBUTING.md
+%{php_data_dir}/Google
 %{_examplesdir}/%{name}-%{version}
diff --git a/gapi.patch b/gapi.patch
index 3e4f1a2..28bc758 100644
--- a/gapi.patch
+++ b/gapi.patch
@@ -1,32 +1,27 @@
-# This patch file was generated by NetBeans IDE
-# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
-# It uses platform neutral UTF-8 encoding.
-# Above lines and this line are ignored by the patching process.
---- C:/Users/ANDRES/Desktop/google-api-php-client/src/auth/Google_AssertionCredentials.php
-+++ D:/xampp/htdocs/delfi/dgs/admin/library/gapi/src/auth/Google_AssertionCredentials.php
-@@ -50,7 +50,8 @@
-       $privateKey,
+--- google-api-php-client-1.1.2/src/Google/Auth/AssertionCredentials.php~	2015-01-22 23:53:16.000000000 +0200
++++ google-api-php-client-1.1.2/src/Google/Auth/AssertionCredentials.php	2015-01-22 23:53:18.426583026 +0200
+@@ -57,7 +57,8 @@
        $privateKeyPassword = 'notasecret',
        $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer',
--      $sub = false) {
-+      $sub = false,
-+      $signer = null) {
+       $sub = false,
+-      $useCache = true
++      $useCache = true,
++      $signer = null
+   ) {
      $this->serviceAccountName = $serviceAccountName;
      $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes);
-     $this->privateKey = $privateKey;
-@@ -58,6 +59,7 @@
-     $this->assertionType = $assertionType;
+@@ -67,6 +68,7 @@
      $this->sub = $sub;
      $this->prn = $sub;
+     $this->useCache = $useCache;
 +    $this->signer = $signer;
    }
- 
-   public function generateAssertion() {
-@@ -94,8 +96,20 @@
+   
+   /**
+@@ -127,8 +129,18 @@
      );
  
      $signingInput = implode('.', $segments);
-+
 +    if ($this->signer === 'phpseclib') {
 +       require_once 'Crypt/RSA.php';
 +       $rsa = new Crypt_RSA();
@@ -36,10 +31,9 @@
 +       $rsa->setHash('sha256');
 +       $signature = $rsa->sign($signingInput);
 +    } else {
-     $signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword);
+     $signer = new Google_Signer_P12($this->privateKey, $this->privateKeyPassword);
      $signature = $signer->sign($signingInput);
 +    }
-+
      $segments[] = Google_Utils::urlSafeB64Encode($signature);
  
      return implode(".", $segments);
diff --git a/php52.patch b/php52.patch
index ee1ccc2..d163125 100644
--- a/php52.patch
+++ b/php52.patch
@@ -1,13 +1,14 @@
---- php-google-api-0.6.1/src/auth/Google_P12Signer.php~	2013-02-28 06:07:44.000000000 +0200
-+++ php-google-api-0.6.1/src/auth/Google_P12Signer.php	2013-07-03 10:20:01.936330882 +0300
-@@ -58,10 +58,6 @@
-   }
+--- google-api-php-client-1.1.2/src/Google/Signer/P12.php~	2014-11-25 16:35:03.000000000 +0200
++++ google-api-php-client-1.1.2/src/Google/Signer/P12.php	2015-01-22 23:49:13.673899323 +0200
+@@ -76,11 +76,6 @@
  
-   function sign($data) {
--    if(version_compare(PHP_VERSION, '5.3.0') < 0) {
--      throw new Google_AuthException(
--        "PHP 5.3.0 or higher is required to use service accounts.");
+   public function sign($data)
+   {
+-    if (version_compare(PHP_VERSION, '5.3.0') < 0) {
+-      throw new Google_Auth_Exception(
+-          "PHP 5.3.0 or higher is required to use service accounts."
+-      );
 -    }
-     if (!openssl_sign($data, $signature, $this->privateKey, "sha256")) {
-       throw new Google_AuthException("Unable to sign data");
-     }
+     $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256";
+     if (!openssl_sign($data, $signature, $this->privateKey, $hash)) {
+       throw new Google_Auth_Exception("Unable to sign data");
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/php-google-api.git/commitdiff/b7290f00924a9b9e1f7a130ba7e27481515647d7



More information about the pld-cvs-commit mailing list