From 8db9c8e33b4ec09616c76b13fb8cb0ce7a693ee4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Oct 03 2019 15:52:23 +0000 Subject: rebuild for https://fedoraproject.org/wiki/Changes/php74 add upstream patch for 7.4 --- diff --git a/e27ff18ac768aae1cf955111179ec68307d37475.patch b/e27ff18ac768aae1cf955111179ec68307d37475.patch new file mode 100644 index 0000000..d64c262 --- /dev/null +++ b/e27ff18ac768aae1cf955111179ec68307d37475.patch @@ -0,0 +1,36 @@ +From e27ff18ac768aae1cf955111179ec68307d37475 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 23 May 2019 13:19:20 +0200 +Subject: [PATCH] fix php_pcre_match_impl call for 7.4 + +--- + provider.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/provider.c b/provider.c +index 1543d25..e2cd075 100644 +--- a/provider.c ++++ b/provider.c +@@ -205,6 +205,9 @@ static int oauth_provider_parse_auth_header(php_oauth_provider *sop, char *auth_ + zval subpats, return_value, *item_param, *current_param, *current_val; + HashPosition hpos; + zend_string *regex = zend_string_init(OAUTH_REGEX, sizeof(OAUTH_REGEX) - 1, 0); ++#if PHP_VERSION_ID >= 70400 ++ zend_string *s_auth_header = zend_string_init(auth_header, strlen(auth_header), 0); ++#endif + size_t decoded_len; + + if(!auth_header || strncasecmp(auth_header, "oauth", 4) || !sop) { +@@ -224,8 +227,12 @@ static int oauth_provider_parse_auth_header(php_oauth_provider *sop, char *auth_ + + php_pcre_match_impl( + pce, ++#if PHP_VERSION_ID >= 70400 ++ s_auth_header, ++#else + auth_header, + strlen(auth_header), ++#endif + &return_value, + &subpats, + 1, /* global */ diff --git a/php-pecl-oauth.spec b/php-pecl-oauth.spec index 5d929b5..5737f6a 100644 --- a/php-pecl-oauth.spec +++ b/php-pecl-oauth.spec @@ -7,12 +7,14 @@ Name: php-pecl-oauth Version: 2.0.3 -Release: 3%{?dist} +Release: 4%{?dist} Summary: PHP OAuth consumer extension License: BSD URL: http://pecl.php.net/package/oauth Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +Patch0: https://github.com/php/pecl-web_services-oauth/commit/e27ff18ac768aae1cf955111179ec68307d37475.patch + BuildRequires: php-devel > 7 BuildRequires: php-pear BuildRequires: libcurl-devel @@ -43,6 +45,18 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml +cd NTS +sed -e '/PHP_OAUTH_VERSION/s/2.0.3-dev/2.0.3/' -i php_oauth.h +%patch0 -p1 + +# Sanity check, really often broken +extver=$(sed -n '/#define PHP_OAUTH_VERSION/{s/.* //;s/".*$//;p}' php_oauth.h) +if test "x${extver}" != "x%{version}"; then + : Error: Upstream extension version is ${extver}, expecting %{version}. + exit 1 +fi +cd .. + cat >%{ini_name} << 'EOF' ; Enable %{pecl_name} extension module extension=%{pecl_name}.so @@ -118,6 +132,10 @@ done %changelog +* Thu Oct 03 2019 Remi Collet - 2.0.3-4 +- rebuild for https://fedoraproject.org/wiki/Changes/php74 +- add upstream patch for 7.4 + * Fri Jul 26 2019 Fedora Release Engineering - 2.0.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild