From 0b7ae96df1e7de43a3c158d7f34bbc15cd569047 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Apr 10 2018 05:27:51 +0000 Subject: import liborcus-0.12.1-2.el7 --- diff --git a/.gitignore b/.gitignore index 8926fac..f5ce42a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/liborcus-0.7.0.tar.bz2 +SOURCES/liborcus-0.12.1.tar.xz diff --git a/.liborcus.metadata b/.liborcus.metadata index f1c5770..2e80920 100644 --- a/.liborcus.metadata +++ b/.liborcus.metadata @@ -1 +1 @@ -c33e1eb55144fef1070cb0bf35a2c12198fcaa71 SOURCES/liborcus-0.7.0.tar.bz2 +c56cd0c61218a43cf1e97b028e469c407035bf08 SOURCES/liborcus-0.12.1.tar.xz diff --git a/SOURCES/0001-Wtautological-compare-compare-against-the-other-para.patch b/SOURCES/0001-Wtautological-compare-compare-against-the-other-para.patch new file mode 100644 index 0000000..8a95948 --- /dev/null +++ b/SOURCES/0001-Wtautological-compare-compare-against-the-other-para.patch @@ -0,0 +1,25 @@ +From 9fc5c84f0e5ba6266df3057c80af8279e03b7c04 Mon Sep 17 00:00:00 2001 +From: Markus Mohrhard +Date: Mon, 19 Sep 2016 21:04:02 +0200 +Subject: [PATCH] -Wtautological-compare, compare against the 'other' parameter + +--- + src/parser/json_parser_thread.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/parser/json_parser_thread.cpp b/src/parser/json_parser_thread.cpp +index 6f4dd2d3..5e3515e8 100644 +--- a/src/parser/json_parser_thread.cpp ++++ b/src/parser/json_parser_thread.cpp +@@ -77,7 +77,7 @@ bool parse_token::operator== (const parse_token& other) const + case parse_token_t::parse_error: + if (pstring(error_value.p, error_value.len) != pstring(other.error_value.p, other.error_value.len)) + return false; +- if (error_value.offset != error_value.offset) ++ if (error_value.offset != other.error_value.offset) + return false; + break; + default: +-- +2.14.1 + diff --git a/SOURCES/0001-coverity-54426-missing-break-in-switch-statement.patch b/SOURCES/0001-coverity-54426-missing-break-in-switch-statement.patch deleted file mode 100644 index 0e59e23..0000000 --- a/SOURCES/0001-coverity-54426-missing-break-in-switch-statement.patch +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index 536661a..0000000 --- a/SOURCES/0001-coverity-54448-Uninitialized-scalar-field.patch +++ /dev/null @@ -1,26 +0,0 @@ -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 deleted file mode 100644 index c94dc06..0000000 --- a/SOURCES/0001-do-not-let-main-throw.patch +++ /dev/null @@ -1,52 +0,0 @@ -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 deleted file mode 100644 index 29568ae..0000000 --- a/SOURCES/0001-fix-invalid-memory-access-in-base64-functions.patch +++ /dev/null @@ -1,44 +0,0 @@ -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/SPECS/liborcus.spec b/SPECS/liborcus.spec index fe09c92..be33c1a 100644 --- a/SPECS/liborcus.spec +++ b/SPECS/liborcus.spec @@ -1,30 +1,32 @@ -%global apiversion 0.8 +%global apiversion 0.12 # build conversion tools %bcond_with convtools +# build python3 bindings +%bcond_with python Name: liborcus -Version: 0.7.0 -Release: 6%{?dist} +Version: 0.12.1 +Release: 2%{?dist} Summary: Standalone file import filter library for spreadsheet documents License: MPLv2.0 URL: https://gitlab.com/orcus/orcus -Source: http://kohei.us/files/orcus/src/%{name}-%{version}.tar.bz2 +Source0: http://kohei.us/files/orcus/src/%{name}-%{version}.tar.xz BuildRequires: boost-devel -BuildRequires: chrpath +BuildRequires: doxygen %if %{with convtools} BuildRequires: help2man -BuildRequires: pkgconfig(libixion-0.8) +BuildRequires: pkgconfig(libixion-0.12) +%endif +BuildRequires: pkgconfig(mdds-1.2) +%if %{with python} +BuildRequires: pkgconfig(python3) %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 +Patch0: 0001-Wtautological-compare-compare-against-the-other-para.patch %description %{name} is a standalone file import filter library for spreadsheet @@ -57,11 +59,30 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Helper tools for %{name} and converters of various file formats to HTML and text. +%if %{with python} +%package python3 +Summary: Python 3 bindings for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description python3 +Python 3 bindings for %{name}. +%endif + +%package doc +Summary: API documentation for %{name} +BuildArch: noarch + +%description doc +API documentation for %{name}. + %prep %autosetup -p1 %if %{without convtools} -%global condopts --disable-spreadsheet-model +%global condopts %{?condopts} --disable-spreadsheet-model +%endif +%if %{without python} +%global condopts %{?condopts} --disable-python %endif %build @@ -73,27 +94,26 @@ sed -i \ 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 +rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{python3_sitearch}/*.la %if %{with convtools} +# create and install man pages +export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +help2man -N -S '%{name} %{version}' -n 'convert a CSV file' -o orcus-csv.1 %{buildroot}/usr/bin/orcus-csv +help2man -N -S '%{name} %{version}' -n 'convert a Gnumeric file' -o orcus-gnumeric.1 %{buildroot}/usr/bin/orcus-gnumeric +help2man -N -S '%{name} %{version}' -n 'convert an ODF spreadsheet' -o orcus-ods.1 %{buildroot}/usr/bin/orcus-ods +help2man -N -S '%{name} %{version}' -n 'transform an XML file' -o orcus-xls-xml.1 %{buildroot}/usr/bin/orcus-xls-xml +help2man -N -S '%{name} %{version}' -n 'convert a OpenXML spreadsheet' -o orcus-xlsx.1 %{buildroot}/usr/bin/orcus-xlsx +help2man -N -S '%{name} %{version}' -n 'convert an XML file' -o orcus-xml.1 %{buildroot}/usr/bin/orcus-xml install -m 0755 -d %{buildroot}/%{_mandir}/man1 install -p -m 0644 orcus-*.1 %{buildroot}/%{_mandir}/man1 %endif +# build documentation +make doc-doxygen + %check export LD_LIBRARY_PATH=%{buildroot}%{_libdir}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} make check %{?_smp_mflags} @@ -107,7 +127,8 @@ make check %{?_smp_mflags} %endif %files -%doc AUTHORS COPYING README +%doc AUTHORS CHANGELOG +%license LICENSE %{_libdir}/%{name}-%{apiversion}.so.* %{_libdir}/%{name}-mso-%{apiversion}.so.* %{_libdir}/%{name}-parser-%{apiversion}.so.* @@ -129,10 +150,13 @@ make check %{?_smp_mflags} %endif %files tools +%{_bindir}/orcus-css-dump %{_bindir}/orcus-detect +%{_bindir}/orcus-json %{_bindir}/orcus-mso-encryption %{_bindir}/orcus-xml-dump %{_bindir}/orcus-zip-dump +%{_bindir}/orcus-yaml %if %{with convtools} %{_bindir}/orcus-csv %{_bindir}/orcus-gnumeric @@ -148,7 +172,24 @@ make check %{?_smp_mflags} %{_mandir}/man1/orcus-xml.1* %endif +%if %{with python} +%files python3 +%{python3_sitearch}/_orcus.so +%{python3_sitearch}/_orcus_json.so +%{python3_sitelib}/orcus +%endif + +%files doc +%license LICENSE +%doc doc/_doxygen/html + %changelog +* Fri Oct 20 2017 David Tardon - 0.12.1-2 +- Related: rhbz#1477101 fix problem found by coverity + +* Mon Sep 18 2017 David Tardon - 0.12.1-1 +- Resolves: rhbz#1477101 rebase to 0.12.1 + * Mon May 04 2015 David Tardon - 0.7.0-6 - Related: rhbz#1207772 add some upstream fixes