From 05be3296b84a910e5cb9417414c7ffde59d51dcd Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 8 Nov 2016 13:27:18 +0100 Subject: php-smbclient: 0.9.0-dev (performance patch) --- REFLECTION | 2 +- php-smbclient.spec | 30 ++++++++++++++++++++---------- smbclient-zts.patch | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 11 deletions(-) create mode 100644 smbclient-zts.patch diff --git a/REFLECTION b/REFLECTION index 3070357..c022792 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #158 smbclient version 0.8.0 ] { +Extension [ extension #115 smbclient version 0.9.0-dev ] { - Constants [30] { Constant [ integer SMBCLIENT_XATTR_CREATE ] { 1 } diff --git a/php-smbclient.spec b/php-smbclient.spec index dcd1c0a..df2e564 100644 --- a/php-smbclient.spec +++ b/php-smbclient.spec @@ -14,11 +14,11 @@ %endif %endif -%global gh_commit 8b9587df1a0859074eae6133c5210451d6527e38 +%global gh_commit 18570160a5cb427ed4d55a3a4dc4431d2bea6949 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner eduardok %global gh_project libsmbclient-php -#global gh_date 20150909 +%global gh_date 20161104 #global prever RC1 %{?scl: %scl_package php-smbclient} @@ -35,17 +35,20 @@ %global with_tests 0%{?_with_tests:1} Name: %{?sub_prefix}php-smbclient -Version: 0.8.0 +Version: 0.9.0 +%if 0%{?gh_date} +Release: 0.1.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +%else Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +%endif + Summary: PHP wrapper for libsmbclient Group: Development/Languages License: BSD URL: https://github.com/eduardok/libsmbclient-php -%if 0%{?ghdate} -Source0: %{pkg_name}-%{version}-%{gh_short}.tgz -# git snapshot as upstream doesn't provide test suite -Source1: makesrc.sh +%if 0%{?gh_date} +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz %endif @@ -53,6 +56,8 @@ Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz Source2: %{gh_project}-phpunit.xml %endif +Patch0: %{pecl_name}-zts.patch + BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear BuildRequires: libsmbclient-devel > 3.6 @@ -122,7 +127,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -%if 0%{?ghdate} +%if 0%{?gh_date} mv %{gh_project}-%{gh_commit} NTS mv NTS/package.xml . %else @@ -135,10 +140,12 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .zts + # Check extension version ver=$(sed -n '/define PHP_SMBCLIENT_VERSION/{s/.* "//;s/".*$//;p}' php_smbclient.h) -if test "$ver" != "%{version}%{?prever}"; then - : Error: Upstream VERSION version is ${ver}, expecting %{version}%{?prever}. +if test "$ver" != "%{version}%{?prever}%{?gh_date:-dev}"; then + : Error: Upstream VERSION version is ${ver}, expecting %{version}%{?prever}%{?gh_date:-dev}. exit 1 fi cd .. @@ -248,6 +255,9 @@ fi %changelog +* Tue Nov 8 2016 Remi Collet - 0.9.0-0.1.20161104git1857016 +- update to 0.9.0-dev for stream performance + * Wed Sep 14 2016 Remi Collet - 0.8.0-2 - rebuild for PHP 7.1 new API version diff --git a/smbclient-zts.patch b/smbclient-zts.patch new file mode 100644 index 0000000..56e8f0c --- /dev/null +++ b/smbclient-zts.patch @@ -0,0 +1,49 @@ +From 2f30d7689efcb1e3c1c2f8e495884409a009fae1 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Tue, 8 Nov 2016 13:17:20 +0100 +Subject: [PATCH] fix ZTS build + +--- + php_smbclient.h | 2 +- + smb_streams.c | 2 +- + smbclient.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/php_smbclient.h b/php_smbclient.h +index ee6c936..34f7aa5 100644 +--- a/php_smbclient.h ++++ b/php_smbclient.h +@@ -133,6 +133,6 @@ php_smbclient_state * php_smbclient_state_new (php_stream_context *context, int + void php_smbclient_state_free (php_smbclient_state *state TSRMLS_DC); + int php_smbclient_state_init (php_smbclient_state *state TSRMLS_DC); + int flagstring_to_smbflags (const char *flags, int flags_len, int *retval TSRMLS_DC); +-void php_smb_pool_cleanup(void); ++void php_smb_pool_cleanup(TSRMLS_D); + + #endif /* PHP_SMBCLIENT_H */ +diff --git a/smb_streams.c b/smb_streams.c +index 454708b..b6f73c6 100644 +--- a/smb_streams.c ++++ b/smb_streams.c +@@ -149,7 +149,7 @@ static void php_smb_pool_drop(php_smbclient_state *state TSRMLS_DC) + } + } + +-void php_smb_pool_cleanup(void) { ++void php_smb_pool_cleanup(TSRMLS_D) { + struct _php_smb_pool *pool; + + pool = SMBCLIENT_G(pool_first); +diff --git a/smbclient.c b/smbclient.c +index e247987..791f078 100644 +--- a/smbclient.c ++++ b/smbclient.c +@@ -491,7 +491,7 @@ PHP_MSHUTDOWN_FUNCTION(smbclient) + + PHP_RSHUTDOWN_FUNCTION(smbclient) + { +- php_smb_pool_cleanup(); ++ php_smb_pool_cleanup(TSRMLS_C); + return SUCCESS; + } + -- cgit