summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--REFLECTION2
-rw-r--r--php-pecl-ssdeep.spec36
-rw-r--r--ssdeep-php7.patch100
4 files changed, 24 insertions, 123 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6f69818
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.bz2
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/REFLECTION b/REFLECTION
index 03307f4..d243f2a 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #131 ssdeep version 1.0.4 ] {
+Extension [ <persistent> extension #140 ssdeep version 1.1.0 ] {
- Functions {
Function [ <internal:ssdeep> function ssdeep_fuzzy_hash ] {
diff --git a/php-pecl-ssdeep.spec b/php-pecl-ssdeep.spec
index 3c87e37..79933ca 100644
--- a/php-pecl-ssdeep.spec
+++ b/php-pecl-ssdeep.spec
@@ -3,12 +3,16 @@
#
# Fedora spec file for php-pecl-ssdeep
#
-# Copyright (c) 2014-2017 Remi Collet
+# Copyright (c) 2014-2018 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
+
+# we don't want -z defs linker flag
+%undefine _strict_symbol_defs_build
+
%if 0%{?scl:1}
%global sub_prefix %{scl_prefix}
%scl_package php-pecl-ssdeep
@@ -26,16 +30,13 @@
Summary: Wrapper for libfuzzy library
Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 1.0.4
-Release: 13%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Version: 1.1.0
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: BSD
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-Patch0: %{pecl_name}-php7.patch
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: %{?scl_prefix}php-devel > 5.2
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: ssdeep-devel > 2.5
@@ -53,14 +54,6 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{rele
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
# Other third party repo stuff
-Obsoletes: php53-pecl-%{pecl_name} <= %{version}
-Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php54-pecl-%{pecl_name} <= %{version}
-Obsoletes: php54w-pecl-%{pecl_name} <= %{version}
-%if "%{php_version}" > "5.5"
-Obsoletes: php55u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
-%endif
%if "%{php_version}" > "5.6"
Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
@@ -108,6 +101,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
mv %{pecl_name}-%{version} NTS
+[ -f package2.xml ] && mv package2.xml package.xml
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
@@ -115,8 +109,6 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
pushd NTS
-%patch0 -p1 -b .php7
-
# 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
@@ -138,6 +130,8 @@ EOF
%build
+%{?dtsenable}
+
cd NTS
%{_bindir}/phpize
%configure \
@@ -158,7 +152,7 @@ make %{?_smp_mflags}
%install
-rm -rf %{buildroot}
+%{?dtsenable}
make -C NTS install INSTALL_ROOT=%{buildroot}
@@ -231,12 +225,7 @@ REPORT_EXIT_STATUS=1 \
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -250,6 +239,9 @@ rm -rf %{buildroot}
%changelog
+* Tue Feb 20 2018 Remi Collet <remi@remirepo.net> - 1.1.0-1
+- Update to 1.1.0
+
* Tue Jul 18 2017 Remi Collet <remi@remirepo.net> - 1.0.4-13
- rebuild for PHP 7.2.0beta1 new API
diff --git a/ssdeep-php7.patch b/ssdeep-php7.patch
deleted file mode 100644
index 05dbd4e..0000000
--- a/ssdeep-php7.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From c62cadc78de1ee69ca3643441477b779d0a817e4 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@php.net>
-Date: Mon, 6 Apr 2015 10:30:12 +0200
-Subject: [PATCH] PHP 7 compatibility
-
----
- php_ssdeep.h | 9 +++++++++
- ssdeep.c | 22 +++++++++++++---------
- 2 files changed, 22 insertions(+), 9 deletions(-)
-
-diff --git a/php_ssdeep.h b/php_ssdeep.h
-index 5deaa40..9a88de0 100644
---- a/php_ssdeep.h
-+++ b/php_ssdeep.h
-@@ -47,4 +47,13 @@
-
- extern zend_module_entry php_ssdeep_module_entry;
- # define phpext_php_ssdeep_ptr &php_ssdeep_module_entry
-+
-+#if PHP_MAJOR_VERSION < 7
-+typedef int strsize_t;
-+#define _RETURN_STRING(s) RETURN_STRING(s, 0);
-+#else
-+typedef size_t strsize_t;
-+#define _RETURN_STRING(s) { RETVAL_STRING(s); efree(s); return; }
-+#endif
-+
- #endif
-diff --git a/ssdeep.c b/ssdeep.c
-index 3cae212..81f4e07 100644
---- a/ssdeep.c
-+++ b/ssdeep.c
-@@ -67,8 +67,12 @@ ZEND_END_ARG_INFO()
- const zend_function_entry ssdeep_functions[] = {
- PHP_FE(ssdeep_fuzzy_hash, arginfo_ssdeep_fuzzy_hash)
- PHP_FE(ssdeep_fuzzy_hash_filename, arginfo_ssdeep_fuzzy_hash_filename)
-- PHP_FE(ssdeep_fuzzy_compare, arginfo_ssdeep_fuzzy_compare) {
-- NULL, NULL, NULL} /* Must be the last line in ssdeep_functions[] */
-+ PHP_FE(ssdeep_fuzzy_compare, arginfo_ssdeep_fuzzy_compare)
-+#ifdef PHP_FE_END
-+ PHP_FE_END
-+#else
-+ { NULL, NULL, NULL } /* Must be the last line in ssdeep_functions[] */
-+#endif
- };
- /* }}} */
-
-@@ -101,16 +105,16 @@ PHP_MINFO_FUNCTION(ssdeep) {
- PHP_FUNCTION(ssdeep_fuzzy_hash) {
- char *hash = (char *) emalloc(FUZZY_MAX_RESULT);
- char *to_hash;
-- int to_hash_len;
-+ strsize_t to_hash_len;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &to_hash, &to_hash_len) == FAILURE) {
- RETURN_NULL();
- }
-
-- if (0 != fuzzy_hash_buf((unsigned char *) to_hash, to_hash_len, hash)) {
-+ if (0 != fuzzy_hash_buf((unsigned char *) to_hash, (uint32_t)to_hash_len, hash)) {
- RETURN_FALSE;
- } else {
-- RETURN_STRING(hash, 0);
-+ _RETURN_STRING(hash);
- }
- }
- /* }}} */
-@@ -120,7 +124,7 @@ PHP_FUNCTION(ssdeep_fuzzy_hash) {
- PHP_FUNCTION(ssdeep_fuzzy_hash_filename) {
- char *hash = (char *) emalloc(FUZZY_MAX_RESULT);
- char *file_name;
-- int file_name_len;
-+ strsize_t file_name_len;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file_name, &file_name_len) == FAILURE) {
- RETURN_NULL();
-@@ -129,7 +133,7 @@ PHP_FUNCTION(ssdeep_fuzzy_hash_filename) {
- if (0 != fuzzy_hash_filename(file_name, hash)) {
- RETURN_FALSE;
- } else {
-- RETURN_STRING(hash, 0);
-+ _RETURN_STRING(hash);
- }
- }
- /* }}} */
-@@ -138,9 +142,9 @@ PHP_FUNCTION(ssdeep_fuzzy_hash_filename) {
- */
- PHP_FUNCTION(ssdeep_fuzzy_compare) {
- char *signature1 = NULL;
-- int signature1_len;
-+ strsize_t signature1_len;
- char *signature2 = NULL;
-- int signature2_len;
-+ strsize_t signature2_len;
- int match;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &signature1, &signature1_len, &signature2, &signature2_len) == FAILURE) {
---
-2.1.0
-