diff options
-rw-r--r-- | PHPINFO | 2 | ||||
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | awscrt-build.patch | 45 | ||||
-rw-r--r-- | awscrt-parser.patch | 16 | ||||
-rw-r--r-- | php-pecl-awscrt.spec | 92 |
5 files changed, 105 insertions, 52 deletions
@@ -1,7 +1,7 @@ awscrt -Version => 1.2.6 +Version => 1.2.7 Directive => Local Value => Master Value awscrt.log_level => no value => no value @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #108 awscrt version 1.2.6 ] { +Extension [ <persistent> extension #125 awscrt version 1.2.7 ] { - INI { Entry [ awscrt.log_level <ALL> ] diff --git a/awscrt-build.patch b/awscrt-build.patch new file mode 100644 index 0000000..208e2e2 --- /dev/null +++ b/awscrt-build.patch @@ -0,0 +1,45 @@ +diff -up ./config.m4.old ./config.m4 +--- ./config.m4.old 2024-10-21 08:45:48.099506102 +0200 ++++ ./config.m4 2024-10-21 08:46:42.647663062 +0200 +@@ -26,5 +26,6 @@ if test "$PHP_AWSCRT" != "no"; then + # Sources for the PHP extension itself + AWSCRT_SOURCES=ext/awscrt.c + PHP_NEW_EXTENSION(awscrt, $AWSCRT_SOURCES, $ext_shared) ++ PHP_ADD_BUILD_DIR($ext_builddir/ext) + PHP_ADD_MAKEFILE_FRAGMENT + fi +diff -up ./Makefile.frag.old ./Makefile.frag +--- ./Makefile.frag.old 2024-10-21 08:45:58.170904348 +0200 ++++ ./Makefile.frag 2024-10-21 09:29:21.845818243 +0200 +@@ -1,7 +1,7 @@ + + INT_DIR=$(builddir)/build/install + CMAKE_BUILD_DIR=$(builddir)/cmake_build +-GENERATE_STUBS=$(shell expr `php --version | head -1 | cut -f 2 -d' '` \>= 7.1) ++GENERATE_STUBS=$(shell expr `$(PHP_EXECUTABLE) --version | head -1 | cut -f 2 -d' '` \>= 7.1) + + CMAKE = cmake3 + ifeq (, $(shell which cmake3)) +@@ -58,17 +58,18 @@ extension: $(builddir)/ext/awscrt.lo + # Force the crt object target to depend on the CRT static library + $(builddir)/ext/awscrt.lo: $(builddir)/ext/awscrt.c + +-$(builddir)/ext/awscrt.c: $(CMAKE_BUILD_DIR)/aws-crt-ffi-static/libaws-crt-ffi.a $(builddir)/ext/api.h $(builddir)/ext/awscrt_arginfo.h ++$(builddir)/ext/awscrt.c: $(CMAKE_BUILD_DIR)/aws-crt-ffi-static/libaws-crt-ffi.a $(srcdir)/ext/api.h $(srcdir)/ext/awscrt_arginfo.h + +-$(builddir)/ext/awscrt_arginfo.h: $(srcdir)/ext/awscrt.stub.php $(srcdir)/gen_stub.php ++$(srcdir)/ext/awscrt_arginfo.h: $(srcdir)/ext/awscrt.stub.php $(srcdir)/gen_stub.php + ifeq ($(GENERATE_STUBS),1) + # generate awscrt_arginfo.h +- mkdir -p $(builddir)/ext && php $(srcdir)/gen_stub.php --minimal-arginfo $(srcdir)/ext/awscrt.stub.php ++ $(PHP_EXECUTABLE) $(srcdir)/gen_stub.php --minimal-arginfo $(srcdir)/ext/awscrt.stub.php + endif + + # transform/install api.h from FFI lib + $(srcdir)/ext/api.h: $(srcdir)/crt/aws-crt-ffi/src/api.h +- php $(srcdir)/gen_api.php $(srcdir)/crt/aws-crt-ffi/src/api.h > $(srcdir)/ext/api.h ++ # generate api.h ++ $(PHP_EXECUTABLE) $(srcdir)/gen_api.php $(srcdir)/crt/aws-crt-ffi/src/api.h > $(srcdir)/ext/api.h + + # install api.h to ext/ as well + $(builddir)/ext/api.h : $(srcdir)/ext/api.h diff --git a/awscrt-parser.patch b/awscrt-parser.patch new file mode 100644 index 0000000..2670839 --- /dev/null +++ b/awscrt-parser.patch @@ -0,0 +1,16 @@ +diff -up ./gen_stub.php.old ./gen_stub.php +--- ./gen_stub.php.old 2024-10-21 07:42:09.285923573 +0200 ++++ ./gen_stub.php 2024-10-21 07:43:44.385591795 +0200 +@@ -1809,6 +1809,12 @@ function initPhpParser() { + } + + $isInitialized = true; ++ ++ if (file_exists('/usr/share/php/PhpParser4/autoload.php')) { ++ require_once '/usr/share/php/PhpParser4/autoload.php'; ++ return; ++ } ++ + $version = "4.9.0"; + $phpParserDir = __DIR__ . "/PHP-Parser-$version"; + if (!is_dir($phpParserDir)) { diff --git a/php-pecl-awscrt.spec b/php-pecl-awscrt.spec index 4b1dab7..8628bd5 100644 --- a/php-pecl-awscrt.spec +++ b/php-pecl-awscrt.spec @@ -11,12 +11,6 @@ %{?scl:%scl_package php-pecl-awscrt} -# For PHP < 5.6 and EPEL-9 -%{!?__phpize: %global __phpize %{_bindir}/phpize} -%{!?__ztsphpize: %global __ztsphpize %{_bindir}/zts-phpize} -%{!?__phpconfig: %global __phpconfig %{_bindir}/php-config} -%{!?__ztsphpconfig:%global __ztsphpconfig %{_bindir}/zts-php-config} - # not wanted for now %global with_zts 0 %global pecl_name awscrt @@ -26,41 +20,44 @@ Summary: AWS Common Runtime PHP bindings Name: %{?scl_prefix}php-pecl-%{pecl_name} -Version: 1.2.6 +Version: 1.2.7 Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} # extension is Apache-2.0 -# see LICENSE* for rust libraries +# see LICENSE* and THIRD-PARTY-LICENSES.txt for bundled libraries +# ittapi, ittnotify.h: GPL-2.0-only OR BSD-3-Clause +# cJSON, libcbor: MIT License: Apache-2.0 AND MIT AND BSD-3-Clause URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{sources}.tgz -%if 0%{?rhel} == 7 && 0%{?dtsversion} == 0 -BuildRequires: devtoolset-6-toolchain -%global dtsversion 6 -%global dtsenable source /opt/rh/devtoolset-6/enable -%global dtsprefix devtoolset-6- -%endif +# use system nikic/php-parser +Patch0: %{pecl_name}-parser.patch +# Fix out of sources build +Patch1: %{pecl_name}-build.patch + BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 5.5 +BuildRequires: %{?scl_prefix}php-devel BuildRequires: %{?scl_prefix}php-cli BuildRequires: %{?scl_prefix}php-pear BuildRequires: openssl-devel -%if 0%{?rhel} == 7 -BuildRequires: cmake3 -%else -BuildRequires: cmake +%if 0%{?fedora} >= 41 +BuildRequires: openssl-devel-engine %endif +BuildRequires: cmake +BuildRequires: php-nikic-php-parser4 # List from config.m4 Provides: bundled(libaws-crt-ffi) Provides: bundled(libaws-c-auth) -Provides: bundled(libaws-c-http) -Provides: bundled(libaws-c-io) Provides: bundled(libaws-c-cal) +Provides: bundled(libaws-c-common) Provides: bundled(libaws-c-compression) +Provides: bundled(libaws-c-event-stream) +Provides: bundled(libaws-c-http) +Provides: bundled(libaws-c-io) +Provides: bundled(libaws-c-sdkutils) Provides: bundled(libaws-checksums) -Provides: bundled(libaws-c-common) Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} @@ -85,13 +82,15 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO # Don't install/register tests sed -e 's/role="test"/role="src"/' \ -e 's/role="doc"/role="src"/' \ - %{!?_licensedir:-e '/LICENSE/s/role="src"/role="doc"/' } \ -e '/"CODE_OF_CONDUCT.md"/s/role="src"/role="doc"/'\ -e '/"CONTRIBUTING.md"/s/role="src"/role="doc"/'\ -e '/"README.md"/s/role="src"/role="doc"/'\ -i package.xml pushd %{sources} +%patch -P0 -p1 -b .phpparser +%patch -P1 -p1 -b .fixbuild + # Parallel build sed -e '/(CMAKE_BUILD)/s/$/ --verbose %{?_smp_mflags}/' -i Makefile.frag @@ -126,13 +125,16 @@ export PHP_RPATH=no cd %{sources} %{__phpize} +[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global +sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL cd ../NTS %configure \ --with-awscrt \ --with-libdir=%{_lib} \ --with-php-config=%{__phpconfig} -make %{?_smp_mflags} + +%make_build %if %{with_zts} cd ../ZTS @@ -140,25 +142,25 @@ cd ../ZTS --with-awscrt \ --with-libdir=%{_lib} \ --with-php-config=%{__ztsphpconfig} -make %{?_smp_mflags} + +%make_build %endif %install %{?dtsenable} -make -C NTS \ - install INSTALL_ROOT=%{buildroot} +%make_install -C NTS # install config file install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} + # Install XML package description install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml %if %{with_zts} -make -C ZTS \ - install INSTALL_ROOT=%{buildroot} +%make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -169,26 +171,6 @@ do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif - - %check # Minimal load test for NTS extension %{__php} --no-php-ini \ @@ -204,7 +186,9 @@ fi %files -%{?_licensedir:%license %{sources}/LICENSE} +%license %{sources}/LICENSE +%license %{sources}/crt/aws-crt-ffi/crt/aws-c-common/THIRD-PARTY-LICENSES.txt + %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -218,6 +202,14 @@ fi %changelog +* Mon Oct 21 2024 Remi Collet <remi@remirepo.net> - 1.2.7-1 +- update to 1.2.7 +- fix out of sources tree using patch from + https://github.com/awslabs/aws-crt-php/pull/117 + +* Thu Aug 22 2024 Remi Collet <remi@remirepo.net> - 1.2.6-2 +- missing BR on F41 + * Fri Jun 14 2024 Remi Collet <remi@remirepo.net> - 1.2.6-1 - update to 1.2.6 |