From 2d20904eb2ca2e4ac0a6a74ce2e8f03641943d62 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 19 Apr 2015 09:06:51 +0200 Subject: php-pecl-xattr: 1.2.1 --- 3_01.txt | 68 ---------------- REFLECTION | 2 +- php-pecl-xattr.spec | 41 ++++++---- xattr-php7.patch | 222 ---------------------------------------------------- 4 files changed, 26 insertions(+), 307 deletions(-) delete mode 100644 3_01.txt delete mode 100644 xattr-php7.patch diff --git a/3_01.txt b/3_01.txt deleted file mode 100644 index 6059c80..0000000 --- a/3_01.txt +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------- - The PHP License, version 3.01 -Copyright (c) 1999 - 2014 The PHP Group. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. The name "PHP" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact group@php.net. - - 4. Products derived from this software may not be called "PHP", nor - may "PHP" appear in their name, without prior written permission - from group@php.net. You may indicate that your software works in - conjunction with PHP by saying "Foo for PHP" instead of calling - it "PHP Foo" or "phpfoo" - - 5. The PHP Group may publish revised and/or new versions of the - license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the terms - of that version. You may also choose to use such covered code - under the terms of any subsequent version of the license - published by the PHP Group. No one other than the PHP Group has - the right to modify the terms applicable to covered code created - under this License. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes PHP software, freely available from - ". - -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP -DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------- - -This software consists of voluntary contributions made by many -individuals on behalf of the PHP Group. - -The PHP Group can be contacted via Email at group@php.net. - -For more information on the PHP Group and the PHP project, -please see . - -PHP includes the Zend Engine, freely available at -. diff --git a/REFLECTION b/REFLECTION index 04043af..4c6b632 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #86 xattr version 1.2.0 ] { +Extension [ extension #164 xattr version 1.2.1 ] { - Constants [4] { Constant [ integer XATTR_ROOT ] { 2 } diff --git a/php-pecl-xattr.spec b/php-pecl-xattr.spec index 391138a..c8a531e 100644 --- a/php-pecl-xattr.spec +++ b/php-pecl-xattr.spec @@ -21,19 +21,13 @@ Summary: Extended attributes Name: %{?scl_prefix}php-pecl-%{pecl_name} -Version: 1.2.0 -Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Version: 1.2.1 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz -# https://bugs.php.net/65842 Please Provides LICENSE file -# URL from xattr.c headers -Source1: http://www.php.net/license/3_01.txt - -Patch0: %{pecl_name}-php7.patch - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear @@ -92,11 +86,6 @@ sed -e 's/role="test"/role="src"/' -i package.xml mv %{pecl_name}-%{version} NTS cd NTS -cp %{SOURCE1} LICENSE -%patch0 -p3 -b .php7 - -# http://svn.php.net/viewvc?view=revision&revision=331704 -sed -e 's:/lib:/$PHP_LIBDIR:' -i config.m4 # Sanity check, really often broken extver=$(sed -n '/#define PHP_XATTR_VERSION/{s/.* "//;s/".*$//;p}' php_xattr.h) @@ -156,7 +145,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} # Documentation cd NTS -for i in LICENSE $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') +for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done @@ -180,16 +169,32 @@ fi %check +cd NTS : Minimal load test for NTS extension %{_bindir}/php --no-php-ini \ - --define extension=NTS/modules/%{pecl_name}.so \ + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} +: Upstream test suite for NTS extension +TEST_PHP_EXECUTABLE=%{__php} \ +TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ +NO_INTERACTION=1 \ +REPORT_EXIT_STATUS=1 \ +%{__php} -n run-tests.php --show-diff + %if %{with_zts} +cd ../ZTS : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ - --define extension=ZTS/modules/%{pecl_name}.so \ + --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep %{pecl_name} + +: Upstream test suite for ZTS extension +TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \ +TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ +NO_INTERACTION=1 \ +REPORT_EXIT_STATUS=1 \ +%{_bindir}/zts-php -n run-tests.php --show-diff %endif @@ -213,6 +218,10 @@ rm -rf %{buildroot} %changelog +* Sun Apr 19 2015 Remi Collet - 1.2.1-1 +- update to 1.2.1 +- run upstream test suite during build + * Mon Apr 6 2015 Remi Collet - 1.2.0-6 - add fix for PHP-7 - drop runtime dependency on pear, new scriptlets diff --git a/xattr-php7.patch b/xattr-php7.patch deleted file mode 100644 index fbd2285..0000000 --- a/xattr-php7.patch +++ /dev/null @@ -1,222 +0,0 @@ ---- pecl/xattr/trunk/php_xattr.h 2015/04/06 16:58:20 336402 -+++ pecl/xattr/trunk/php_xattr.h 2015/04/06 17:01:25 336403 -@@ -1,13 +1,13 @@ - /* - +----------------------------------------------------------------------+ -- | PHP Version 5 | -+ | PHP Version 5, 7 | - +----------------------------------------------------------------------+ -- | Copyright (c) 1997-2004 The PHP Group | -+ | Copyright (c) 1997-2015 The PHP Group | - +----------------------------------------------------------------------+ -- | This source file is subject to version 3.0 of the PHP license, | -+ | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | -- | http://www.php.net/license/3_0.txt. | -+ | http://www.php.net/license/3_01.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | -@@ -45,6 +45,17 @@ - PHP_FUNCTION(xattr_list); - PHP_FUNCTION(xattr_supported); - -+#if PHP_MAJOR_VERSION < 7 -+typedef long zend_long; -+typedef int strsize_t; -+#define _RETVAL_STRINGL(s,l,d) RETVAL_STRINGL(s,l,d) -+#define _RETURN_STRINGL(s,l,d) RETURN_STRINGL(s,l,d) -+#else -+typedef size_t strsize_t; -+#define _RETVAL_STRINGL(s,l,d) { RETVAL_STRINGL(s,l); if (!d) efree(s); } -+#define _RETURN_STRINGL(s,l,d) { _RETVAL_STRINGL(s,l,d); return; } -+#endif -+ - #endif /* PHP_XATTR_H */ - - ---- pecl/xattr/trunk/xattr.c 2015/04/06 16:58:20 336402 -+++ pecl/xattr/trunk/xattr.c 2015/04/06 17:01:25 336403 -@@ -1,13 +1,13 @@ - /* - +----------------------------------------------------------------------+ -- | PHP Version 5 | -+ | PHP Version 5, 7 | - +----------------------------------------------------------------------+ -- | Copyright (c) 1997-2004 The PHP Group | -+ | Copyright (c) 1997-2015 The PHP Group | - +----------------------------------------------------------------------+ -- | This source file is subject to version 3.0 of the PHP license, | -+ | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | -- | http://www.php.net/license/3_0.txt. | -+ | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | -@@ -43,17 +43,39 @@ - #include - #include - -+ZEND_BEGIN_ARG_INFO_EX(xattr_set_arginfo, 0, 0, 3) -+ ZEND_ARG_INFO(0, path) -+ ZEND_ARG_INFO(0, name) -+ ZEND_ARG_INFO(0, value) -+ ZEND_ARG_INFO(0, flags) -+ZEND_END_ARG_INFO() -+ -+ZEND_BEGIN_ARG_INFO_EX(xattr_get_arginfo, 0, 0, 2) -+ ZEND_ARG_INFO(0, path) -+ ZEND_ARG_INFO(0, name) -+ ZEND_ARG_INFO(0, flags) -+ZEND_END_ARG_INFO() -+ -+ZEND_BEGIN_ARG_INFO_EX(xattr_list_arginfo, 0, 0, 1) -+ ZEND_ARG_INFO(0, path) -+ ZEND_ARG_INFO(0, flags) -+ZEND_END_ARG_INFO() -+ - /* {{{ xattr_functions[] - * - * Every user visible function must have an entry in xattr_functions[]. - */ - zend_function_entry xattr_functions[] = { -- PHP_FE(xattr_set, NULL) -- PHP_FE(xattr_get, NULL) -- PHP_FE(xattr_remove, NULL) -- PHP_FE(xattr_list, NULL) -- PHP_FE(xattr_supported, NULL) -- {NULL, NULL, NULL} /* Must be the last line in xattr_functions[] */ -+ PHP_FE(xattr_set, xattr_set_arginfo) -+ PHP_FE(xattr_get, xattr_get_arginfo) -+ PHP_FE(xattr_remove, xattr_get_arginfo) -+ PHP_FE(xattr_list, xattr_list_arginfo) -+ PHP_FE(xattr_supported, xattr_list_arginfo) -+#ifdef PHP_FE_END -+ PHP_FE_END -+#else -+ { NULL, NULL, NULL } -+#endif - }; - /* }}} */ - -@@ -112,7 +134,9 @@ - char *attr_name = NULL; - char *attr_value = NULL; - char *path = NULL; -- int error, tmp, value_len, flags = 0; -+ int error; -+ zend_long flags = 0; -+ strsize_t tmp, value_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &path, &tmp, &attr_name, &tmp, &attr_value, &value_len, &flags) == FAILURE) { - return; -@@ -131,7 +155,7 @@ - flags &= ATTR_ROOT | ATTR_DONTFOLLOW | ATTR_CREATE | ATTR_REPLACE; - - /* Attempt to set an attribute, warn if failed. */ -- error = attr_set(path, attr_name, attr_value, value_len, flags); -+ error = attr_set(path, attr_name, attr_value, (int)value_len, (int)flags); - if (error == -1) { - switch (errno) { - case E2BIG: -@@ -164,8 +188,10 @@ - char *attr_name = NULL; - char *attr_value = NULL; - char *path = NULL; -- int error, tmp, flags = 0; -- size_t buffer_size = XATTR_BUFFER_SIZE; -+ int error; -+ strsize_t tmp; -+ zend_long flags = 0; -+ int buffer_size = XATTR_BUFFER_SIZE; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &path, &tmp, &attr_name, &tmp, &flags) == FAILURE) { - return; -@@ -192,7 +218,7 @@ - * If buffer is too small then attr_get sets errno to E2BIG and tells us - * how many bytes are required by setting buffer_size variable. - */ -- error = attr_get(path, attr_name, attr_value, &buffer_size, flags); -+ error = attr_get(path, attr_name, attr_value, &buffer_size, (int)flags); - - /* - * Loop is necessary in case that someone edited extended attributes -@@ -203,13 +229,14 @@ - if (!attr_value) - RETURN_FALSE; - -- error = attr_get(path, attr_name, attr_value, &buffer_size, flags); -+ error = attr_get(path, attr_name, attr_value, &buffer_size, (int)flags); - } - - /* Return a string if everything is ok */ - if (!error) { -- attr_value = erealloc(attr_value, buffer_size); -- RETURN_STRINGL(attr_value, buffer_size, 0); -+ _RETVAL_STRINGL(attr_value, buffer_size, 1); /* copy + free instead of realloc */ -+ efree(attr_value); -+ return; - } - - /* Error handling part */ -@@ -240,8 +267,10 @@ - Checks if filesystem supports extended attributes */ - PHP_FUNCTION(xattr_supported) - { -- char *buffer, *path = NULL; -- int error, tmp, flags = 0; -+ char *buffer="", *path = NULL; -+ int error; -+ strsize_t tmp; -+ zend_long flags = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &tmp, &flags) == FAILURE) { - return; -@@ -290,7 +319,9 @@ - { - char *attr_name = NULL; - char *path = NULL; -- int error, tmp, flags = 0; -+ int error; -+ strsize_t tmp; -+ zend_long flags = 0; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &path, &tmp, &attr_name, &tmp, &flags) == FAILURE) { - return; -@@ -309,7 +340,7 @@ - flags &= ATTR_ROOT | ATTR_DONTFOLLOW; - - /* Attempt to remove an attribute, warn if failed. */ -- error = attr_remove(path, attr_name, flags); -+ error = attr_remove(path, attr_name, (int)flags); - if (error == -1) { - switch (errno) { - case E2BIG: -@@ -341,8 +372,10 @@ - { - char *buffer, *path = NULL; - char *p, *prefix; -- int error, tmp, flags = 0; -- ssize_t i = 0, buffer_size = XATTR_BUFFER_SIZE; -+ int error; -+ strsize_t tmp; -+ zend_long flags = 0; -+ size_t i = 0, buffer_size = XATTR_BUFFER_SIZE; - size_t len, prefix_len; - - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &path, &tmp, &flags) == FAILURE) { -@@ -442,7 +475,11 @@ - while (i != buffer_size) { - len = strlen(p) + 1; /* +1 for NULL */ - if (strstr(p, prefix) == p) { -+#if PHP_MAJOR_VERSION < 7 - add_next_index_stringl(return_value, p + prefix_len, len - 1 - prefix_len, 1); -+#else -+ add_next_index_stringl(return_value, p + prefix_len, len - 1 - prefix_len); -+#endif - } - - p += len; -- cgit