From e8efd658b28f8f07c3555d011113c01d88aada39 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 3 Apr 2023 08:03:27 +0200 Subject: update to 1.1.0 drop patch merged upstream --- PHPINFO | 4 +- REFLECTION | 2 +- php-smbclient.spec | 51 ++- smbclient-stub.patch | 881 --------------------------------------------------- 4 files changed, 22 insertions(+), 916 deletions(-) delete mode 100644 smbclient-stub.patch diff --git a/PHPINFO b/PHPINFO index d4bae84..737438a 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,5 +2,5 @@ smbclient smbclient Support => enabled -smbclient extension Version => 1.0.6 -libsmbclient library Version => 4.15.5 +smbclient extension Version => 1.1.0 +libsmbclient library Version => 4.17.6 diff --git a/REFLECTION b/REFLECTION index 5742b34..610c54d 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #120 smbclient version 1.0.6 ] { +Extension [ extension #122 smbclient version 1.1.0 ] { - Constants [30] { Constant [ int SMBCLIENT_XATTR_CREATE ] { 1 } diff --git a/php-smbclient.spec b/php-smbclient.spec index 6a7fcde..8c55e6b 100644 --- a/php-smbclient.spec +++ b/php-smbclient.spec @@ -1,7 +1,7 @@ # remirepo spec file for php-smbclient # -# Copyright (c) 2015-2022 Remi Collet -# License: CC-BY-SA +# Copyright (c) 2015-2023 Remi Collet +# License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries @@ -11,7 +11,6 @@ %if 0%{?scl:1} -%global sub_prefix %{scl_prefix} %scl_package php-smbclient %else %global pkg_name %{name} @@ -32,36 +31,35 @@ %global ini_name 40-%{pecl_name}.ini %endif # Test suite requires a Samba server and configuration file -%global with_tests 0%{?_with_tests:1} +%bcond_with tests -Name: %{?sub_prefix}php-smbclient -Version: 1.0.6 + +Name: %{?scl_prefix}php-smbclient +Version: 1.1.0 %if 0%{?gh_date} Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %else -Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %endif Summary: PHP wrapper for libsmbclient -License: BSD +License: BSD-2-Clause URL: https://github.com/eduardok/libsmbclient-php %if 0%{?gh_date} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz %endif -%if %{with_tests} +%if %{with tests} Source2: %{pecl_name}-phpunit.xml %endif -Patch0: %{pecl_name}-stub.patch - BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-pear BuildRequires: libsmbclient-devel > 3.6 -%if %{with_tests} +%if %{with tests} BuildRequires: php-composer(phpunit/phpunit) BuildRequires: samba %endif @@ -70,20 +68,16 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} %{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} # Rename -Obsoletes: %{?sub_prefix}php-libsmbclient < 0.8.0-0.2 -Provides: %{?sub_prefix}php-libsmbclient = %{version}-%{release} -Provides: %{?sub_prefix}php-libsmbclient%{?_isa} = %{version}-%{release} -%if "%{?scl_prefix}" != "%{?sub_prefix}" -Provides: %{?scl_prefix}php-%{pecl_name} = %{version}-%{release} -Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}-%{release} -%endif +Obsoletes: %{?scl_prefix}php-libsmbclient < 0.8.0-0.2 +Provides: %{?scl_prefix}php-libsmbclient = %{version}-%{release} +Provides: %{?scl_prefix}php-libsmbclient%{?_isa} = %{version}-%{release} # PECL Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7 # Other third party repo stuff %if "%{php_version}" > "7.0" Obsoletes: php70u-pecl-%{pecl_name} <= %{version} @@ -97,15 +91,6 @@ Obsoletes: php72u-pecl-%{pecl_name} <= %{version} %if "%{php_version}" > "7.3" Obsoletes: php73-pecl-%{pecl_name} <= %{version} %endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.0" -Obsoletes: php80-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "8.1" -Obsoletes: php81-pecl-%{pecl_name} <= %{version} -%endif %endif @@ -132,8 +117,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 - # Check extension version ver=$(sed -n '/define PHP_SMBCLIENT_VERSION/{s/.* "//;s/".*$//;p}' php_smbclient.h) if test "$ver" != "%{version}%{?prever}%{?gh_date:-dev}"; then @@ -205,7 +188,7 @@ done --modules | grep '^%{pecl_name}$' %endif -%if %{with_tests} +%if %{with tests} : Upstream test suite for NTS extension cd NTS cp %{SOURCE2} phpunit.xml @@ -251,6 +234,10 @@ fi %changelog +* Mon Apr 3 2023 Remi Collet - 1.1.0-1 +- update to 1.1.0 +- drop patch merged upstream + * Mon Feb 7 2022 Remi Collet - 1.0.6-6 - add fix from https://github.com/eduardok/libsmbclient-php/pull/94 diff --git a/smbclient-stub.patch b/smbclient-stub.patch deleted file mode 100644 index 571ad1f..0000000 --- a/smbclient-stub.patch +++ /dev/null @@ -1,881 +0,0 @@ -From 4b17fed6363c109ef34baebce1e367acd97a3c13 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 7 Feb 2022 16:43:42 +0100 -Subject: [PATCH] generate arginfo from stub - fix smbclient_rename parameters - name - fix smbclient_chmod, mode is required - fix smbclient_utimes: mtime - and atime are optional - ---- - package.xml | 3 + - smbclient.c | 164 +----------------------- - smbclient.stub.php | 189 ++++++++++++++++++++++++++++ - smbclient_arginfo.h | 249 +++++++++++++++++++++++++++++++++++++ - smbclient_legacy_arginfo.h | 226 +++++++++++++++++++++++++++++++++ - 5 files changed, 671 insertions(+), 160 deletions(-) - create mode 100644 smbclient.stub.php - create mode 100644 smbclient_arginfo.h - create mode 100644 smbclient_legacy_arginfo.h - -diff --git a/smbclient.c b/smbclient.c -index a63bad4..6b98693 100644 ---- a/smbclient.c -+++ b/smbclient.c -@@ -147,172 +147,16 @@ hide_password (char *url, int len) - astfill(second_colon + 1, at_sign - 1); - } - --/* {{{ arginfo */ --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_void, 0) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO_EX(arginfo_smbclient_state_init, 0, 0, 1) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, workgroup) -- ZEND_ARG_INFO(0, user) -- ZEND_ARG_INFO(0, password) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_state, 0) -- ZEND_ARG_INFO(0, state) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_option_get, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, option) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_option_set, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, option) -- ZEND_ARG_INFO(0, value) --ZEND_END_ARG_INFO() -- --#if HAVE_SMBC_SETOPTIONPROTOCOLS --ZEND_BEGIN_ARG_INFO_EX(arginfo_smbclient_client_protocols, 0, 0, 1) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, minproto) -- ZEND_ARG_INFO(0, maxproto) --ZEND_END_ARG_INFO() --#endif -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_path, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, path) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_rename, 0) -- ZEND_ARG_INFO(0, oldstate) -- ZEND_ARG_INFO(0, oldpath) -- ZEND_ARG_INFO(0, oldstate) -- ZEND_ARG_INFO(0, oldpath) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_dir, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, dir) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_file, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, file) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_read, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, file) -- ZEND_ARG_INFO(0, count) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO_EX(arginfo_smbclient_open, 0, 0, 3) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, path) -- ZEND_ARG_INFO(0, flags) -- ZEND_ARG_INFO(0, mode) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO_EX(arginfo_smbclient_creat, 0, 0, 2) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, path) -- ZEND_ARG_INFO(0, mode) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO_EX(arginfo_smbclient_write, 0, 0, 3) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, file) -- ZEND_ARG_INFO(0, buffer) -- ZEND_ARG_INFO(0, count) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_lseek, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, file) -- ZEND_ARG_INFO(0, offset) -- ZEND_ARG_INFO(0, whence) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_ftruncate, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, file) -- ZEND_ARG_INFO(0, offset) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_utimes, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, path) -- ZEND_ARG_INFO(0, mtime) -- ZEND_ARG_INFO(0, atime) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO(arginfo_smbclient_getxattr, 0) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, path) -- ZEND_ARG_INFO(0, name) --ZEND_END_ARG_INFO() -- --ZEND_BEGIN_ARG_INFO_EX(arginfo_smbclient_setxattr, 0, 0, 4) -- ZEND_ARG_INFO(0, state) -- ZEND_ARG_INFO(0, path) -- ZEND_ARG_INFO(0, name) -- ZEND_ARG_INFO(0, value) -- ZEND_ARG_INFO(0, flags) --ZEND_END_ARG_INFO() -- --/* }}} */ -- --static zend_function_entry smbclient_functions[] = --{ -- PHP_FE(smbclient_version, arginfo_smbclient_void) -- PHP_FE(smbclient_library_version, arginfo_smbclient_void) -- PHP_FE(smbclient_state_new, arginfo_smbclient_void) -- PHP_FE(smbclient_state_init, arginfo_smbclient_state_init) -- PHP_FE(smbclient_state_errno, arginfo_smbclient_state) -- PHP_FE(smbclient_state_free, arginfo_smbclient_state) -- PHP_FE(smbclient_option_get, arginfo_smbclient_option_get) -- PHP_FE(smbclient_option_set, arginfo_smbclient_option_set) --#if HAVE_SMBC_SETOPTIONPROTOCOLS -- PHP_FE(smbclient_client_protocols, arginfo_smbclient_client_protocols) --#endif -- PHP_FE(smbclient_opendir, arginfo_smbclient_path) -- PHP_FE(smbclient_readdir, arginfo_smbclient_dir) -- PHP_FE(smbclient_closedir, arginfo_smbclient_dir) -- PHP_FE(smbclient_stat, arginfo_smbclient_path) -- PHP_FE(smbclient_fstat, arginfo_smbclient_file) -- PHP_FE(smbclient_open, arginfo_smbclient_open) -- PHP_FE(smbclient_creat, arginfo_smbclient_creat) -- PHP_FE(smbclient_read, arginfo_smbclient_read) -- PHP_FE(smbclient_close, arginfo_smbclient_file) -- PHP_FE(smbclient_mkdir, arginfo_smbclient_creat) -- PHP_FE(smbclient_rmdir, arginfo_smbclient_path) -- PHP_FE(smbclient_rename, arginfo_smbclient_rename) -- PHP_FE(smbclient_write, arginfo_smbclient_write) -- PHP_FE(smbclient_unlink, arginfo_smbclient_path) -- PHP_FE(smbclient_lseek, arginfo_smbclient_lseek) -- PHP_FE(smbclient_ftruncate, arginfo_smbclient_ftruncate) -- PHP_FE(smbclient_chmod, arginfo_smbclient_creat) -- PHP_FE(smbclient_utimes, arginfo_smbclient_utimes) -- PHP_FE(smbclient_listxattr, arginfo_smbclient_path) -- PHP_FE(smbclient_getxattr, arginfo_smbclient_getxattr) -- PHP_FE(smbclient_setxattr, arginfo_smbclient_setxattr) -- PHP_FE(smbclient_removexattr, arginfo_smbclient_getxattr) -- PHP_FE(smbclient_statvfs, arginfo_smbclient_path) -- PHP_FE(smbclient_fstatvfs, arginfo_smbclient_file) --#ifdef PHP_FE_END -- PHP_FE_END -+#if PHP_VERSION_ID < 80000 -+#include "smbclient_legacy_arginfo.h" - #else -- {NULL, NULL, NULL} -+#include "smbclient_arginfo.h" - #endif --}; - - zend_module_entry smbclient_module_entry = - { STANDARD_MODULE_HEADER - , "smbclient" /* name */ -- , smbclient_functions /* functions */ -+ , ext_functions /* functions */ - , PHP_MINIT(smbclient) /* module_startup_func */ - , PHP_MSHUTDOWN(smbclient) /* module_shutdown_func */ - , PHP_RINIT(smbclient) /* request_startup_func */ -diff --git a/smbclient.stub.php b/smbclient.stub.php -new file mode 100644 -index 0000000..65f5fad ---- /dev/null -+++ b/smbclient.stub.php -@@ -0,0 +1,189 @@ -+