--- /dev/null
+# 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,
+ $privateKeyPassword = 'notasecret',
+ $assertionType = 'http://oauth.net/grant_type/jwt/1.0/bearer',
+- $sub = false) {
++ $sub = false,
++ $signer = null) {
+ $this->serviceAccountName = $serviceAccountName;
+ $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes);
+ $this->privateKey = $privateKey;
+@@ -58,6 +59,7 @@
+ $this->assertionType = $assertionType;
+ $this->sub = $sub;
+ $this->prn = $sub;
++ $this->signer = $signer;
+ }
+
+ public function generateAssertion() {
+@@ -94,8 +96,20 @@
+ );
+
+ $signingInput = implode('.', $segments);
++
++ if ($this->signer === 'phpseclib') {
++ require_once 'Crypt/RSA.php';
++ $rsa = new Crypt_RSA();
++ $rsa->setPassword($this->privateKeyPassword);
++ $rsa->loadKey($this->privateKey, CRYPT_RSA_PRIVATE_FORMAT_PKCS1);
++ $rsa->setSignatureMode(CRYPT_RSA_SIGNATURE_PKCS1);
++ $rsa->setHash('sha256');
++ $signature = $rsa->sign($signingInput);
++ } else {
+ $signer = new Google_P12Signer($this->privateKey, $this->privateKeyPassword);
+ $signature = $signer->sign($signingInput);
++ }
++
+ $segments[] = Google_Utils::urlSafeB64Encode($signature);
+
+ return implode(".", $segments);
Source0: https://google-api-php-client.googlecode.com/files/google-api-php-client-%{version}.tar.gz
# Source0-md5: 86db4e431096c9c32637842e214c6e26
Patch0: php52.patch
+Patch1: gapi.patch
URL: https://code.google.com/p/google-api-php-client/
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.461
Requires: php-json
Requires: php-openssl
Requires: php-pcre
+Suggests: php-seclib
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%setup -qc
mv google-api-php-client/* .
%patch0 -p1
+%patch1 -p8
grep -rl require_once examples | xargs %{__sed} -i -e '
# fixup paths to source