Hello community,

here is the log from the commit of package php5 for openSUSE:Factory
checked in at Mon Feb 21 23:39:51 CET 2011.



--------
--- php5/php5.changes   2011-01-06 23:47:48.000000000 +0100
+++ php5/php5.changes   2011-02-10 18:07:06.000000000 +0100
@@ -1,0 +2,35 @@
+Thu Feb 10 17:06:50 UTC 2011 - [email protected]
+
+- extend macros.php
+  o __php, __phpize, __php_config, php_version
+  o __pear, php_peardir, php_pearxmldir
+  o php_pear_gen_filelist
+- add README.macros
+
+-------------------------------------------------------------------
+Thu Jan 13 17:20:40 CET 2011 - [email protected]
+
+- security fix: 
+  * fopen_https_proxy_auth_fix.patch [bnc#656523]
+
+-------------------------------------------------------------------
+Mon Jan 10 18:52:45 UTC 2011 - [email protected]
+
+- export PHP_MYSQLND_ENABLED=yes to solve the mysqlnd problem
+ when extensions are built shared. [bnc#661464]
+
+-------------------------------------------------------------------
+Mon Jan 10 15:31:19 UTC 2011 - [email protected]
+
+- Go back to libmysql as there is currently no way
+  to build shared mysql extensions with mysqlnd. [bnc#661464]
+
+-------------------------------------------------------------------
+Sun Jan  9 01:32:33 UTC 2011 - [email protected]
+
+- Use mysqlnd driver, this is a newer PHP-native mysql 
+  extension, that does not require external libraries.
+  Now you can use mysql, mariadb or drizzle without extra libs.
+  fixes bnc #661464 and other old feature requests.
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  README.macros
  php-5.3.5-fopen_https_proxy_auth_fix.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ php5.spec ++++++
--- /var/tmp/diff_new_pack.e23LVf/_old  2011-02-21 23:36:28.000000000 +0100
+++ /var/tmp/diff_new_pack.e23LVf/_new  2011-02-21 23:36:28.000000000 +0100
@@ -1,5 +1,5 @@
 #
-# spec file for package php5 (Version 5.3.5)
+# spec file for package php5
 #
 # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
@@ -29,10 +29,10 @@
 
 BuildRequires:  apache2-devel bison curl-devel freetype2-devel gcc-c++ 
libpng-devel xorg-x11-devel
 BuildRequires:  db-devel enchant-devel gmp-devel imap-devel libicu-devel 
libtidy-devel
-BuildRequires:  libtiff-devel libxslt-devel mm-devel mysql-devel 
net-snmp-devel openldap2-devel
+BuildRequires:  libtiff-devel libxslt-devel mm-devel net-snmp-devel 
openldap2-devel
 BuildRequires:  pam-devel pkgconfig postfix postgresql-devel unixODBC-devel 
update-alternatives
 BuildRequires:  krb5-devel libevent-devel libmcrypt-devel
-
+#BuildRequires:  mysql-devel
 %if %{with_spell}
 BuildRequires:  aspell-devel
 %endif
@@ -77,12 +77,14 @@
 ###
 ###
 Version:        5.3.5
-Release:        1
+Release:        7
 License:        The PHP License, version 3.01
 Group:          Development/Languages/Other
 Provides:       php zend php-xml php-spl php-simplexml php-session php-pcre 
php-date php-reflection php-filter
 Provides:       php-api = %{apiver}, php-zend-abi = %{zendver}
 Provides:       php(api) = %{apiver}, php(zend-abi) = %{zendver}
+Provides:       php-macros = 2.0
+Obsoletes:      php-macros < 2.0
 AutoReqProv:    on
 PreReq:         update-alternatives
 #extensions that are no longer here
@@ -91,6 +93,7 @@
 Source1:        php-suse-addons.tar.bz2
 Source2:        suhosin-%{suhosin_version}.tar.gz
 Source4:        README.SUSE-pear
+Source5:        README.macros
 Source6:        macros.php
 Source7:        install-pear-nozlib.phar
 Source8:        php-fpm.init
@@ -116,6 +119,7 @@
 Patch25:        php-cloexec.patch
 Patch26:        php-5.3.4-pts.patch
 Patch27:        php-5.3.4-format-string-issues.patch
+Patch28:        php-5.3.5-fopen_https_proxy_auth_fix.patch
 Url:            http://www.php.net
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Summary:        PHP5 Core Files
@@ -1198,6 +1202,7 @@
 %{__tar} xf %{S:2} -C ext
 %{__mv} ext/suhosin-%{suhosin_version} ext/suhosin
 %{__cp} %{S:4} pear/README.SUSE
+%{__cp} %{S:5} .
 %{__cp} %{S:7} pear/
 #patch0 -p1
 %patch2
@@ -1223,6 +1228,7 @@
 %patch25
 %patch26
 %patch27
+%patch28 -p1
 
 # we build three SAPI
 %{__mkdir_p} build-apache2 build-fpm
@@ -1244,9 +1250,12 @@
 done
 %endif
 
+%if 0%{?suse_version} > 1020
 for parser in `find -name "*.re"`;do
        re2c --no-generation-date -gi "$parser" > ${parser%.*}.c
 done
+%endif
+
 # Safety check for API version change.
 vapi=`sed -n '/#define PHP_API_VERSION/{s/.* //;p}' main/php.h`
 if test "x${vapi}" != "x%{apiver}"; then
@@ -1284,6 +1293,7 @@
 # where to install extensions
 EXTENSION_DIR=%{extension_dir}
 export EXTENSION_DIR
+export PHP_MYSQLND_ENABLED=yes
 # build function
 Build()
 {
@@ -1411,13 +1421,13 @@
        --with-ldap-sasl=%{_usr} \
        --with-libedit=shared,%{_usr} \
     --with-mcrypt=shared \
-    --with-mysql=shared,%{_usr} \
+    --with-mysql=shared,mysqlnd \
 %if 0%{?suse_version} > 1110
        --with-mysql-sock=/var/run/mysql/mysql.sock \
 %else
         --with-mysql-sock=/var/lib/mysql/mysql.sock \
 %endif
-    --with-mysqli=shared \
+    --with-mysqli=shared,mysqlnd \
     --with-unixODBC=shared,%{_usr} \
     --with-openssl=shared \
     --with-pgsql=shared,%{_usr} \
@@ -1446,7 +1456,7 @@
     --with-pdo_sqlite=shared \
        --with-sqlite3=shared \
 %endif
-    --with-pdo-mysql=shared,%{_usr} \
+    --with-pdo-mysql=shared,mysqlnd \
     --with-pdo-pgsql=shared,%{_usr} \
        --with-pdo-odbc=shared,unixODBC,%{_usr} \
 %if 0%{?suse_version} > 1010
@@ -1669,6 +1679,7 @@
 
 %files devel
 %defattr(-, root, root)
+%doc README.macros
 %{_includedir}/%{pkg_name}
 %{_bindir}/phpize5
 %{_bindir}/php-config5

++++++ README.macros ++++++
README for php-macros

Author: Christian Wittmer <[email protected]>


%php_gen_filelist generates an rpmlint happy filelist of your installed files

In most cases you only need to check the %doc part
sometimes there is a "Changes" or "ChangeLog",....

Requirements for %php_gen_filelist
You have to define following parts inside your spec file

Example:

Name:           php5-pear-Date
%define pear_name  Date
%define pear_sname date

BuildRequires:  php-macros
Provides:       php-pear-%{pear_name} pear-%{pear_name}
# Fix for renaming (package convention)
Provides:       php5-pear-%{pear_sname} = %{version}
Provides:       php-pear-%{pear_sname} = %{version}
Provides:       pear-%{pear_sname} = %{version}
Obsoletes:      php5-pear-%{pear_sname} < %{version}
Obsoletes:      php-pear-%{pear_sname} < %{version}
Obsoletes:      pear-%{pear_sname} < %{version}

%install
%{__mv} package*.xml %{pear_name}-%{version}
cd %{pear_name}-%{version}
PHP_PEAR_PHP_BIN="$(which php) -d memory_limit=50m"
%{__pear} -v \
        -d doc_dir=/doc \
        -d bin_dir=%{_bindir} \
        -d data_dir=%{peardir}/data \
        install --offline --nodeps -R "$RPM_BUILD_ROOT" package.xml

%{__install} -D -m 0644 package.xml 
$RPM_BUILD_ROOT%{php_pearxmldir}/%{pear_name}.xml

%{__rm} -rf $RPM_BUILD_ROOT/{doc,tmp}
%{__rm} -rf 
"$RPM_BUILD_ROOT"/%{peardir}/.{filemap,lock,registry,channels,depdb,depdblock}

%php_gen_filelist

%post
# on `rpm -ivh` PARAM is 1
# on `rpm -Uvh` PARAM is 2
if [ "$1" = "1" ]; then
  %{__pear} install --nodeps --soft --force --register-only 
%{php_pearxmldir}/%{pear_name}.xml
fi
if [ "$1" = "2" ]; then
  %{__pear} upgrade --offline --register-only %{php_pearxmldir}/%{pear_name}.xml
fi

%postun
# on `rpm -e` PARAM is 0
if [ "$1" = "0" ]; then
  %{__pear} uninstall --nodeps --ignore-errors --register-only 
pear.php.net/%{pear_name}
fi

%clean
%{__rm} -rf %{buildroot}

%files -f %{name}.files
%defattr(-,root,root)
%doc Changes README

%changelog

#############################################################################

And here an Example of the generated filelist:

/usr/share/php5/PEAR/Date.php
%dir /usr/share/php5/PEAR/Date
/usr/share/php5/PEAR/Date/Calc.php
/usr/share/php5/PEAR/Date/Human.php
/usr/share/php5/PEAR/Date/Span.php
/usr/share/php5/PEAR/Date/TimeZone.php
%dir /usr/share/php5/PEAR/test
%dir /usr/share/php5/PEAR/test/Date
%dir /usr/share/php5/PEAR/test/Date/tests
/usr/share/php5/PEAR/test/Date/tests/test_date_methods_span.php
/usr/share/php5/PEAR/test/Date/tests/testunit_date_span.php
/usr/share/php5/PEAR/test/Date/tests/test_calc.php
/usr/share/php5/PEAR/test/Date/tests/calc.php
/usr/share/php5/PEAR/test/Date/tests/testunit_date.php
/usr/share/php5/PEAR/test/Date/tests/testunit.php
%dir /usr/share/php5/PEAR/test/Date/tests/bugs
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-727-1.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-727-2.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-727-3.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-727-4.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-674.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-9213.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-9414.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-8912.phpt
/usr/share/php5/PEAR/test/Date/tests/bugs/bug-967.phpt
/var/lib/pear/Date.xml

++++++ macros.php ++++++
--- /var/tmp/diff_new_pack.e23LVf/_old  2011-02-21 23:36:28.000000000 +0100
+++ /var/tmp/diff_new_pack.e23LVf/_new  2011-02-21 23:36:28.000000000 +0100
@@ -1,5 +1,75 @@
+# macros.php file
+# macros for module building. handle with care.
+
 #
 # Interface versions exposed by PHP:
-# 
+#
 %php_core_api @PHP_APIVER@
 %php_zend_api @PHP_ZENDVER@
+
+# Useful php macros (from Christian Wittmer <[email protected]>)
+#
+%__php          /usr/bin/php
+%__phpize       /usr/bin/phpize
+%__php_config   /usr/bin/php-config
+%php_version    %(%{__php_config} --version)
+#
+%__pear         /usr/bin/pear
+%php_peardir    %(%{__pear} config-get php_dir)
+%php_pearxmldir /var/lib/pear
+
+# macro: php_pear_gen_filelist
+# do the rpmlint happy filelist generation
+# with %dir in front of directories
+%php_pear_gen_filelist(n)\
+FILES=%{name}.files\
+# fgen_dir func\
+# IN: dir\
+fgen_dir(){\
+%{__cat} >> $FILES << EOF\
+%dir ${1}\
+EOF\
+}\
+# fgen_file func\
+# IN: file\
+fgen_file(){\
+%{__cat} >> $FILES << EOF\
+${1}\
+EOF\
+}\
+# check for files in %{php_peardir}\
+RES=`find ${RPM_BUILD_ROOT}%{php_peardir} -maxdepth 1 -type f`\
+if [ -n "$RES" ]; then\
+  for file in $RES; do\
+    fgen_file "%{php_peardir}/$(basename ${file})"\
+  done\
+fi\
+\
+# get all dirs into array\
+base_dir="${RPM_BUILD_ROOT}%{php_peardir}/"\
+for dir in `find ${base_dir} -type d | sort`; do\
+  if [ "$dir" = "${base_dir}" ]; then\
+    continue\
+  else\
+    el=`echo $dir | %{__awk} -F"${base_dir}" '{print $2}'`\
+    all_dir=(${all_dir[@]} $el)\
+  fi\
+done\
+\
+# build filelist\
+for i in ${all_dir[@]}; do\
+  if [ -d ${base_dir}/${i} ]; then\
+    RES=`find "${base_dir}/${i}" -maxdepth 1 -type f`\
+    if [ -n "$RES" ]; then\
+      fgen_dir "%{php_peardir}/${i}"\
+      for file in $RES; do\
+        fgen_file "%{php_peardir}/${i}/$(basename ${file})"\
+      done\
+    else\
+      fgen_dir "%{php_peardir}/${i}"\
+    fi\
+  fi\
+done\
+# add xml file\
+fgen_file "%php_pearxmldir/%{pear_name}.xml"\
+#

++++++ php-5.3.5-fopen_https_proxy_auth_fix.patch ++++++
--- php-5.3.3-orig/ext/standard/http_fopen_wrapper.c    2010-08-13 
09:06:36.000000000 +0000
+++ php-5.3.3/ext/standard/http_fopen_wrapper.c 2010-08-13 09:45:54.000000000 
+0000
@@ -201,7 +201,56 @@ php_stream *php_stream_url_wrap_http_ex(
                smart_str_appends(&header, resource->host);
                smart_str_appendc(&header, ':');
                smart_str_append_unsigned(&header, resource->port);
-               smart_str_appendl(&header, " HTTP/1.0\r\n\r\n", sizeof(" 
HTTP/1.0\r\n\r\n")-1);
+               smart_str_appendl(&header, " HTTP/1.0\r\n", sizeof(" 
HTTP/1.0\r\n")-1);
+               if (context && php_stream_context_get_option(context, "http", 
"header", &tmpzval) == SUCCESS) {
+                       /* Look out for ProxyAuthentication header, appending 
it */
+                       tmp = NULL;
+               
+                       if (Z_TYPE_PP(tmpzval) == IS_ARRAY) {
+                               HashPosition pos;
+                               zval **tmpheader = NULL;
+                               smart_str tmpstr = {0};
+
+                               for 
(zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(tmpzval), &pos);
+                                       SUCCESS == 
zend_hash_get_current_data_ex(Z_ARRVAL_PP(tmpzval), (void *)&tmpheader, &pos);
+                                       
zend_hash_move_forward_ex(Z_ARRVAL_PP(tmpzval), &pos)
+                               ) {
+                                       if (Z_TYPE_PP(tmpheader) == IS_STRING) {
+                                               smart_str_appendl(&tmpstr, 
Z_STRVAL_PP(tmpheader), Z_STRLEN_PP(tmpheader));
+                                               smart_str_appendl(&tmpstr, 
"\r\n", sizeof("\r\n") - 1);
+                                       }
+                               }
+                               smart_str_0(&tmpstr);
+                               /* Remove newlines and spaces from start and 
end. there's at least one extra \r\n at the end that needs to go. */
+                               if (tmpstr.c) {
+                                       tmp = php_trim(tmpstr.c, 
strlen(tmpstr.c), NULL, 0, NULL, 3 TSRMLS_CC);
+                                       smart_str_free(&tmpstr);
+                               }
+                       }
+                       if (Z_TYPE_PP(tmpzval) == IS_STRING && 
Z_STRLEN_PP(tmpzval)) {
+                               /* Remove newlines and spaces from start and 
end php_trim will estrndup() */
+                               tmp = php_trim(Z_STRVAL_PP(tmpzval), 
Z_STRLEN_PP(tmpzval), NULL, 0, NULL, 3 TSRMLS_CC);
+                       }
+                       if (tmp && strlen(tmp) > 0) {
+                               /* Strip Proxy-Authorization header for HTTPS */
+                               int l = strlen(tmp);
+                               char *s, *s2, *tmp_c = estrdup(tmp);
+                               
+                               php_strtolower(tmp_c, l);
+                               if ((s = strstr(tmp_c, 
"proxy-authorization:"))) {
+                                       if ((s2 = memchr(s, '\n', tmp_c + l - 
s))) {
+                                               smart_str_appendl(&header, tmp 
+ (s - tmp_c), s2 - s - 1);
+                                       } else {
+                                               smart_str_appendl(&header, tmp 
+ (s - tmp_c), tmp_c + l - s);
+                                       }
+                                       smart_str_appendl(&header, "\r\n", 
sizeof("\r\n")-1);
+                               }
+                               efree(tmp_c);
+                       }
+                       if (tmp)
+                               efree(tmp);
+               }
+               smart_str_appendl(&header, "\r\n", sizeof("\r\n")-1);
                if (php_stream_write(stream, header.c, header.len) != 
header.len) {
                        php_stream_wrapper_log_error(wrapper, options 
TSRMLS_CC, "Cannot connect to HTTPS server through proxy");
                        php_stream_close(stream);
@@ -363,6 +412,18 @@ php_stream *php_stream_url_wrap_http_ex(
                                char *s, *s2, *tmp_c = estrdup(tmp);
                                
                                php_strtolower(tmp_c, l);
+                               if (use_proxy && use_ssl && (s = strstr(tmp_c, 
"proxy-authorization:"))) {
+                                       /* Strip Proxy-Authorization header for 
HTTPS */
+                                       if ((s2 = memchr(s, '\n', tmp_c + l - 
s))) {
+                                               int b = tmp_c + l - 1 - s2;
+                                               memmove(tmp, tmp + (s2 + 1 - 
tmp_c), b);
+                                               memmove(tmp_c, s2 + 1, b);
+                                               
+                                       } else {
+                                               tmp[s - tmp_c] = *s = '\0';
+                                       }
+                                       l = strlen(tmp_c);
+                               }
                                if ((s = strstr(tmp_c, "content-length:"))) {
                                        if ((s2 = memchr(s, '\n', tmp_c + l - 
s))) {
                                                int b = tmp_c + l - 1 - s2;
@@ -385,6 +446,27 @@ php_stream *php_stream_url_wrap_http_ex(
                                tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, 
NULL, 3 TSRMLS_CC);
                                efree(tmp);
                                tmp = tmp_c;
+                       } else if (use_proxy && use_ssl) {
+                               /* Strip Proxy-Authorization header for HTTPS */
+                               int l = strlen(tmp);
+                               char *s, *s2, *tmp_c = estrdup(tmp);
+                               
+                               php_strtolower(tmp_c, l);
+                               if ((s = strstr(tmp_c, 
"proxy-authorization:"))) {
+                                       if ((s2 = memchr(s, '\n', tmp_c + l - 
s))) {
+                                               int b = tmp_c + l - 1 - s2;
+                                               memmove(tmp, tmp + (s2 + 1 - 
tmp_c), b);
+                                               memmove(tmp_c, s2 + 1, b);
+                                               
+                                       } else {
+                                               tmp[s - tmp_c] = *s = '\0';
+                                       }
+                                       l = strlen(tmp_c);
+                               }
+                               efree(tmp_c);
+                               tmp_c = php_trim(tmp, strlen(tmp), NULL, 0, 
NULL, 3 TSRMLS_CC);
+                               efree(tmp);
+                               tmp = tmp_c;
                        }
 
                        user_headers = estrdup(tmp);


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to