]>
Commit | Line | Data |
---|---|---|
127c3ad0 JP |
1 | # Conditional build: |
2 | %bcond_without python2 # CPython 2.x module | |
3 | %bcond_without python3 # CPython 3.x module | |
4 | ||
5 | %define module et_xmlfile | |
6 | Summary: An implementation of lxml.xmlfile for the standard library | |
7 | Name: python-%{module} | |
8 | Version: 1.0.1 | |
77ab49be | 9 | Release: 4 |
127c3ad0 JP |
10 | License: MIT |
11 | Group: Libraries/Python | |
12 | #Source0Download: https://pypi.org/simple/et_xmlfile/ | |
13 | Source0: https://files.pythonhosted.org/packages/source/e/et_xmlfile/%{module}-%{version}.tar.gz | |
14 | # Source0-md5: f47940fd9d556375420b2e276476cfaf | |
15 | URL: https://bitbucket.org/openpyxl/et_xmlfile | |
16 | %if %{with python2} | |
17 | BuildRequires: python-modules >= 1:2.6 | |
18 | BuildRequires: python-setuptools | |
19 | %endif | |
20 | %if %{with python3} | |
21 | BuildRequires: python3-modules >= 1:3.3 | |
22 | BuildRequires: python3-setuptools | |
23 | %endif | |
24 | BuildRequires: rpm-pythonprov | |
25 | BuildRequires: rpmbuild(macros) >= 1.714 | |
26 | Requires: python-modules >= 1:2.6 | |
27 | BuildArch: noarch | |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
31 | et_xmlfile is a low memory library for creating large XML files. | |
32 | ||
33 | It is based upon the xmlfile module from lxml with the aim of allowing | |
34 | code to be developed that will work with both libraries. It was | |
35 | developed initially for the openpyxl project but is now a standalone | |
36 | module. | |
37 | ||
38 | %package -n python3-%{module} | |
39 | Summary: An implementation of lxml.xmlfile for the standard library | |
40 | Group: Libraries/Python | |
41 | Requires: python3-modules >= 1:3.3 | |
42 | ||
43 | %description -n python3-%{module} | |
44 | et_xmlfile is a low memory library for creating large XML files. | |
45 | ||
46 | It is based upon the xmlfile module from lxml with the aim of allowing | |
47 | code to be developed that will work with both libraries. It was | |
48 | developed initially for the openpyxl project but is now a standalone | |
49 | module. | |
50 | ||
51 | %prep | |
52 | %setup -q -n %{module}-%{version} | |
53 | ||
54 | %build | |
55 | %if %{with python2} | |
56 | %py_build | |
57 | %endif | |
58 | ||
59 | %if %{with python3} | |
60 | %py3_build | |
61 | %endif | |
62 | ||
63 | %install | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | ||
66 | %if %{with python2} | |
67 | %py_install | |
68 | ||
69 | %py_postclean | |
70 | %endif | |
71 | ||
72 | %if %{with python3} | |
73 | %py3_install | |
74 | %endif | |
75 | ||
76 | %clean | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
79 | %if %{with python2} | |
80 | %files | |
81 | %defattr(644,root,root,755) | |
82 | %doc README.rst | |
83 | %{py_sitescriptdir}/%{module} | |
84 | %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
88 | %files -n python3-%{module} | |
89 | %defattr(644,root,root,755) | |
90 | %doc README.rst | |
91 | %{py3_sitescriptdir}/%{module} | |
92 | %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info | |
93 | %endif |