]> git.pld-linux.org Git - packages/python-xlrd.git/blob - python-xlrd.spec
fix runxlrd shebang if building with both python2 and python3; rel 5
[packages/python-xlrd.git] / python-xlrd.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5
6 %define         module  xlrd
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}
10 Version:        2.0.1
11 Release:        5
12 License:        BSD-style
13 Group:          Development/Languages/Python
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
25 BuildRequires:  rpm-pythonprov
26 BuildRequires:  rpmbuild(macros) >= 1.714
27 Requires:       python-modules >= 1:2.7
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
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
48 %prep
49 %setup -q -n %{module}-%{version}
50
51 %build
52 %if %{with python2}
53 %py_build
54 %endif
55
56 %if %{with python3}
57 %py3_build
58 %endif
59
60 %install
61 rm -rf $RPM_BUILD_ROOT
62
63 %if %{with python2}
64 %py_install
65 %py_postclean
66 %{!?with_python3:%{__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
73
74 %{__mv} $RPM_BUILD_ROOT%{_bindir}/runxlrd{.py,}
75
76
77 %clean
78 rm -rf $RPM_BUILD_ROOT
79
80 %if %{with python2}
81 %files
82 %defattr(644,root,root,755)
83 %{py_sitescriptdir}/%{module}
84 %if %{without python3}
85 %attr(755,root,root) %{_bindir}/runxlrd
86 %endif
87 %{py_sitescriptdir}/%{module}-*.egg-info
88 %endif
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
This page took 0.111746 seconds and 3 git commands to generate.