summaryrefslogtreecommitdiffstats
path: root/Crypt_RSA-role.patch
blob: feab1fe2fa5048fd3fcc52f39f3c156018e1363a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
diff -up ./Crypt_RSA-0.3.6/RSA.php.orig ./Crypt_RSA-0.3.6/RSA.php
--- ./Crypt_RSA-0.3.6/RSA.php.orig	2014-02-26 17:57:48.055385477 +0100
+++ ./Crypt_RSA-0.3.6/RSA.php	2014-02-26 17:59:38.974772761 +0100
@@ -170,7 +170,7 @@ define('CRYPT_RSA_MODE_OPENSSL', 2);
 /**
  * Default openSSL configuration file.
  */
-define('CRYPT_RSA_OPENSSL_CONFIG', dirname(__FILE__) . '/../openssl.cnf');
+define('CRYPT_RSA_OPENSSL_CONFIG', 'openssl.cnf');
 
 /**#@+
  * @access public
@@ -464,7 +464,14 @@ class Crypt_RSA
             include_once 'Math/BigInteger.php';
         }
 
-        $this->configFile = CRYPT_RSA_OPENSSL_CONFIG;
+        $dir = '@cfg_dir@' . DIRECTORY_SEPARATOR . 'Crypt_RSA';
+        if (strpos($dir, '@') === false) {
+           // PEAR installer was used to install the package
+        } else {
+           // manual install
+           $dir = dirname(__FILE__);
+        }
+        $this->configFile = $dir . DIRECTORY_SEPARATOR . CRYPT_RSA_OPENSSL_CONFIG;
 
         if ( !defined('CRYPT_RSA_MODE') ) {
             // Math/BigInteger's openssl requirements are a little less stringent than Crypt/RSA's. in particular,
diff -up ./package.xml.orig ./package.xml
--- ./package.xml.orig	2014-02-26 17:59:38.974772761 +0100
+++ ./package.xml	2014-02-26 18:00:08.020874166 +0100
@@ -23,8 +23,10 @@
  <notes>0.3.6 release</notes>
  <contents>
   <dir name="/">
-    <file baseinstalldir="Crypt" name="RSA.php" role="php" md5sum="158051c445d140e7b4486487307a8f11"/>
-    <file baseinstalldir="" name="openssl.cnf" role="php" md5sum="0f1015cb8894127a94a05afa7cc23760"/>
+    <file baseinstalldir="Crypt" name="RSA.php" role="php">
+       <tasks:replace from="@cfg_dir@" to="cfg_dir" type="pear-config" />
+    </file>
+    <file name="openssl.cnf" role="cfg" md5sum="0f1015cb8894127a94a05afa7cc23760"/>
   </dir>
  </contents>
  <dependencies>