summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-11-01 07:34:28 +0100
committerRemi Collet <fedora@famillecollet.com>2013-11-01 07:34:28 +0100
commit3114c56daf9aa2c8cf187147528a318ad9e9c570 (patch)
treea7e4d6441da891d846a81e45ca364beca31c5a23
parentd81c8099a5207b58c80124f63052444865205ec7 (diff)
php-pecl-xmldiff: fix build with php 5.3.3 in RHEL-6
-rw-r--r--php-pecl-xmldiff.spec23
-rw-r--r--xmldiff-php533.patch40
2 files changed, 59 insertions, 4 deletions
diff --git a/php-pecl-xmldiff.spec b/php-pecl-xmldiff.spec
index b3b7cdf..5a7d156 100644
--- a/php-pecl-xmldiff.spec
+++ b/php-pecl-xmldiff.spec
@@ -6,9 +6,10 @@
#
# Please, preserve the changelog entries
#
-%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}}
-%{!?php_incldir: %{expand: %%global php_incldir %{_includedir}/php}}
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
+%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
+%{!?php_incldir: %global php_incldir %{_includedir}/php}
+%{!?__pecl: %global __pecl %{_bindir}/pecl}
+%{!?__php: %global __php %{_bindir}/php}
%global with_zts 0%{?__ztsphp:1}
%global pecl_name xmldiff
@@ -16,12 +17,16 @@
Summary: XML diff and merge
Name: php-pecl-%{pecl_name}
Version: 0.9.0
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?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
+# Fix build with PHP <= 5.3.6
+# http://svn.php.net/viewvc?view=revision&revision=332040
+Patch0: %{pecl_name}-php533.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: php-devel > 5.3
BuildRequires: php-pear
@@ -34,8 +39,14 @@ Requires(post): %{__pecl}
Requires(postun): %{__pecl}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
+%if "%{php_version}" < "5.4"
+# php 5.3.3 in EL-6 don't use arched virtual provides
+# so requires the real package instead
+Requires: php-xml%{?_isa}
+%else
Requires: php-dom%{?_isa}
Requires: php-libxml%{?_isa}
+%endif
Provides: php-%{pecl_name} = %{version}
Provides: php-%{pecl_name}%{?_isa} = %{version}
@@ -69,6 +80,7 @@ These are the files needed to compile programs using %{name}.
mv %{pecl_name}-%{version} NTS
cd NTS
+%patch0 -p1
# drop bundled library to ensure it is not used
rm -rf diffmark
@@ -199,6 +211,9 @@ rm -rf %{buildroot}
%changelog
+* Fri Nov 01 2013 Remi Collet <remi@fedoraproject.org> - 0.9.0-2
+- fix build with php 5.3.3 in RHEL-6
+
* Wed Oct 02 2013 Remi Collet <remi@fedoraproject.org> - 0.9.0-1
- Update to 0.9.0
- License now provided in upstream sources
diff --git a/xmldiff-php533.patch b/xmldiff-php533.patch
new file mode 100644
index 0000000..8ef4434
--- /dev/null
+++ b/xmldiff-php533.patch
@@ -0,0 +1,40 @@
+diff -up xmldiff-0.9.0/php_xmldiff.h.old xmldiff-0.9.0/php_xmldiff.h
+--- xmldiff-0.9.0/php_xmldiff.h.old 2013-11-01 07:13:21.917000281 +0100
++++ xmldiff-0.9.0/php_xmldiff.h 2013-11-01 06:58:51.805999994 +0100
+@@ -162,7 +162,14 @@ PHP_XMLDIFF_API xmlChar *
+ php_xmldiff_do_merge_memory(const char *src, int src_len, const char *diff, int diff_len, struct ze_xmldiff_obj *zxo TSRMLS_DC);
+
+ #if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3
+-# define DOM_RET_OBJ_EX DOM_RET_OBJ
++# define XMLDIFF_DOM_RET_OBJ DOM_RET_OBJ
++#elif PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION > 6
++# define XMLDIFF_DOM_RET_OBJ DOM_RET_OBJ_EX
++#else
++# define XMLDIFF_DOM_RET_OBJ(obj, ret, domobject); do { \
++ zval *rv = NULL; \
++ DOM_RET_OBJ(rv, obj, ret, domobject); \
++ } while(0);
+ #endif
+
+ #endif /* PHP_XMLDIFF_H */
+diff -up xmldiff-0.9.0/xmldiff.cpp.old xmldiff-0.9.0/xmldiff.cpp
+--- xmldiff-0.9.0/xmldiff.cpp.old 2013-11-01 07:13:36.941006721 +0100
++++ xmldiff-0.9.0/xmldiff.cpp 2013-11-01 06:56:56.729005006 +0100
+@@ -577,7 +577,7 @@ PHP_METHOD(XMLDiffDOM, diff)
+ retNode = (xmlNodePtr)retDoc;
+
+ /* return the resulting dom object */
+- DOM_RET_OBJ_EX(retNode, &domRetStatus, NULL);
++ XMLDIFF_DOM_RET_OBJ(retNode, &domRetStatus, NULL);
+
+ /* set return object properties */
+ php_xmldiff_set_out_dom_props(return_value TSRMLS_CC);
+@@ -626,7 +626,7 @@ PHP_METHOD(XMLDiffDOM, merge)
+ retNode = (xmlNodePtr)retDoc;
+
+ /* return the resulting dom object */
+- DOM_RET_OBJ_EX(retNode, &domRetStatus, NULL);
++ XMLDIFF_DOM_RET_OBJ(retNode, &domRetStatus, NULL);
+
+ /* set return object properties */
+ php_xmldiff_set_out_dom_props(return_value TSRMLS_CC);