[php-idn] PHP 5.4.0 Build

Remi Collet remi at fedoraproject.org
Fri Jan 20 17:08:55 UTC 2012


commit cd18875bfba93b17770af2ede4c6d3837669db9e
Author: remi <fedora at famillecollet.com>
Date:   Fri Jan 20 18:08:26 2012 +0100

    PHP 5.4.0 Build

 idn-php54.patch |  129 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 php-idn.spec    |   28 +++++++++++-
 2 files changed, 155 insertions(+), 2 deletions(-)
---
diff --git a/idn-php54.patch b/idn-php54.patch
new file mode 100644
index 0000000..3eb89e6
--- /dev/null
+++ b/idn-php54.patch
@@ -0,0 +1,129 @@
+diff -up idn-1.2c/idn.c.php54 idn-1.2c/idn.c
+--- idn-1.2c/idn.c.php54	2011-12-28 16:59:36.398415766 +0100
++++ idn-1.2c/idn.c	2011-12-28 17:12:29.231434281 +0100
+@@ -92,7 +92,7 @@ ZEND_GET_MODULE(idn)
+ /* {{{ idn_functions[]
+  * Every user visible function must have an entry in idn_functions[].
+  */
+-function_entry idn_functions[] = {
++zend_function_entry idn_functions[] = {
+ 	PHP_FE(idn_prep_name,					NULL)
+ 	PHP_FE(idn_prep_kerberos5,				NULL)
+ 	PHP_FE(idn_prep_node,					NULL)
+@@ -417,7 +417,7 @@ PHP_FUNCTION(idn_prep_name)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -443,7 +443,7 @@ PHP_FUNCTION(idn_prep_kerberos5)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -469,7 +469,7 @@ PHP_FUNCTION(idn_prep_node)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -495,7 +495,7 @@ PHP_FUNCTION(idn_prep_resource)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -521,7 +521,7 @@ PHP_FUNCTION(idn_prep_plain)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -547,7 +547,7 @@ PHP_FUNCTION(idn_prep_trace)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -573,7 +573,7 @@ PHP_FUNCTION(idn_prep_sasl)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -599,7 +599,7 @@ PHP_FUNCTION(idn_prep_iscsi)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -629,7 +629,7 @@ PHP_FUNCTION(idn_punycode_encode)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -655,7 +655,7 @@ PHP_FUNCTION(idn_punycode_decode)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -686,7 +686,7 @@ PHP_FUNCTION(idn_to_ascii)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -716,7 +716,7 @@ PHP_FUNCTION(idn_to_utf8)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 1) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
+@@ -747,7 +747,7 @@ PHP_FUNCTION(idn_to_unicode)
+ {
+ 	char *output;
+ 	char *charset = IDNG(default_charset);
+-	pval **yyinput, **yycharset;
++	zval **yyinput, **yycharset;
+ 	int argv = ZEND_NUM_ARGS();
+ 
+     if ((argv < 0) || (argv > 2) || (zend_get_parameters_ex(argv, &yyinput, &yycharset) == FAILURE)) {
diff --git a/php-idn.spec b/php-idn.spec
index 546aaec..f499494 100644
--- a/php-idn.spec
+++ b/php-idn.spec
@@ -1,13 +1,15 @@
+%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}
 %global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
 
 Summary:	PHP API for GNU LibIDN
 Name:		php-idn
 Version:	1.2c
-Release:	4%{?dist}
+Release:	5%{?dist}
 License:	GPLv2+
 Group:		Development/Languages
 Source0:	http://php-idn.bayour.com/idn_%{version}.tar.gz
 Source1:	idn.ini
+Patch0:         idn-php54.patch
 URL:		http://php-idn.bayour.com/
 BuildRequires:	php-devel >= 4.3.0, libidn-devel >= 0.4.0, autoconf, automake, libtool
 %if 0%{?rhel}%{?fedora} > 4
@@ -22,6 +24,14 @@ Requires:	php-intl
 %endif
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+# Fix private-shared-object-provides
+# RPM 4.8
+%{?filter_provides_in: %filter_provides_in %{php_extdir}/.*\.so$}
+%{?filter_setup}
+# RPM 4.9
+%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{php_extdir}/.*\\.so$
+
+
 %description
 This is the PHP API for the GNU LibIDN software
 made by Simon Josefsson. It's intention is to
@@ -29,6 +39,8 @@ have international characters in the DNS system.
 
 %prep
 %setup -q -n idn-%{version}
+%patch0 -p1 -b .php54
+
 export PHP_RPATH=no
 phpize
 %configure
@@ -41,6 +53,13 @@ rm -rf $RPM_BUILD_ROOT
 make install-modules INSTALL_ROOT=$RPM_BUILD_ROOT
 install -D -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/php.d/idn.ini
 
+%check
+# Minimal load test of php extension
+php --no-php-ini \
+    --define extension_dir=${RPM_BUILD_ROOT}%{php_extdir} \
+    --define extension=idn.so \
+    --modules | grep idn
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -48,13 +67,18 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root,-)
 %doc CHANGES COPYRIGHT CREDITS README.documentation THANX_TO idn.php
 %if 0%{?rhel}%{?fedora} > 4
-%{_libdir}/php/modules/idn.so
+%{php_extdir}/idn.so
 %else
 %{_libdir}/php4/idn.so
 %endif
 %config(noreplace) %{_sysconfdir}/php.d/idn.ini
 
 %changelog
+* Wed Jan 18 2012 Remi Collet <remi at fedoraproject.org> - 1.2c-5
+- build against php 5.4.0
+- add filter to fix private-shared-object-provides
+- add %%check for php extension
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2c-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list