3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: Python 2 API and tools to manipulate OpenDocument files
8 Summary(pl.UTF-8): API i narzędzia Pythona 2 do operacji na dokumentach OpenDocument
12 License: LGPL v2.1+ (module), Apache v2.0 and GPL v2+ (tools)
13 Group: Libraries/Python
14 #Source0Download: https://pypi.org/simple/odfpy/
15 Source0: https://files.pythonhosted.org/packages/source/o/odfpy/odfpy-%{version}.tar.gz
16 # Source0-md5: d1a186ae75b2ae038a8aab1396444342
17 URL: https://pypi.org/project/odfpy/
18 BuildRequires: rpm-pythonprov
19 BuildRequires: rpmbuild(macros) >= 1.714
21 BuildRequires: python-modules >= 1:2.7
22 BuildRequires: python-setuptools
24 BuildRequires: python-defusedxml
25 BuildRequires: python-pytest
29 BuildRequires: python3-modules >= 1:3.4
30 BuildRequires: python3-setuptools
32 BuildRequires: python3-defusedxml
33 BuildRequires: python3-pytest
36 Requires: python-modules >= 1:2.7
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 Odfpy is a library to read and write OpenDocument v. 1.2 files. The
42 main focus has been to prevent the programmer from creating invalid
43 documents. It has checks that raise an exception if the programmer
44 adds an invalid element, adds an attribute unknown to the grammar,
45 forgets to add a required attribute or adds text to an element that
48 %description -l pl.UTF-8
49 Odfpy to biblioteka do odczytu i zapisu plików OpenDocument w wersji
50 1.2. Główny nacisk został położony na tym, aby nie pozwolić
51 programiście na utworzenie błędnych dokumentów. Biblioteka rzuca
52 wyjątek, jeśli programista dodaje błędny element, dodaje element
53 nieznany gramatyce, zapomina dodać wymagany atrybut lub dodaje tekst
54 do elementu, który na to nie pozwala.
56 %package -n python3-odfpy
57 Summary: Python 3 API and tools to manipulate OpenDocument files
58 Summary(pl.UTF-8): API i narzędzia Pythona 3 do operacji na dokumentach OpenDocument
59 Group: Libraries/Python
60 Requires: python3-modules >= 1:3.4
62 %description -n python3-odfpy
63 Odfpy is a library to read and write OpenDocument v. 1.2 files. The
64 main focus has been to prevent the programmer from creating invalid
65 documents. It has checks that raise an exception if the programmer
66 adds an invalid element, adds an attribute unknown to the grammar,
67 forgets to add a required attribute or adds text to an element that
70 %description -n python3-odfpy -l pl.UTF-8
71 Odfpy to biblioteka do odczytu i zapisu plików OpenDocument w wersji
72 1.2. Główny nacisk został położony na tym, aby nie pozwolić
73 programiście na utworzenie błędnych dokumentów. Biblioteka rzuca
74 wyjątek, jeśli programista dodaje błędny element, dodaje element
75 nieznany gramatyce, zapomina dodać wymagany atrybut lub dodaje tekst
76 do elementu, który na to nie pozwala.
78 %package -n odfpy-tools
79 Summary: Tools to manipulate OpenDocument files
80 Summary(pl.UTF-8): Narzędzia do operacji na dokumentach OpenDocument
81 Group: Applications/Publishing
83 Requires: python3-odfpy = %{version}-%{release}
85 Requires: python-odfpy = %{version}-%{release}
88 %description -n odfpy-tools
89 Tools to manipulate OpenDocument files.
91 %description -n odfpy-tools -l pl.UTF-8
92 Narzędzia do operacji na dokumentach OpenDocument.
95 %setup -q -n odfpy-%{version}
102 # test_xmlgenerator_wo_ns apparently fails with python 2.7
103 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
104 %{__python} -m pytest tests -k 'not test_xmlgenerator_wo_ns'
112 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
113 %{__python3} -m pytest tests
118 rm -rf $RPM_BUILD_ROOT
125 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
126 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129 # ensure packaged tools are python3 based
130 %{__rm} -r $RPM_BUILD_ROOT{%{_bindir},%{_mandir}}
137 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-odfpy-%{version}
138 cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-odfpy-%{version}
142 rm -rf $RPM_BUILD_ROOT
146 %defattr(644,root,root,755)
147 %doc ChangeLog README.md
148 %{py_sitescriptdir}/odf
149 %{py_sitescriptdir}/odfpy-%{version}-py*.egg-info
150 %{_examplesdir}/python-odfpy-%{version}
154 %files -n python3-odfpy
155 %defattr(644,root,root,755)
156 %doc ChangeLog README.md
157 %{py3_sitescriptdir}/odf
158 %{py3_sitescriptdir}/odfpy-%{version}-py*.egg-info
159 %{_examplesdir}/python3-odfpy-%{version}
162 %files -n odfpy-tools
163 %defattr(644,root,root,755)
164 %attr(755,root,root) %{_bindir}/csv2ods
165 %attr(755,root,root) %{_bindir}/mailodf
166 %attr(755,root,root) %{_bindir}/odf2mht
167 %attr(755,root,root) %{_bindir}/odf2xhtml
168 %attr(755,root,root) %{_bindir}/odf2xml
169 %attr(755,root,root) %{_bindir}/odfimgimport
170 %attr(755,root,root) %{_bindir}/odflint
171 %attr(755,root,root) %{_bindir}/odfmeta
172 %attr(755,root,root) %{_bindir}/odfoutline
173 %attr(755,root,root) %{_bindir}/odfuserfield
174 %attr(755,root,root) %{_bindir}/xml2odf
175 %{_mandir}/man1/csv2ods.1*
176 %{_mandir}/man1/mailodf.1*
177 %{_mandir}/man1/odf2mht.1*
178 %{_mandir}/man1/odf2xhtml.1*
179 %{_mandir}/man1/odf2xml.1*
180 %{_mandir}/man1/odfimgimport.1*
181 %{_mandir}/man1/odflint.1*
182 %{_mandir}/man1/odfmeta.1*
183 %{_mandir}/man1/odfoutline.1*
184 %{_mandir}/man1/odfuserfield.1*
185 %{_mandir}/man1/xml2odf.1*