2010-11-26 13:57:18 +00:00
|
|
|
#
|
|
|
|
# spec file for package python-odfpy
|
|
|
|
#
|
2020-03-27 15:15:23 +00:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2010-11-26 13:57:18 +00:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
2017-08-24 05:58:28 +00:00
|
|
|
|
2019-02-22 10:43:54 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2011-01-25 09:20:22 +00:00
|
|
|
#
|
2010-11-26 13:57:18 +00:00
|
|
|
|
2011-01-25 09:20:22 +00:00
|
|
|
|
2018-06-15 21:22:17 +00:00
|
|
|
#
|
|
|
|
%define modname odfpy
|
2020-05-21 08:59:05 +00:00
|
|
|
%define binaries csv2ods mailodf odf2mht odf2xhtml odf2xml odfimgimport odflint odfmeta odfoutline odfuserfield xml2odf
|
2017-08-24 05:58:28 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2018-06-15 21:22:17 +00:00
|
|
|
Name: python-%{modname}
|
2020-03-27 15:15:23 +00:00
|
|
|
Version: 1.4.1
|
2011-03-03 09:05:09 +00:00
|
|
|
Release: 0
|
|
|
|
Summary: Python API and tools to manipulate OpenDocument files
|
2018-06-15 21:22:17 +00:00
|
|
|
License: GPL-2.0-or-later AND Apache-2.0
|
2011-03-03 09:05:09 +00:00
|
|
|
Group: Development/Languages/Python
|
2019-02-22 10:43:54 +00:00
|
|
|
URL: https://github.com/eea/odfpy
|
2018-08-29 10:52:51 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/o/odfpy/%{modname}-%{version}.tar.gz
|
2019-02-22 10:43:54 +00:00
|
|
|
BuildRequires: %{python_module defusedxml}
|
2018-06-15 21:22:17 +00:00
|
|
|
BuildRequires: %{python_module pytest}
|
2017-08-24 05:58:28 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-02-22 10:43:54 +00:00
|
|
|
Requires: python-defusedxml
|
2020-05-21 08:59:05 +00:00
|
|
|
Requires(post): update-alternatives
|
|
|
|
Requires(postun): update-alternatives
|
|
|
|
BuildArch: noarch
|
2017-08-24 05:58:28 +00:00
|
|
|
%python_subpackages
|
2010-11-26 13:57:18 +00:00
|
|
|
|
|
|
|
%description
|
2011-03-03 09:05:09 +00:00
|
|
|
Odfpy is a library to read and write OpenDocument v. 1.1 files.
|
|
|
|
The main focus has been to prevent the programmer from creating invalid
|
|
|
|
documents. It has checks that raise an exception if the programmer adds
|
|
|
|
an invalid element, adds an attribute unknown to the grammar, forgets to
|
|
|
|
add a required attribute or adds text to an element that doesn't allow it.
|
|
|
|
|
|
|
|
These checks and the API itself were generated from the RelaxNG
|
|
|
|
schema, and then hand-edited. Therefore the API is complete and can
|
|
|
|
handle all ODF constructions.
|
|
|
|
|
|
|
|
In addition to the API, there are a few scripts:
|
|
|
|
|
|
|
|
- csv2odf - Create OpenDocument spreadsheet from comma separated values
|
|
|
|
- mailodf - Email ODF file as HTML archive
|
|
|
|
- odf2xhtml - Convert ODF to (X)HTML
|
|
|
|
- odf2mht - Convert ODF to HTML archive
|
|
|
|
- odf2xml - Create OpenDocument XML file from OD? package
|
|
|
|
- odfimgimport - Import external images
|
|
|
|
- odflint - Check ODF file for problems
|
|
|
|
- odfmeta - List or change the metadata of an ODF file
|
|
|
|
- odfoutline - Show outline of OpenDocument
|
|
|
|
- odfuserfield - List or change the user-field declarations in an ODF file
|
|
|
|
- xml2odf - Create OD? package from OpenDocument in XML form
|
|
|
|
|
2019-02-22 10:43:54 +00:00
|
|
|
Visit https://github.com/eea/odfpy for documentation and examples.
|
2010-11-26 13:57:18 +00:00
|
|
|
|
|
|
|
%prep
|
2018-06-15 21:22:17 +00:00
|
|
|
%setup -q -n %{modname}-%{version}
|
2011-09-21 13:49:22 +00:00
|
|
|
sed -i "1d" odf/{userfield,odf2xhtml,manifest,element,elementtypes,load,odfmanifest,thumbnail}.py # Fix non-executable scripts
|
2010-11-26 13:57:18 +00:00
|
|
|
|
|
|
|
%build
|
2017-08-24 05:58:28 +00:00
|
|
|
%python_build
|
2010-11-26 13:57:18 +00:00
|
|
|
|
|
|
|
%install
|
2017-08-24 05:58:28 +00:00
|
|
|
%python_install
|
2020-05-21 08:59:05 +00:00
|
|
|
for b in %{binaries}; do
|
|
|
|
%python_clone -a %{buildroot}%{_mandir}/man1/$b.1
|
|
|
|
%python_clone -a %{buildroot}%{_bindir}/$b
|
|
|
|
done
|
2017-08-24 05:58:28 +00:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2010-11-26 13:57:18 +00:00
|
|
|
|
2018-06-15 21:22:17 +00:00
|
|
|
%check
|
2020-05-21 08:59:05 +00:00
|
|
|
%pytest
|
|
|
|
|
|
|
|
%post
|
|
|
|
for b in %{binaries}; do
|
|
|
|
%python_install_alternative $b $b.1
|
|
|
|
done
|
|
|
|
|
|
|
|
%postun
|
|
|
|
for b in %{binaries}; do
|
|
|
|
%python_uninstall_alternative $b
|
|
|
|
done
|
2018-06-15 21:22:17 +00:00
|
|
|
|
2017-08-24 05:58:28 +00:00
|
|
|
%files %{python_files}
|
2018-08-29 10:52:51 +00:00
|
|
|
%license APACHE-LICENSE-2.0.txt GPL-LICENSE-2.txt
|
2020-05-21 08:59:05 +00:00
|
|
|
%python_alternative %{_bindir}/csv2ods
|
|
|
|
%python_alternative %{_bindir}/mailodf
|
|
|
|
%python_alternative %{_bindir}/odf2mht
|
|
|
|
%python_alternative %{_bindir}/odf2xhtml
|
|
|
|
%python_alternative %{_bindir}/odf2xml
|
|
|
|
%python_alternative %{_bindir}/odfimgimport
|
|
|
|
%python_alternative %{_bindir}/odflint
|
|
|
|
%python_alternative %{_bindir}/odfmeta
|
|
|
|
%python_alternative %{_bindir}/odfoutline
|
|
|
|
%python_alternative %{_bindir}/odfuserfield
|
|
|
|
%python_alternative %{_bindir}/xml2odf
|
|
|
|
%python_alternative %{_mandir}/man1/csv2ods.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/mailodf.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odf2mht.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odf2xhtml.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odf2xml.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odfimgimport.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odflint.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odfmeta.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odfoutline.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/odfuserfield.1%{ext_man}
|
|
|
|
%python_alternative %{_mandir}/man1/xml2odf.1%{ext_man}
|
2018-06-15 21:22:17 +00:00
|
|
|
%{python_sitelib}/odf
|
|
|
|
%{python_sitelib}/%{modname}*
|
2010-11-26 13:57:18 +00:00
|
|
|
|
|
|
|
%changelog
|