summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-php/PEAR-OLE')
-rw-r--r--dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild35
-rw-r--r--dev-php/PEAR-OLE/files/1.0.0_rc2-fix-static-calls.patch96
-rw-r--r--dev-php/PEAR-OLE/files/pear-bug-19284.patch24
3 files changed, 155 insertions, 0 deletions
diff --git a/dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild b/dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild
new file mode 100644
index 000000000000..65a1974193cd
--- /dev/null
+++ b/dev-php/PEAR-OLE/PEAR-OLE-1.0.0_rc2-r2.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+MY_PN="${PN/PEAR-/}"
+MY_PV="${PV/_/}"
+MY_PV="${MY_PV^^}"
+MY_P="${MY_PN}-${MY_PV}"
+
+DESCRIPTION="Package for reading and writing OLE containers"
+HOMEPAGE="http://pear.php.net/package/${MY_PN}"
+SRC_URI="http://download.pear.php.net/package/${MY_P}.tgz"
+LICENSE="PHP-3.01"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE=""
+
+RDEPEND="dev-lang/php:*
+ dev-php/PEAR-PEAR"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ eapply "${FILESDIR}/pear-bug-19284.patch" \
+ "${FILESDIR}/${PV}-fix-static-calls.patch"
+ eapply_user
+}
+
+src_install() {
+ insinto /usr/share/php
+ doins "${MY_PN}.php"
+ doins -r "${MY_PN}"
+}
diff --git a/dev-php/PEAR-OLE/files/1.0.0_rc2-fix-static-calls.patch b/dev-php/PEAR-OLE/files/1.0.0_rc2-fix-static-calls.patch
new file mode 100644
index 000000000000..e9dea0cad4f7
--- /dev/null
+++ b/dev-php/PEAR-OLE/files/1.0.0_rc2-fix-static-calls.patch
@@ -0,0 +1,96 @@
+From 17a94ee1f244cbf0c728f37d1628eb28955465ac Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-S=C3=A9bastien=20Hedde?= <jeanseb@au-fil-du.net>
+Date: Mon, 27 Jan 2014 11:32:19 +0100
+Subject: [PATCH 1/3] Non-static method System::tmpdir() should not be called
+ statically, assuming from incompatible context
+
+---
+ OLE/PPS/File.php | 3 ++-
+ OLE/PPS/Root.php | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/OLE/PPS/File.php b/OLE/PPS/File.php
+index 8fb1acd..553627e 100644
+--- a/OLE/PPS/File.php
++++ b/OLE/PPS/File.php
+@@ -47,7 +47,8 @@ class OLE_PPS_File extends OLE_PPS
+ */
+ function OLE_PPS_File($name)
+ {
+- $this->_tmp_dir = System::tmpdir();
++ $system = new System();
++ $this->_tmp_dir = $system->tmpdir();
+ $this->OLE_PPS(
+ null,
+ $name,
+diff --git a/OLE/PPS/Root.php b/OLE/PPS/Root.php
+index 387c3b3..9da6330 100755
+--- a/OLE/PPS/Root.php
++++ b/OLE/PPS/Root.php
+@@ -53,7 +53,8 @@ class OLE_PPS_Root extends OLE_PPS
+ */
+ function OLE_PPS_Root($time_1st, $time_2nd, $raChild)
+ {
+- $this->_tmp_dir = System::tmpdir();
++ $system = new System();
++ $this->_tmp_dir = $system->tmpdir();
+ $this->OLE_PPS(
+ null,
+ OLE::Asc2Ucs('Root Entry'),
+
+From 482239c562cc66959fc8c04e8308d812196d56f8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-S=C3=A9bastien=20Hedde?= <jeanseb@au-fil-du.net>
+Date: Mon, 27 Jan 2014 11:35:00 +0100
+Subject: [PATCH 2/3] OLE::LocalDate2OLE, OLE::OLE2LocalDate are static
+ methods.
+
+These functions are called staticly and don't use $this.
+---
+ OLE.php | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/OLE.php b/OLE.php
+index d7dced7..2a5da73 100755
+--- a/OLE.php
++++ b/OLE.php
+@@ -493,7 +493,7 @@ function Asc2Ucs($ascii)
+ * @param integer $date A timestamp
+ * @return string The string for the OLE container
+ */
+- function LocalDate2OLE($date = null)
++ static function LocalDate2OLE($date = null)
+ {
+ if (!isset($date)) {
+ return "\x00\x00\x00\x00\x00\x00\x00\x00";
+@@ -538,7 +538,7 @@ function LocalDate2OLE($date = null)
+ * @access public
+ * @static
+ */
+- function OLE2LocalDate($string)
++ static function OLE2LocalDate($string)
+ {
+ if (strlen($string) != 8) {
+ return new PEAR_Error("Expecting 8 byte string");
+
+From af1b260a8bd0a5fc337f96f5b84b2accbb75f650 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jean-S=C3=A9bastien=20Hedde?= <jeanseb@au-fil-du.net>
+Date: Mon, 27 Jan 2014 11:38:34 +0100
+Subject: [PATCH 3/3] Asc2Ucs is a static method.
+
+---
+ OLE.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/OLE.php b/OLE.php
+index 2a5da73..e0cec8f 100755
+--- a/OLE.php
++++ b/OLE.php
+@@ -475,7 +475,7 @@ function getDataLength($index)
+ * @param string $ascii The ASCII string to transform
+ * @return string The string in Unicode
+ */
+- function Asc2Ucs($ascii)
++ static function Asc2Ucs($ascii)
+ {
+ $rawname = '';
+ for ($i = 0; $i < strlen($ascii); $i++) {
diff --git a/dev-php/PEAR-OLE/files/pear-bug-19284.patch b/dev-php/PEAR-OLE/files/pear-bug-19284.patch
new file mode 100644
index 000000000000..c94142c1ae46
--- /dev/null
+++ b/dev-php/PEAR-OLE/files/pear-bug-19284.patch
@@ -0,0 +1,24 @@
+From e63587ddb88057cc2e403c48d2f41728ba1044ef Mon Sep 17 00:00:00 2001
+From: flack <flack@contentcontrol-berlin.de>
+Date: Tue, 27 Nov 2012 10:26:09 +0100
+Subject: [PATCH] Fix problem where Excel files couldn't be opened in Ofccie
+ 2010
+
+I haven't traced the problem, the fix is from one of the comments of http://pear.php.net/bugs/bug.php?id=19284, but for me, this reproducably fixes the issue the Excel 2010 refuses to open the files because they are corrupt
+---
+ OLE/PPS/Root.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/OLE/PPS/Root.php b/OLE/PPS/Root.php
+index 2f19ba0..387c3b3 100755
+--- a/OLE/PPS/Root.php
++++ b/OLE/PPS/Root.php
+@@ -620,7 +620,7 @@ function _create_header($num_sb_blocks, $num_bb_blocks, $num_pps_blocks)
+ else
+ fwrite($FILE, pack("V", -2));
+
+- fwrite($FILE, pack("V", 1));
++ fwrite($FILE, pack("V", $num_sb_blocks));
+
+ // Extra BDList Start, Count
+ if($bbd_info["blockchain_list_entries"] < $bbd_info["header_blockchain_list_entries"])