From 3ccdabe155152936b3969ed97bacedc115d8b9f5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 19 2015 08:48:48 +0000 Subject: import liborcus-0.7.0-6.el7 --- diff --git a/.gitignore b/.gitignore index fbfa2f3..8926fac 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/liborcus-0.5.1.tar.bz2 +SOURCES/liborcus-0.7.0.tar.bz2 diff --git a/.liborcus.metadata b/.liborcus.metadata index dd1aea0..f1c5770 100644 --- a/.liborcus.metadata +++ b/.liborcus.metadata @@ -1 +1 @@ -9303d513e4b63a1d6e4bce7cfeb13635e568b466 SOURCES/liborcus-0.5.1.tar.bz2 +c33e1eb55144fef1070cb0bf35a2c12198fcaa71 SOURCES/liborcus-0.7.0.tar.bz2 diff --git a/SOURCES/0001-coverity-54426-missing-break-in-switch-statement.patch b/SOURCES/0001-coverity-54426-missing-break-in-switch-statement.patch new file mode 100644 index 0000000..0e59e23 --- /dev/null +++ b/SOURCES/0001-coverity-54426-missing-break-in-switch-statement.patch @@ -0,0 +1,24 @@ +From 1fc8d8e249ee49b61d159ff9a168de4ff216316c Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Tue, 9 Sep 2014 00:30:45 +0200 +Subject: [PATCH] coverity#54426 missing break in switch statement + +--- + src/liborcus/xlsx_sheet_context.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/liborcus/xlsx_sheet_context.cpp b/src/liborcus/xlsx_sheet_context.cpp +index 3f11e79..abdf088 100644 +--- a/src/liborcus/xlsx_sheet_context.cpp ++++ b/src/liborcus/xlsx_sheet_context.cpp +@@ -105,6 +105,7 @@ public: + m_height.value = to_double(attr.value); + m_height.unit = length_unit_point; + } ++ break; + case XML_hidden: + m_hidden = to_long(attr.value) != 0; + break; +-- +2.3.4 + diff --git a/SOURCES/0001-coverity-54448-Uninitialized-scalar-field.patch b/SOURCES/0001-coverity-54448-Uninitialized-scalar-field.patch new file mode 100644 index 0000000..536661a --- /dev/null +++ b/SOURCES/0001-coverity-54448-Uninitialized-scalar-field.patch @@ -0,0 +1,26 @@ +From 9ef8ed8bdbe2c9756115c7d3e98c7180bb63fd0f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Thu, 25 Sep 2014 10:38:35 +0100 +Subject: [PATCH] coverity#54448 Uninitialized scalar field + +--- + src/liborcus/xls_xml_context.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/liborcus/xls_xml_context.cpp b/src/liborcus/xls_xml_context.cpp +index 01f5dc9..abdd478 100644 +--- a/src/liborcus/xls_xml_context.cpp ++++ b/src/liborcus/xls_xml_context.cpp +@@ -141,7 +141,8 @@ xls_xml_context::xls_xml_context(session_context& session_cxt, const tokens& tok + xml_context_base(session_cxt, tokens), + mp_factory(factory), + mp_cur_sheet(NULL), +- m_cur_row(0), m_cur_col(0), m_cur_cell_type(ct_unknown) ++ m_cur_row(0), m_cur_col(0), m_cur_cell_type(ct_unknown), ++ m_cur_cell_value(std::numeric_limits::quiet_NaN()) + { + } + +-- +2.3.5 + diff --git a/SOURCES/0001-do-not-let-main-throw.patch b/SOURCES/0001-do-not-let-main-throw.patch new file mode 100644 index 0000000..c94dc06 --- /dev/null +++ b/SOURCES/0001-do-not-let-main-throw.patch @@ -0,0 +1,52 @@ +From da5d99c57ecdf54b40c248a109969021b70f5a38 Mon Sep 17 00:00:00 2001 +From: David Tardon +Date: Mon, 4 May 2015 17:49:37 +0200 +Subject: [PATCH] do not let main() throw + +--- + src/orcus_detect_main.cpp | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git a/src/orcus_detect_main.cpp b/src/orcus_detect_main.cpp +index 2a9f082..2f4110f 100644 +--- a/src/orcus_detect_main.cpp ++++ b/src/orcus_detect_main.cpp +@@ -16,22 +16,14 @@ + using namespace orcus; + using namespace std; + +-int main(int argc, char** argv) ++int main(int argc, char** argv) try + { + if (argc != 2) + return EXIT_FAILURE; + + const char* filepath = argv[1]; + string strm; +- try +- { +- load_file_content(filepath, strm); +- } +- catch (const general_error& e) +- { +- cerr << e.what() << endl; +- return EXIT_FAILURE; +- } ++ load_file_content(filepath, strm); + + if (strm.empty()) + { +@@ -67,4 +59,10 @@ int main(int argc, char** argv) + + return EXIT_SUCCESS; + } ++catch (const general_error& e) ++{ ++ cerr << e.what() << endl; ++ return EXIT_FAILURE; ++} ++ + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +-- +2.3.5 + diff --git a/SOURCES/0001-fix-invalid-memory-access-in-base64-functions.patch b/SOURCES/0001-fix-invalid-memory-access-in-base64-functions.patch new file mode 100644 index 0000000..29568ae --- /dev/null +++ b/SOURCES/0001-fix-invalid-memory-access-in-base64-functions.patch @@ -0,0 +1,44 @@ +From be2b335dc24da491d886dfa68d2c35b38f95d59a Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Thu, 14 Aug 2014 01:33:48 +0200 +Subject: [PATCH] fix invalid memory access in base64 functions + +Boost expects the input to be a multiple of 3 bytes for the encoding and +a multiple of 4 bytes for the decoding. Otherwise it accesses past the +end of the input array. Therefore we now pad with '\0' and replace the +generated 'A' with '='. +--- + src/parser/base64.cpp | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/src/parser/base64.cpp b/src/parser/base64.cpp +index 3d9d770..11ea38e 100644 +--- a/src/parser/base64.cpp ++++ b/src/parser/base64.cpp +@@ -49,9 +49,20 @@ void encode_to_base64(const std::vector& input, string& encoded) + if (input.empty()) + return; + +- string _encoded(to_base64(input.begin()), to_base64(input.end())); +- size_t pad_size = (3 - input.size() % 3) % 3; +- _encoded.append(pad_size, '='); ++ std::vector inp = input; ++ size_t pad_size = (3 - inp.size() % 3) % 3; ++ inp.resize(inp.size() + pad_size); ++ ++ string _encoded(to_base64(inp.begin()), to_base64(inp.end())); ++ ++ string::reverse_iterator it = _encoded.rbegin(); ++ for (size_t i = 0; i < pad_size; ++i, ++it) ++ { ++ // 'A' is a base64 encoding of '\0' ++ // replace them with padding charachters '=' ++ if (*it == 'A') ++ *it = '='; ++ } + + encoded.swap(_encoded); + } +-- +2.3.4 + diff --git a/SOURCES/add-aarch64.patch b/SOURCES/add-aarch64.patch deleted file mode 100644 index bbb1090..0000000 --- a/SOURCES/add-aarch64.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/configure b/configure -index 65e7d48..c85e89d 100755 ---- a/configure -+++ b/configure -@@ -15335,7 +15335,7 @@ $as_echo_n "checking for boostlib >= $boost_lib_version_req... " >&6; } - - libsubdirs="lib" - ax_arch=`uname -m` -- if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then -+ if test $ax_arch = x86_64 -o $ax_arch = aarch64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then - libsubdirs="lib64 lib lib64" - fi - diff --git a/SPECS/liborcus.spec b/SPECS/liborcus.spec index a334a59..fe09c92 100644 --- a/SPECS/liborcus.spec +++ b/SPECS/liborcus.spec @@ -1,28 +1,48 @@ -%global apiversion 0.6 +%global apiversion 0.8 + +# build conversion tools +%bcond_with convtools Name: liborcus -Version: 0.5.1 -Release: 7%{?dist} +Version: 0.7.0 +Release: 6%{?dist} Summary: Standalone file import filter library for spreadsheet documents -Group: System Environment/Libraries -License: MIT -URL: http://gitorious.org/orcus +License: MPLv2.0 +URL: https://gitlab.com/orcus/orcus Source: http://kohei.us/files/orcus/src/%{name}-%{version}.tar.bz2 BuildRequires: boost-devel -BuildRequires: zlib-devel - -Patch0: add-aarch64.patch +BuildRequires: chrpath +%if %{with convtools} +BuildRequires: help2man +BuildRequires: pkgconfig(libixion-0.8) +%endif +BuildRequires: pkgconfig(mdds) +BuildRequires: pkgconfig(zlib) + +Patch0: 0001-fix-invalid-memory-access-in-base64-functions.patch +Patch1: 0001-coverity-54426-missing-break-in-switch-statement.patch +Patch2: 0001-coverity-54448-Uninitialized-scalar-field.patch +Patch3: 0001-do-not-let-main-throw.patch %description %{name} is a standalone file import filter library for spreadsheet documents. Currently under development are ODS, XLSX and CSV import filters. +%if %{with convtools} +%package model +Summary: Spreadsheet model for %{name} conversion tools +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description model +The %{name}-model package contains a spreadsheet model used by the +conversion tools. +%endif + %package devel Summary: Development files for %{name} -Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel @@ -31,66 +51,113 @@ developing applications that use %{name}. %package tools Summary: Tools for working with %{name} -Group: Applications/Publishing Requires: %{name}%{?_isa} = %{version}-%{release} %description tools -Tools for working with %{name}. +Helper tools for %{name} and converters of various file formats to HTML +and text. %prep -%setup -q -%patch0 -p1 -# fix build of orcus-zip-dump -sed -i -e 's/orcus_zip_dump_LDADD = /& $(BOOST_SYSTEM_LIB) /' \ - src/Makefile.in -# TODO: upstream the changes -sed -i \ - -e 's/[a-z_]*_test_LDADD = /& $(BOOST_SYSTEM_LIB) /' \ - -e 's/parser_test_[a-z_]*_LDADD = /& $(BOOST_SYSTEM_LIB) /' \ - -e 's/liborcus_test_xml_structure_tree_LDADD = /& $(BOOST_SYSTEM_LIB) /' \ - src/liborcus/Makefile.in src/parser/Makefile.in +%autosetup -p1 + +%if %{without convtools} +%global condopts --disable-spreadsheet-model +%endif %build -# TODO spreadsheet-model requires ixion %configure --disable-debug --disable-silent-rules --disable-static \ - --disable-werror --with-pic \ - --disable-spreadsheet-model + --disable-werror --with-pic %{?condopts} sed -i \ -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ libtool make %{?_smp_mflags} +%if %{with convtools} +export LD_LIBRARY_PATH=`pwd`/src/liborcus/.libs:`pwd`/src/parser/.libs:`pwd`/src/spreadsheet/.libs${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +help2man -N -n 'convert a CSV file' -o orcus-csv.1 ./src/.libs/orcus-csv +help2man -N -n 'convert a Gnumeric file' -o orcus-gnumeric.1 ./src/.libs/orcus-gnumeric +help2man -N -n 'convert an ODF spreadsheet' -o orcus-ods.1 ./src/.libs/orcus-ods +help2man -N -n 'transform an XML file' -o orcus-xls-xml.1 ./src/.libs/orcus-xls-xml +help2man -N -n 'convert a OpenXML spreadsheet' -o orcus-xlsx.1 ./src/.libs/orcus-xlsx +help2man -N -n 'convert an XML file' -o orcus-xml.1 ./src/.libs/orcus-xml +%endif + %install make install DESTDIR=%{buildroot} rm -f %{buildroot}/%{_libdir}/*.la +# because boost.m4 is total crap and adds RPATH unconditionally +chrpath -d %{buildroot}/%{_libdir}/*.so + +%if %{with convtools} +install -m 0755 -d %{buildroot}/%{_mandir}/man1 +install -p -m 0644 orcus-*.1 %{buildroot}/%{_mandir}/man1 +%endif %check -export LD_LIBRARY_PATH=`pwd`/src/liborcus/.libs:`pwd`/src/parser/.libs${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} make check %{?_smp_mflags} %post -p /sbin/ldconfig %postun -p /sbin/ldconfig +%if %{with convtools} +%post model -p /sbin/ldconfig +%postun model -p /sbin/ldconfig +%endif + %files %doc AUTHORS COPYING README %{_libdir}/%{name}-%{apiversion}.so.* %{_libdir}/%{name}-mso-%{apiversion}.so.* %{_libdir}/%{name}-parser-%{apiversion}.so.* +%if %{with convtools} +%files model +%{_libdir}/%{name}-spreadsheet-model-%{apiversion}.so.* +%endif + %files devel %{_includedir}/%{name}-%{apiversion} %{_libdir}/%{name}-%{apiversion}.so %{_libdir}/%{name}-mso-%{apiversion}.so %{_libdir}/%{name}-parser-%{apiversion}.so %{_libdir}/pkgconfig/%{name}-%{apiversion}.pc +%if %{with convtools} +%{_libdir}/%{name}-spreadsheet-model-%{apiversion}.so +%{_libdir}/pkgconfig/%{name}-spreadsheet-model-%{apiversion}.pc +%endif %files tools +%{_bindir}/orcus-detect %{_bindir}/orcus-mso-encryption %{_bindir}/orcus-xml-dump %{_bindir}/orcus-zip-dump +%if %{with convtools} +%{_bindir}/orcus-csv +%{_bindir}/orcus-gnumeric +%{_bindir}/orcus-ods +%{_bindir}/orcus-xls-xml +%{_bindir}/orcus-xlsx +%{_bindir}/orcus-xml +%{_mandir}/man1/orcus-csv.1* +%{_mandir}/man1/orcus-gnumeric.1* +%{_mandir}/man1/orcus-ods.1* +%{_mandir}/man1/orcus-xls-xml.1* +%{_mandir}/man1/orcus-xlsx.1* +%{_mandir}/man1/orcus-xml.1* +%endif %changelog +* Mon May 04 2015 David Tardon - 0.7.0-6 +- Related: rhbz#1207772 add some upstream fixes + +* Fri Apr 17 2015 David Tardon - 0.7.0-5 +- Resolves: rhbz#1207772 rebase to 0.7.0 + +* Tue Aug 19 2014 David Tardon - 0.5.1-8 +- Resolves: rhbz#1125584 fix build on ppc64le + * Fri Jan 24 2014 Daniel Mach - 0.5.1-7 - Mass rebuild 2014-01-24