--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/php-5_2/php-sapi/patches/50_php_zlib.patch Mon Jan 19 12:08:42 2015 -0800
@@ -0,0 +1,55 @@
+Patch origin: upstream
+Patch status: Part 1: unclear; patch attached to bug
+Patch status: Part 2: more generic fix already in php 5.3
+
+https://bugs.php.net/bug.php?id=53829
+http://git.php.net/?p=php-src.git;a=commitdiff;h=a8948d08083bf59d437ac21abe5929f5668f41d7
+
+--- php-5.2.17/ext/zlib/zlib.c
++++ php-5.2.17/ext/zlib/zlib.c
+@@ -58,6 +58,18 @@
+ # endif
+ #endif
+
++/*
++ * zlib include files can define the following preprocessor defines which rename
++ * the corresponding PHP functions to gzopen64, gzseek64 and gztell64 and thereby
++ * breaking some software, most notably PEAR's Archive_Tar, which halts execution
++ * without error message on gzip compressed archivesa.
++ *
++ * This only seems to happen on 32bit systems with large file support.
++ */
++#undef gzopen
++#undef gzseek
++#undef gztell
++
+ #if defined(HAVE_UNISTD_H) && defined(PHP_WIN32)
+ # undef HAVE_UNISTD_H
+ #endif
+--- php-5.2.17/ext/zlib/tests/gzgetc_basic.phpt
++++ php-5.2.17/ext/zlib/tests/gzgetc_basic.phpt
+@@ -14,16 +14,17 @@
+
+ $f = dirname(__FILE__)."/004.txt.gz";
+ $h = gzopen($f, 'r');
++if ($h) {
++ $count = 0;
++ while (($c = fgetc( $h )) !== false) {
++ $count++;
++ echo $c;
++ }
+
+-$count = 0;
+-while (gzeof($h) === false) {
+- $count++;
+- echo fgetc( $h );
++ echo "\ncharacters counted=$count\n";
++ gzclose($h);
+ }
+
+-echo "\ncharacters counted=$count\n";
+-gzclose($h);
+-
+ ?>
+ ===DONE===
+ --EXPECT--