From 0b17e8bd93a7f81ebc3e21fdb27f1b7fb5fdc2b6 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 19 Dec 2013 14:22:10 +0100 Subject: php-pecl-pdflib: 3.0.2 (stable) --- pdflib-php54.patch | 36 ------------------ pdflib.patch | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ php-pecl-pdflib.spec | 47 ++++++++++++++++-------- xml2changelog | 43 ---------------------- 4 files changed, 134 insertions(+), 94 deletions(-) delete mode 100644 pdflib-php54.patch create mode 100644 pdflib.patch delete mode 100644 xml2changelog diff --git a/pdflib-php54.patch b/pdflib-php54.patch deleted file mode 100644 index 96f8c8e..0000000 --- a/pdflib-php54.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -up pdflib-2.1.8/pdf7.c.php54 pdflib-2.1.8/pdf7.c ---- pdflib-2.1.8/pdf7.c.php54 2011-11-27 08:55:33.068642986 +0100 -+++ pdflib-2.1.8/pdf7.c 2011-11-27 08:56:40.703860070 +0100 -@@ -332,10 +332,14 @@ pdflib_object_new_ex(zend_class_entry *c - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); -+#if PHP_VERSION_ID < 50399 - zend_hash_copy(intern->std.properties, - &class_type->default_properties, - (copy_ctor_func_t) zval_add_ref, - (void *) &tmp, sizeof(zval *)); -+#else -+ object_properties_init( (zend_object*)intern, class_type ); -+#endif - - retval.handle = zend_objects_store_put(intern, NULL, - (zend_objects_free_object_storage_t)pdflib_object_dtor, -diff -up pdflib-2.1.8/pdf.c.php54 pdflib-2.1.8/pdf.c ---- pdflib-2.1.8/pdf.c.php54 2011-11-27 08:53:51.378310945 +0100 -+++ pdflib-2.1.8/pdf.c 2011-11-27 08:56:31.184829597 +0100 -@@ -766,10 +766,14 @@ pdflib_object_new_ex(zend_class_entry *c - - ALLOC_HASHTABLE(intern->std.properties); - zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0); -+#if PHP_VERSION_ID < 50399 - zend_hash_copy(intern->std.properties, - &class_type->default_properties, - (copy_ctor_func_t) zval_add_ref, - (void *) &tmp, sizeof(zval *)); -+#else -+ object_properties_init( (zend_object*)intern, class_type ); -+#endif - - retval.handle = zend_objects_store_put(intern, NULL, - (zend_objects_free_object_storage_t)pdflib_object_dtor, diff --git a/pdflib.patch b/pdflib.patch new file mode 100644 index 0000000..0aebc1f --- /dev/null +++ b/pdflib.patch @@ -0,0 +1,102 @@ +diff -up pdflib-3.0.2/pdf.c.orig pdflib-3.0.2/pdf.c +--- pdflib-3.0.2/pdf.c.orig 2013-12-19 13:51:07.000000000 +0100 ++++ pdflib-3.0.2/pdf.c 2013-12-19 13:52:23.000000000 +0100 +@@ -342,7 +342,6 @@ pdflib_object_new_ex(zend_class_entry *c + { + zend_object_value retval; + pdflib_object *intern; +- zval *tmp; + + intern = emalloc(sizeof(pdflib_object)); + memset(intern, 0, sizeof(pdflib_object)); +@@ -351,10 +350,13 @@ pdflib_object_new_ex(zend_class_entry *c + zend_object_std_init(&intern->std, class_type TSRMLS_CC); + + #if PHP_VERSION_ID < 50399 ++ { ++ zval *tmp; + zend_hash_copy(intern->std.properties, + &class_type->default_properties, + (copy_ctor_func_t) zval_add_ref, + (void *) &tmp, sizeof(zval *)); ++ } + #else /* PHP_VERSION_ID < 50399 */ + object_properties_init(&(intern->std), class_type); + #endif /* PHP_VERSION_ID < 50399 */ +@@ -670,7 +672,6 @@ PHP_FUNCTION(pdf_new) + { + PDF *pdf; + zval *object = getThis(); +- DEFINE_ERROR_HANDLER + pdflib_object *intern; + + +diff -up pdflib-3.0.2/php_pdf.h.orig pdflib-3.0.2/php_pdf.h +diff -up pdflib-3.0.2/php_pdflib.h.orig pdflib-3.0.2/php_pdflib.h +diff -up pdflib-3.0.2/php_wrapped.c.orig pdflib-3.0.2/php_wrapped.c +--- pdflib-3.0.2/php_wrapped.c.orig 2013-12-19 13:47:38.000000000 +0100 ++++ pdflib-3.0.2/php_wrapped.c 2013-12-19 13:50:21.000000000 +0100 +@@ -1455,7 +1455,7 @@ PHP_FUNCTION(pdf_begin_pattern) + } + RESTORE_ERROR_HANDLING(); + +- #if PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 ++ #if PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 && PDFLIB_MAJORVERSION >= 8 + php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "Deprecated, use PDF_begin_pattern_ext()."); + #endif /* PHP_MAJOR_VERSION >= 5 && PHP_MINOR_VERSION >= 3 */ + +@@ -1469,6 +1469,7 @@ PHP_FUNCTION(pdf_begin_pattern) + /* }}} */ + + ++#if PDFLIB_MAJORVERSION >= 8 + /* {{{ proto int PDF_begin_pattern_ext( + resource p, double width, double height, string optlist) + * Start a pattern definition with options. */ +@@ -1515,6 +1516,7 @@ PHP_FUNCTION(pdf_begin_pattern_ext) + RETURN_LONG(_result); + } + /* }}} */ ++#endif + + + /* {{{ proto int PDF_begin_template( +@@ -9095,11 +9097,11 @@ PHP_FUNCTION(pdf_utf8_to_utf16) + PHP_FE(pdf_begin_page, NULL) + PHP_FE(pdf_begin_page_ext, NULL) + PHP_FE(pdf_begin_pattern, NULL) +- PHP_FE(pdf_begin_pattern_ext, NULL) + PHP_FE(pdf_begin_template, NULL) + PHP_FE(pdf_begin_template_ext, NULL) + PHP_FE(pdf_circle, NULL) + #if PDFLIB_MAJORVERSION >= 8 ++ PHP_FE(pdf_begin_pattern_ext, NULL) + PHP_FE(pdf_circular_arc, NULL) + #endif /* PDFLIB_MAJORVERSION >= 8 */ + PHP_FE(pdf_clip, NULL) +@@ -9353,11 +9355,11 @@ PHP_FUNCTION(pdf_utf8_to_utf16) + PDF_ME_MAPPING(begin_mc, pdf_begin_mc, NULL) + PDF_ME_MAPPING(begin_page_ext, pdf_begin_page_ext, NULL) + PDF_ME_MAPPING(begin_pattern, pdf_begin_pattern, NULL) +- PDF_ME_MAPPING(begin_pattern_ext, pdf_begin_pattern_ext, NULL) + PDF_ME_MAPPING(begin_template, pdf_begin_template, NULL) + PDF_ME_MAPPING(begin_template_ext, pdf_begin_template_ext, NULL) + PDF_ME_MAPPING(circle, pdf_circle, NULL) + #if PDFLIB_MAJORVERSION >= 8 ++ PDF_ME_MAPPING(begin_pattern_ext, pdf_begin_pattern_ext, NULL) + PDF_ME_MAPPING(circular_arc, pdf_circular_arc, NULL) + #endif /* PDFLIB_MAJORVERSION >= 8 */ + PDF_ME_MAPPING(clip, pdf_clip, NULL) +@@ -9602,11 +9604,11 @@ PHP_FUNCTION(pdf_begin_mc); + PHP_FUNCTION(pdf_begin_page); + PHP_FUNCTION(pdf_begin_page_ext); + PHP_FUNCTION(pdf_begin_pattern); +-PHP_FUNCTION(pdf_begin_pattern_ext); + PHP_FUNCTION(pdf_begin_template); + PHP_FUNCTION(pdf_begin_template_ext); + PHP_FUNCTION(pdf_circle); + #if PDFLIB_MAJORVERSION >= 8 ++PHP_FUNCTION(pdf_begin_pattern_ext); + PHP_FUNCTION(pdf_circular_arc); + #endif /* PDFLIB_MAJORVERSION >= 8 */ + PHP_FUNCTION(pdf_clip); diff --git a/php-pecl-pdflib.spec b/php-pecl-pdflib.spec index 108bb32..44cb9ef 100644 --- a/php-pecl-pdflib.spec +++ b/php-pecl-pdflib.spec @@ -6,24 +6,29 @@ # # Please, preserve the changelog entries # -%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} -%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}} +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} +%{!?__pecl: %global __pecl %{_bindir}/pecl} +%{!?__php: %global __php %{_bindir}/php} +%global with_zts 0%{?__ztsphp:1} %global pecl_name pdflib %global extname pdf Summary: Package for generating PDF files Summary(fr): Extension pour générer des fichiers PDF Name: php-pecl-pdflib -Version: 3.0.1 -Release: 1%{?dist}.1 +Version: 3.0.2 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} # https://bugs.php.net/60396 ask license file License: PHP Group: Development/Languages URL: http://pecl.php.net/package/pdflib -Source: http://pecl.php.net/get/pdflib-%{version}.tgz -Source2: xml2changelog +Source0: http://pecl.php.net/get/pdflib-%{version}.tgz + +# fix build with pdflib-lite 7.0.x +# http://svn.php.net/viewvc?view=revision&revision=332472 +Patch0: %{pecl_name}.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: php-devel @@ -40,9 +45,11 @@ Provides: php-%{pecl_name}%{?_isa} = %{version}%{?prever} Provides: php-pecl(%{pecl_name}) = %{version}%{?prever} Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}%{?prever} +%if 0%{?fedora} < 20 # Filter private shared %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} %{?filter_setup} +%endif # Other third party repo stuff Obsoletes: php53-pecl-%{pecl_name} @@ -71,10 +78,8 @@ http://www.pdflib.com/developer-center/technical-documentation/php-howto %prep %setup -c -q -%{_bindir}/php %{SOURCE2} package.xml >CHANGELOG -sed -e /PHP_PDFLIB_VERSION/s/3.0.0/%{version}/ \ - -i %{pecl_name}-%{version}/php_pdflib.h +%patch0 -p0 -b .fix # Check version extver=$(sed -n '/#define PHP_PDFLIB_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}/php_pdflib.h) @@ -83,7 +88,9 @@ if test "x${extver}" != "x%{version}"; then exit 1 fi +%if %{with_zts} cp -pr %{pecl_name}-%{version} %{pecl_name}-zts +%endif # Create the config file cat > %{extname}.ini << 'EOF' @@ -98,7 +105,7 @@ cd %{pecl_name}-%{version} %configure --with-php-config=%{_bindir}/php-config make %{?_smp_mflags} -%if 0%{?__ztsphp:1} +%if %{with_zts} cd ../%{pecl_name}-zts %{_bindir}/zts-phpize %configure --with-php-config=%{_bindir}/zts-php-config @@ -117,19 +124,25 @@ install -D -m 644 %{extname}.ini %{buildroot}%{php_inidir}/%{extname}.ini # Install XML package description install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml -%if 0%{?__ztsphp:1} +%if %{with_zts} make -C %{pecl_name}-zts install-modules INSTALL_ROOT=%{buildroot} install -D -m 644 %{extname}.ini %{buildroot}%{php_ztsinidir}/%{extname}.ini %endif +# Test & Documentation +cd %{pecl_name}-%{version} +for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done + %check -%{_bindir}/php -n \ +%{__php} -n \ -d extension_dir=%{pecl_name}-%{version}/modules \ -d extension=%{extname}.so \ -m | grep -i %{extname} -%if 0%{?__ztsphp:1} +%if %{with_zts} %{__ztsphp} -n \ -d extension_dir=%{pecl_name}-zts/modules \ -d extension=%{extname}.so \ @@ -153,18 +166,22 @@ rm -rf %{buildroot} %files %defattr(-, root, root, -) -%doc CHANGELOG %{pecl_name}-%{version}/CREDITS +%doc %{pecl_docdir}/%{pecl_name} %config(noreplace) %{php_inidir}/%{extname}.ini %{php_extdir}/%{extname}.so %{pecl_xmldir}/%{name}.xml -%if 0%{?__ztsphp:1} +%if %{with_zts} %config(noreplace) %{php_ztsinidir}/%{extname}.ini %{php_ztsextdir}/%{extname}.so %endif %changelog +* Thu Dec 19 2013 Remi Collet - 3.0.2-1 +- Update to 3.0.2 (stable) +- move doc to pecl_docdir + * Thu Jul 25 2013 Remi Collet - 3.0.1-1 - Update to 3.0.1 diff --git a/xml2changelog b/xml2changelog deleted file mode 100644 index 3a31be6..0000000 --- a/xml2changelog +++ /dev/null @@ -1,43 +0,0 @@ -= "2"){ // Package.xml V 2.0 - $new = ""; - if (strlen(trim($xml->notes))>1) { // Ignore too short descr. - printf("*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n", - $xml->version->release, $xml->stability->release, - $xml->version->api, $xml->stability->api, - $xml->date, $xml->notes); - $new=$xml->version->release; - } - - if (isset($xml->changelog->release) && count($xml->changelog->release)) { - $tab = array(); - foreach($xml->changelog->release as $rel) { - $old=$rel->version->release; - if ("$old" != "$new") { - $tab[''.$rel->date] = $rel; - } - } - krsort($tab); - foreach($tab as $rel) { - printf("*** Version %s (%s) - API %s (%s) - %s\n\n%s\n\n", - $rel->version->release, $rel->stability->release, - $rel->version->api, $rel->stability->api, - $rel->date, $rel->notes); - } - } -} else { // Package.xml V 1.0 - printf("* Version %s (%s) - %s\n\n%s\n\n", - $xml->release->version, $xml->release->state, $xml->release->date, $xml->release->notes); - - foreach($xml->changelog->release as $rel) - printf("* Version %s (%s) - %s\n\n%s\n\n", - $rel->version, $rel->state, $rel->date, $rel->notes); -} -?> -- cgit