]> git.pld-linux.org Git - packages/python-odfpy.git/blame - python-odfpy.spec
rebuild with python 3.10
[packages/python-odfpy.git] / python-odfpy.spec
CommitLineData
85aef10d
JB
1#
2# Conditional build:
3%bcond_without tests # unit tests
4%bcond_without python2 # CPython 2.x module
5%bcond_without python3 # CPython 3.x module
6
7Summary: Python 2 API and tools to manipulate OpenDocument files
8Summary(pl.UTF-8): API i narzędzia Pythona 2 do operacji na dokumentach OpenDocument
9Name: python-odfpy
10Version: 1.4.1
5557b5b8 11Release: 4
85aef10d
JB
12License: LGPL v2.1+ (module), Apache v2.0 and GPL v2+ (tools)
13Group: Libraries/Python
14#Source0Download: https://pypi.org/simple/odfpy/
15Source0: https://files.pythonhosted.org/packages/source/o/odfpy/odfpy-%{version}.tar.gz
16# Source0-md5: d1a186ae75b2ae038a8aab1396444342
17URL: https://pypi.org/project/odfpy/
18BuildRequires: rpm-pythonprov
19BuildRequires: rpmbuild(macros) >= 1.714
20%if %{with python2}
21BuildRequires: python-modules >= 1:2.7
22BuildRequires: python-setuptools
23%if %{with tests}
24BuildRequires: python-defusedxml
25BuildRequires: python-pytest
26%endif
27%endif
28%if %{with python3}
29BuildRequires: python3-modules >= 1:3.4
30BuildRequires: python3-setuptools
31%if %{with tests}
32BuildRequires: python3-defusedxml
33BuildRequires: python3-pytest
34%endif
35%endif
36Requires: python-modules >= 1:2.7
37BuildArch: noarch
38BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40%description
41Odfpy is a library to read and write OpenDocument v. 1.2 files. The
42main focus has been to prevent the programmer from creating invalid
43documents. It has checks that raise an exception if the programmer
44adds an invalid element, adds an attribute unknown to the grammar,
45forgets to add a required attribute or adds text to an element that
46doesn't allow it.
47
48%description -l pl.UTF-8
49Odfpy to biblioteka do odczytu i zapisu plików OpenDocument w wersji
501.2. Główny nacisk został położony na tym, aby nie pozwolić
51programiście na utworzenie błędnych dokumentów. Biblioteka rzuca
52wyjątek, jeśli programista dodaje błędny element, dodaje element
53nieznany gramatyce, zapomina dodać wymagany atrybut lub dodaje tekst
54do elementu, który na to nie pozwala.
55
56%package -n python3-odfpy
57Summary: Python 3 API and tools to manipulate OpenDocument files
58Summary(pl.UTF-8): API i narzędzia Pythona 3 do operacji na dokumentach OpenDocument
59Group: Libraries/Python
60Requires: python3-modules >= 1:3.4
61
62%description -n python3-odfpy
63Odfpy is a library to read and write OpenDocument v. 1.2 files. The
64main focus has been to prevent the programmer from creating invalid
65documents. It has checks that raise an exception if the programmer
66adds an invalid element, adds an attribute unknown to the grammar,
67forgets to add a required attribute or adds text to an element that
68doesn't allow it.
69
70%description -n python3-odfpy -l pl.UTF-8
71Odfpy to biblioteka do odczytu i zapisu plików OpenDocument w wersji
721.2. Główny nacisk został położony na tym, aby nie pozwolić
73programiście na utworzenie błędnych dokumentów. Biblioteka rzuca
74wyjątek, jeśli programista dodaje błędny element, dodaje element
75nieznany gramatyce, zapomina dodać wymagany atrybut lub dodaje tekst
76do elementu, który na to nie pozwala.
77
78%package -n odfpy-tools
79Summary: Tools to manipulate OpenDocument files
80Summary(pl.UTF-8): Narzędzia do operacji na dokumentach OpenDocument
81Group: Applications/Publishing
82%if %{with python3}
83Requires: python3-odfpy = %{version}-%{release}
84%else
85Requires: python-odfpy = %{version}-%{release}
86%endif
87
88%description -n odfpy-tools
89Tools to manipulate OpenDocument files.
90
91%description -n odfpy-tools -l pl.UTF-8
92Narzędzia do operacji na dokumentach OpenDocument.
93
94%prep
95%setup -q -n odfpy-%{version}
96
97%build
98%if %{with python2}
99%py_build
100
101%if %{with tests}
102# test_xmlgenerator_wo_ns apparently fails with python 2.7
16af56cf 103PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
85aef10d
JB
104%{__python} -m pytest tests -k 'not test_xmlgenerator_wo_ns'
105%endif
106%endif
107
108%if %{with python3}
109%py3_build
110
111%if %{with tests}
16af56cf 112PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
85aef10d
JB
113%{__python3} -m pytest tests
114%endif
115%endif
116
117%install
118rm -rf $RPM_BUILD_ROOT
119
120%if %{with python2}
121%py_install
122
123%py_postclean
124
125install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
126cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
127
128%if %{with python3}
129# ensure packaged tools are python3 based
130%{__rm} -r $RPM_BUILD_ROOT{%{_bindir},%{_mandir}}
131%endif
132%endif
133
134%if %{with python3}
135%py3_install
136
137install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-odfpy-%{version}
138cp -p examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-odfpy-%{version}
139%endif
140
141%clean
142rm -rf $RPM_BUILD_ROOT
143
144%if %{with python2}
145%files
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}
151%endif
152
153%if %{with python3}
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}
160%endif
161
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*
This page took 0.212696 seconds and 4 git commands to generate.