]>
Commit | Line | Data |
---|---|---|
fb7d7565 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | ||
6a3c7823 | 6 | %define module xlrd |
d89fc661 | 7 | Summary: Python interface to extracting data from Excel datasheets |
8 | Summary(pl.UTF-8): Pythonowy interfejs do odczytywania danych z arkuszy Excela | |
9 | Name: python-%{module} | |
fb7d7565 | 10 | Version: 2.0.1 |
c3a135b4 | 11 | Release: 3 |
d89fc661 | 12 | License: BSD-style |
13 | Group: Development/Languages/Python | |
fb7d7565 JP |
14 | Source0: https://files.pythonhosted.org/packages/source/x/xlrd/%{module}-%{version}.tar.gz |
15 | # Source0-md5: ae3f951c857a490d432f0a7d722352bf | |
16 | URL: https://www.python-excel.org/ | |
17 | %if %{with python2} | |
18 | BuildRequires: python-modules >= 1:2.7 | |
19 | BuildRequires: python-setuptools | |
20 | %endif | |
21 | %if %{with python3} | |
22 | BuildRequires: python3-modules >= 1:3.6 | |
23 | BuildRequires: python3-setuptools | |
24 | %endif | |
d89fc661 | 25 | BuildRequires: rpm-pythonprov |
fb7d7565 JP |
26 | BuildRequires: rpmbuild(macros) >= 1.714 |
27 | Requires: python-modules >= 1:2.7 | |
d89fc661 | 28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | Python interface to extracting data from Excel datasheets | |
33 | ||
34 | %description -l pl.UTF-8 | |
35 | Pythonowy interfejs do odczytywania danych z arkuszy Excela | |
36 | ||
fb7d7565 JP |
37 | %package -n python3-%{module} |
38 | Summary: Python interface to extracting data from Excel datasheets | |
39 | Summary(pl.UTF-8): Pythonowy interfejs do odczytywania danych z arkuszy Excela | |
40 | Requires: python3-modules >= 1:3.6 | |
41 | ||
42 | %description -n python3-%{module} | |
43 | Python interface to extracting data from Excel datasheets | |
44 | ||
45 | %description -n python3-%{module} -l pl.UTF-8 | |
46 | Pythonowy interfejs do odczytywania danych z arkuszy Excela | |
47 | ||
d89fc661 | 48 | %prep |
49 | %setup -q -n %{module}-%{version} | |
50 | ||
51 | %build | |
fb7d7565 | 52 | %if %{with python2} |
59f958a3 | 53 | %py_build |
fb7d7565 JP |
54 | %endif |
55 | ||
56 | %if %{with python3} | |
57 | %py3_build | |
58 | %endif | |
d89fc661 | 59 | |
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
d85c4416 | 62 | |
fb7d7565 | 63 | %if %{with python2} |
59f958a3 | 64 | %py_install |
fb7d7565 JP |
65 | %py_postclean |
66 | %{__sed} -i -e 's|/usr/bin/env python|%{__python}|' $RPM_BUILD_ROOT%{_bindir}/runxlrd.py | |
67 | %endif | |
68 | ||
69 | %if %{with python3} | |
70 | %py3_install | |
71 | %{__sed} -i -e 's|/usr/bin/env python|%{__python3}|' $RPM_BUILD_ROOT%{_bindir}/runxlrd.py | |
72 | %endif | |
d89fc661 | 73 | |
d85c4416 | 74 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/runxlrd{.py,} |
d85c4416 | 75 | |
4c36fcbe | 76 | |
d89fc661 | 77 | %clean |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
fb7d7565 | 80 | %if %{with python2} |
d89fc661 | 81 | %files |
82 | %defattr(644,root,root,755) | |
fb7d7565 JP |
83 | %{py_sitescriptdir}/%{module} |
84 | %if %{without python3} | |
4c36fcbe | 85 | %attr(755,root,root) %{_bindir}/runxlrd |
fb7d7565 | 86 | %endif |
d89fc661 | 87 | %{py_sitescriptdir}/%{module}-*.egg-info |
88 | %endif | |
fb7d7565 JP |
89 | |
90 | %if %{with python3} | |
91 | %files -n python3-%{module} | |
92 | %defattr(644,root,root,755) | |
93 | %{py3_sitescriptdir}/%{module} | |
94 | %attr(755,root,root) %{_bindir}/runxlrd | |
95 | %{py3_sitescriptdir}/%{module}-*.egg-info | |
96 | %endif |