summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--0001-include-cstdint.patch25
-rw-r--r--liborcus-noexamples.patch8
-rw-r--r--liborcus.spec179
-rw-r--r--sources1
5 files changed, 214 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..ce7d3c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/liborcus-0.17.2.tar.xz
diff --git a/0001-include-cstdint.patch b/0001-include-cstdint.patch
new file mode 100644
index 0000000..3ecd8e3
--- /dev/null
+++ b/0001-include-cstdint.patch
@@ -0,0 +1,25 @@
+diff -ru liborcus-0.17.2.orig/include/orcus/base64.hpp liborcus-0.17.2/include/orcus/base64.hpp
+--- liborcus-0.17.2.orig/include/orcus/base64.hpp 2023-01-23 20:34:32.641993292 +0000
++++ liborcus-0.17.2/include/orcus/base64.hpp 2023-01-23 20:43:45.653157969 +0000
+@@ -9,8 +9,9 @@
+ #define __ORCUS_BASE64_HPP__
+
+ #include "env.hpp"
+-#include <vector>
++#include <cstdint>
+ #include <string>
++#include <vector>
+
+ namespace orcus {
+
+diff -ru liborcus-0.17.2.orig/include/orcus/types.hpp liborcus-0.17.2/include/orcus/types.hpp
+--- liborcus-0.17.2.orig/include/orcus/types.hpp 2023-01-23 20:34:32.641993292 +0000
++++ liborcus-0.17.2/include/orcus/types.hpp 2023-01-23 20:35:00.060249357 +0000
+@@ -8,6 +8,7 @@
+ #ifndef INCLUDED_ORCUS_TYPES_HPP
+ #define INCLUDED_ORCUS_TYPES_HPP
+
++#include <cstdint>
+ #include <cstdlib>
+ #include <vector>
+ #include <string>
diff --git a/liborcus-noexamples.patch b/liborcus-noexamples.patch
new file mode 100644
index 0000000..01f9cdf
--- /dev/null
+++ b/liborcus-noexamples.patch
@@ -0,0 +1,8 @@
+--- a/Makefile.am 2018-09-14 22:51:18.000000000 +0100
++++ b/Makefile.am 2020-03-17 15:37:37.493186784 +0000
+@@ -1,4 +1,4 @@
+-SUBDIRS = src include benchmark doc_example
++SUBDIRS = src include benchmark
+ ACLOCAL_AMFLAGS = -I m4
+
+ pcfiles = liborcus-@ORCUS_API_VERSION@.pc
diff --git a/liborcus.spec b/liborcus.spec
new file mode 100644
index 0000000..f9bb31c
--- /dev/null
+++ b/liborcus.spec
@@ -0,0 +1,179 @@
+%global apiversion 0.17
+
+# build conversion tools
+%bcond_with convtools
+# build python3 bindings
+%bcond_with python
+
+Name: liborcus
+Version: 0.17.2
+Release: 1
+Summary: Standalone file import filter library for spreadsheet documents
+
+License: MPL-2.0
+URL: https://gitlab.com/orcus/orcus
+Source0: https://kohei.us/files/orcus/src/%{name}-%{version}.tar.xz
+Patch0: liborcus-noexamples.patch
+Patch1: 0001-include-cstdint.patch
+
+BuildRequires: make boost-devel doxygen gcc-c++ automake pkgconfig(mdds-2.0) python3 pkgconfig(zlib)
+%if %{with convtools}
+BuildRequires: help2man
+BuildRequires: pkgconfig(libixion-0.17)
+%endif
+%if %{with python}
+BuildRequires: pkgconfig(python3)
+%endif
+
+%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}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+%package tools
+Summary: Tools for working with %{name}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description tools
+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_help
+
+%prep
+%autosetup -p1
+
+%if %{without convtools}
+%global condopts %{?condopts} --disable-spreadsheet-model
+%endif
+%if %{without python}
+%global condopts %{?condopts} --disable-python
+%endif
+
+%build
+autoreconf
+%configure --disable-debug --disable-silent-rules --disable-static \
+ --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_build
+
+%install
+%make_install
+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}%{_bindir}/orcus-csv
+help2man -N -S '%{name} %{version}' -n 'convert a Gnumeric file' -o orcus-gnumeric.1 %{buildroot}%{_bindir}/orcus-gnumeric
+help2man -N -S '%{name} %{version}' -n 'convert an ODF spreadsheet' -o orcus-ods.1 %{buildroot}%{_bindir}/orcus-ods
+help2man -N -S '%{name} %{version}' -n 'transform an XML file' -o orcus-xls-xml.1 %{buildroot}%{_bindir}/orcus-xls-xml
+help2man -N -S '%{name} %{version}' -n 'convert a OpenXML spreadsheet' -o orcus-xlsx.1 %{buildroot}%{_bindir}/orcus-xlsx
+help2man -N -S '%{name} %{version}' -n 'convert an XML file' -o orcus-xml.1 %{buildroot}%{_bindir}/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}
+
+%ldconfig_scriptlets
+
+%if %{with convtools}
+%ldconfig_scriptlets model
+%endif
+
+%files
+%doc AUTHORS CHANGELOG
+%license LICENSE
+%{_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-css-dump
+%{_bindir}/orcus-detect
+%{_bindir}/orcus-json
+%{_bindir}/orcus-mso-encryption
+%{_bindir}/orcus-zip-dump
+%{_bindir}/orcus-yaml
+
+%if %{with python}
+%files python3
+%{python3_sitearch}/_orcus.so
+%{python3_sitearch}/_orcus_json.so
+%{python3_sitelib}/orcus
+%endif
+
+%files help
+%license LICENSE
+%doc doc/_doxygen/html
+%if %{with convtools}
+%{_bindir}/orcus-csv
+%{_bindir}/orcus-gnumeric
+%{_bindir}/orcus-ods
+%{_bindir}/orcus-styles-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
+* Wed Sep 06 2023 Darssin <2020303249@mail.nwpu.edu.cn> - 0.17.2-1
+- Package init
diff --git a/sources b/sources
new file mode 100644
index 0000000..4b8099c
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+4df3646ca736fa0d04965e25fee4898e liborcus-0.17.2.tar.xz