summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--2.patch29
-rw-r--r--php-pecl-ssdeep.spec40
2 files changed, 47 insertions, 22 deletions
diff --git a/2.patch b/2.patch
new file mode 100644
index 0000000..69a001d
--- /dev/null
+++ b/2.patch
@@ -0,0 +1,29 @@
+From 369e87e7469fd3e30bf46cff9f12f0d5bfc9e611 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 4 Sep 2020 14:47:29 +0200
+Subject: [PATCH] fix for PHP 8
+
+---
+ ssdeep.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/ssdeep.c b/ssdeep.c
+index 00e91e5..4dee7e2 100644
+--- a/ssdeep.c
++++ b/ssdeep.c
+@@ -48,6 +48,15 @@
+ #include "php_ssdeep.h"
+ #include <fuzzy.h>
+
++/* For PHP 8 */
++#ifndef TSRMLS_D
++#define TSRMLS_D void
++#define TSRMLS_DC
++#define TSRMLS_C
++#define TSRMLS_CC
++#define TSRMLS_FETCH()
++#endif
++
+ /* True global resources - no need for thread safety here */
+ ZEND_BEGIN_ARG_INFO_EX(arginfo_ssdeep_fuzzy_hash, 0, 0, 1)
+ ZEND_ARG_INFO(0, to_hash)
diff --git a/php-pecl-ssdeep.spec b/php-pecl-ssdeep.spec
index cbb73f6..36d3c78 100644
--- a/php-pecl-ssdeep.spec
+++ b/php-pecl-ssdeep.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-pecl-ssdeep
#
-# Copyright (c) 2014-2018 Remi Collet
+# Copyright (c) 2014-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -31,10 +31,12 @@
Summary: Wrapper for libfuzzy library
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 1.1.0
-Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: BSD
-URL: http://pecl.php.net/package/%{pecl_name}
-Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+URL: https://pecl.php.net/package/%{pecl_name}
+Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+
+Patch0: https://patch-diff.githubusercontent.com/raw/php/pecl-text-ssdeep/pull/2.patch
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel
@@ -52,31 +54,19 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
+%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
-%if "%{php_version}" > "5.6"
-Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.0"
-Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
-%endif
%if "%{php_version}" > "7.2"
Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php73-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-Obsoletes: php74w-pecl-%{pecl_name} <= %{version}
+Obsoletes: php74-pecl-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "8.0"
+Obsoletes: php80-pecl-%{pecl_name} <= %{version}
%endif
%endif
@@ -117,6 +107,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
pushd NTS
+%patch0 -p1 -b .pr2
+
# Sanity check, really often broken
extver=$(sed -n '/# *define PHP_SSDEEP_VERSION/{s/.* "//;s/".*$//;p}' php_ssdeep.h)
if test "x${extver}" != "x%{version}%{?versuf}"; then
@@ -247,6 +239,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Sep 4 2020 Remi Collet <remi@remirepo.net> - 1.1.0-6
+- add patch for PHP 8 from
+ https://github.com/php/pecl-text-ssdeep/pull/2
+
* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 1.1.0-5
- rebuild for 7.4.0RC1