diff options
-rw-r--r-- | 158.patch | 85 | ||||
-rw-r--r-- | php-pecl-xlswriter.spec | 18 | ||||
-rw-r--r-- | skipif.inc | 21 |
3 files changed, 32 insertions, 92 deletions
diff --git a/158.patch b/158.patch deleted file mode 100644 index 024cba5..0000000 --- a/158.patch +++ /dev/null @@ -1,85 +0,0 @@ -From f44f4196ba504b5a096e4ded2baae5a7751bdd84 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Fri, 6 Sep 2019 17:41:25 +0200 -Subject: [PATCH] fix config to allow to enable the reader when using system - libxlswriter - ---- - config.m4 | 27 +++++++++++++++------------ - 1 file changed, 15 insertions(+), 12 deletions(-) - -diff --git a/config.m4 b/config.m4 -index 7bf2d53..f0a6851 100644 ---- a/config.m4 -+++ b/config.m4 -@@ -1,4 +1,4 @@ --PHP_ARG_WITH(xlsxwriter, xlswriter support, -+PHP_ARG_WITH(xlswriter, xlswriter support, - [ --with-xlswriter Include xlswriter support], yes) - - PHP_ARG_WITH(libxlsxwriter, system libxlsswriter, -@@ -23,11 +23,14 @@ if test "$PHP_XLSWRITER" != "no"; then - kernel/read.c \ - " - -- libxlsxwriter_sources=" -+ minizip_sources=" - library/libxlsxwriter/third_party/minizip/ioapi.c \ - library/libxlsxwriter/third_party/minizip/mztools.c \ - library/libxlsxwriter/third_party/minizip/unzip.c \ - library/libxlsxwriter/third_party/minizip/zip.c \ -+ " -+ -+ libxlsxwriter_sources=" - library/libxlsxwriter/third_party/tmpfileplus/tmpfileplus.c \ - library/libxlsxwriter/src/app.c \ - library/libxlsxwriter/src/chart.c \ -@@ -111,7 +114,7 @@ if test "$PHP_XLSWRITER" != "no"; then - AC_DEFINE(HAVE_LIBXLSXWRITER, 1, [ use system libxlsxwriter ]) - else - AC_MSG_RESULT([use the bundled library]) -- xls_writer_sources="$xls_writer_sources $libxlsxwriter_sources" -+ xls_writer_sources="$xls_writer_sources $libxlsxwriter_sources $minizip_sources" - PHP_ADD_INCLUDE([$srcdir/library/libxlsxwriter/include]) - - XLSXWRITER_VERSION=`$EGREP "define LXW_VERSION" $srcdir/library/include/libxlsxwriter/xlsxwriter.h | $SED -e 's/[[^0-9\.]]//g'` -@@ -132,18 +135,18 @@ if test "$PHP_XLSWRITER" != "no"; then - fi - - if test "$PHP_READER" = "yes"; then -- xls_writer_sources="$xls_writer_sources $xls_read_sources" -+ xls_writer_sources="$xls_writer_sources $xls_read_sources $minizip_sources" - - AC_DEFINE(ENABLE_READER, 1, [enable reader]) - - xls_writer_sources="$xls_writer_sources $libexpat" - PHP_ADD_INCLUDE([$srcdir/library/libexpat/expat/lib]) -- PHP_ADD_BUILD_DIR([$ext_builddir/library/libexpat/expat/lib]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libexpat/expat/lib]) - LIBOPT="$LIBOPT -DXML_POOR_ENTROPY" - - xls_writer_sources="$xls_writer_sources $libxlsxio" - PHP_ADD_INCLUDE([$srcdir/library/libxlsxio/include]) -- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxio/lib]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib]) - LIBOPT="$LIBOPT -DUSE_MINIZIP" - fi - -@@ -158,11 +161,11 @@ if test "$PHP_XLSWRITER" != "no"; then - PHP_ADD_INCLUDE([$srcdir]) - PHP_ADD_INCLUDE([$srcdir/include]) - -- PHP_ADD_BUILD_DIR([$ext_builddir/kernel]) -- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxwriter/src]) -- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxwriter/third_party/minizip]) -- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxwriter/third_party/tmpfileplus]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/kernel]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/src]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/third_party/minizip]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxwriter/third_party/tmpfileplus]) - -- PHP_ADD_BUILD_DIR([$ext_builddir/library/libexpat/expat/lib]) -- PHP_ADD_BUILD_DIR([$ext_builddir/library/libxlsxio/lib]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libexpat/expat/lib]) -+ PHP_ADD_BUILD_DIR([$abs_builddir/library/libxlsxio/lib]) - fi diff --git a/php-pecl-xlswriter.spec b/php-pecl-xlswriter.spec index 755db08..57744a9 100644 --- a/php-pecl-xlswriter.spec +++ b/php-pecl-xlswriter.spec @@ -29,12 +29,11 @@ Summary: An efficient and fast xlsx file export extension Name: %{?sub_prefix}php-pecl-%{pecl_name} Version: 1.2.8 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?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 - -Patch0: https://patch-diff.githubusercontent.com/raw/viest/php-ext-excel-export/pull/158.patch +Source1: https://raw.githubusercontent.com/viest/php-ext-excel-export/master/tests/include/skipif.inc BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7 @@ -108,7 +107,9 @@ sed -e 's/role="test"/role="src"/' \ cd NTS # we use the system library rm -r library/libxlsxwriter/src -%patch0 -p1 -b .pr158 + +mkdir tests/include +cp %{SOURCE1} tests/include # Sanity check, really often broken extver=$(sed -n '/#define PHP_XLSWRITER_VERSION/{s/.* "//;s/".*$//;p}' php_xlswriter.h) @@ -202,9 +203,6 @@ fi %check -%if 0%{?rhel} == 6 -rm ?TS/tests/open_xlsx* -%endif modules="-d extension=json.so" cd NTS @@ -258,6 +256,12 @@ cd .. %changelog +* Sat Sep 14 2019 Remi Collet <remi@remirepo.net> - 1.2.8-2 +- update to 1.2.8 (new tarball) +- drop patch merged upstream +- open https://github.com/viest/php-ext-excel-export/pull/163 + missing file + * Sat Sep 14 2019 Remi Collet <remi@remirepo.net> - 1.2.8-1 - update to 1.2.8 diff --git a/skipif.inc b/skipif.inc new file mode 100644 index 0000000..591e7f8 --- /dev/null +++ b/skipif.inc @@ -0,0 +1,21 @@ +<?php + +/** + * Skip Disable Reader + * + * @return void + * + * @author viest + */ +function skip_disable_reader() { + if (!method_exists('\Vtiful\Kernel\Excel', 'openFile')) { + print "skip"; + } +} + +(function(){ + if (!extension_loaded("xlswriter")) { + print "skip"; + } +})(); + |