diff options
| author | Remi Collet <remi@remirepo.net> | 2024-08-13 14:09:36 +0200 | 
|---|---|---|
| committer | Remi Collet <remi@php.net> | 2024-08-13 14:09:36 +0200 | 
| commit | 733d2a98958fb3184a36740b500a727f2269df4b (patch) | |
| tree | d8f63bf48e7eddf476bc0e8e25e1c4ba6a995441 | |
| parent | d0cc93e73c5b0d5ae1dc3c2c67b38224fa65c45f (diff) | |
use system openssl
| -rw-r--r-- | grpc-openssl.patch | 20 | ||||
| -rw-r--r-- | php-pecl-grpc.spec | 26 | 
2 files changed, 43 insertions, 3 deletions
diff --git a/grpc-openssl.patch b/grpc-openssl.patch new file mode 100644 index 0000000..8cb1f5e --- /dev/null +++ b/grpc-openssl.patch @@ -0,0 +1,20 @@ +--- ./config.m4.old	2024-08-13 12:14:53.273367368 +0200 ++++ ./config.m4	2024-08-13 12:20:46.644703516 +0200 +@@ -2,7 +2,15 @@ + [  --enable-grpc           Enable grpc support]) +  + if test "$PHP_GRPC" != "no"; then +-  dnl Write more examples of tests here... ++  PHP_ARG_WITH(openssl-dir, for OpenSSL installation prefix, ++  [  --with-openssl-dir[=DIR]  Event: openssl installation prefix], yes, no) ++  PHP_SETUP_OPENSSL(GRPC_SHARED_LIBADD, ++  [ ++  ], [ ++    AC_MSG_ERROR([OpenSSL libraries not found. ++      Check whether openssl is on your PKG_CONFIG_PATH and the output in config.log) ++    ]) ++  ]) +  +   dnl # --with-grpc -> add include path +   PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include) + diff --git a/php-pecl-grpc.spec b/php-pecl-grpc.spec index e43a4e7..66256eb 100644 --- a/php-pecl-grpc.spec +++ b/php-pecl-grpc.spec @@ -7,11 +7,18 @@  # Please, preserve the changelog entries  # -%{?scl:%scl_package php-pecl-grpc} +%if 0%{?scl:1} +%scl_package php-pecl-grpc +%else +%global _root_prefix %{_prefix} +%endif  ## TODO: not suitable for Fedora, tons of bundled libraries  ## use mock with --cleanup-after +## TODO: cleanup --with-openssl-dir, needed for PHP < 7.4 +%bcond_without           openssl +  %global pecl_name        grpc  %global with_zts         0%{!?_without_zts:%{?__ztsphp:1}}  %global ini_name         40-%{pecl_name}.ini @@ -25,7 +32,7 @@  Summary:        General RPC framework  Name:           %{?scl_prefix}php-pecl-%{pecl_name}  Version:        %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release:        1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release:        2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}  License:        Apache-2.0  URL:            https://pecl.php.net/package/%{pecl_name}  Source0:        https://pecl.php.net/get/%{sources}.tgz @@ -33,6 +40,7 @@ Source0:        https://pecl.php.net/get/%{sources}.tgz  Patch0:         %{pecl_name}-build.patch  Patch1:         %{pecl_name}-noatfork.patch  Patch2:         %{pecl_name}-workaround.patch +Patch3:         %{pecl_name}-openssl.patch  BuildRequires:  make  BuildRequires:  %{?dtsprefix}gcc >= 7.0 @@ -40,6 +48,9 @@ BuildRequires:  %{?dtsprefix}gcc-c++  BuildRequires:  %{?scl_prefix}php-devel >= 7.0  BuildRequires:  %{?scl_prefix}php-pear  BuildRequires:  zlib-devel +%if %{with openssl} +BuildRequires:  openssl-devel +%endif  Requires:       %{?scl_prefix}php(zend-abi) = %{php_zend_api}  Requires:       %{?scl_prefix}php(api) = %{php_core_api} @@ -74,9 +85,13 @@ cd %{sources}  %patch -P1 -p1 -b .noatfork  %endif  %patch -P2 -p1 -b .nolog +%if %{with openssl} +%patch -P3 -p1 -b .openssl +sed -e '/boringssl-with-bazel/d' -i config.m4 +rm -r third_party/boringssl-with-bazel +%endif  #sed -e '/PHP_GRPC_VERSION/s/RC3/RC2/' -i src/php/ext/grpc/version.h -  # Sanity check, really often broken  extver=$(sed -n '/PHP_GRPC_VERSION/{s/.* "//;s/".*$//;p}' src/php/ext/grpc/version.h)  if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then @@ -112,6 +127,7 @@ cd %{sources}  cd ../NTS  %configure \      --enable-grpc \ +    --with-openssl-dir=%{_root_prefix} \      --with-libdir=%{_lib} \      --with-php-config=%{__phpconfig} @@ -121,6 +137,7 @@ make %{?_smp_mflags}  cd ../ZTS  %configure \      --enable-grpc \ +    --with-openssl-dir=%{_root_prefix} \      --with-libdir=%{_lib} \      --with-php-config=%{__ztsphpconfig} @@ -181,6 +198,9 @@ cd ../ZTS  %changelog +* Tue Aug 13 2024 Remi Collet <remi@remirepo.net> - 1.66.0~RC3-2 +- use system openssl +  * Tue Aug 13 2024 Remi Collet <remi@remirepo.net> - 1.66.0~RC3-1  - update to 1.66.0RC3  | 
