]>
Commit | Line | Data |
---|---|---|
d0fc539f JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # do not perform "make test" | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module docopt | |
8 | Summary: Pythonic argument parser, that will make you smile | |
00ba8915 | 9 | Summary(pl.UTF-8): Przyjemny pythonowy parser argumentów |
d0fc539f JR |
10 | Name: python-%{module} |
11 | Version: 0.6.2 | |
8044432c | 12 | Release: 12 |
d0fc539f JR |
13 | License: MIT |
14 | Group: Libraries/Python | |
00ba8915 JB |
15 | #Source0Download: https://pypi.org/simple/docopt/ |
16 | Source0: https://files.pythonhosted.org/packages/source/d/docopt/%{module}-%{version}.tar.gz | |
d0fc539f JR |
17 | # Source0-md5: 4bc74561b37fad5d3e7d037f82a4c3b1 |
18 | URL: http://docopt.org/ | |
d0fc539f | 19 | %if %{with python2} |
00ba8915 JB |
20 | BuildRequires: python-modules >= 1:2.5 |
21 | BuildRequires: python-setuptools | |
d0fc539f JR |
22 | %endif |
23 | %if %{with python3} | |
00ba8915 JB |
24 | BuildRequires: python3-modules >= 1:3.2 |
25 | BuildRequires: python3-setuptools | |
d0fc539f | 26 | %endif |
00ba8915 JB |
27 | BuildRequires: rpm-pythonprov |
28 | BuildRequires: rpmbuild(macros) >= 1.714 | |
29 | BuildRequires: sed >= 4.0 | |
30 | Requires: python-modules >= 1:2.5 | |
d0fc539f JR |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | docopt creates beautiful command-line interfaces. | |
36 | ||
00ba8915 JB |
37 | %description -l pl.UTF-8 |
38 | docopt tworzy ładne interfejsy linii poleceń. | |
39 | ||
d0fc539f JR |
40 | %package -n python3-%{module} |
41 | Summary: Pythonic argument parser, that will make you smile | |
00ba8915 | 42 | Summary(pl.UTF-8): Przyjemny pythonowy parser argumentów |
d0fc539f | 43 | Group: Libraries/Python |
00ba8915 | 44 | Requires: python3-modules >= 1:3.2 |
d0fc539f JR |
45 | |
46 | %description -n python3-%{module} | |
47 | docopt creates beautiful command-line interfaces. | |
48 | ||
00ba8915 JB |
49 | %description -n python3-%{module} -l pl.UTF-8 |
50 | docopt tworzy ładne interfejsy linii poleceń. | |
51 | ||
d0fc539f JR |
52 | %prep |
53 | %setup -q -n %{module}-%{version} | |
54 | ||
d0fc539f JR |
55 | %build |
56 | %if %{with python2} | |
00ba8915 | 57 | %py_build |
d0fc539f JR |
58 | %endif |
59 | ||
60 | %if %{with python3} | |
00ba8915 | 61 | %py3_build |
d0fc539f JR |
62 | %endif |
63 | ||
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | ||
67 | %if %{with python2} | |
26555c57 | 68 | %py_install |
d0fc539f JR |
69 | |
70 | %py_postclean | |
71 | %endif | |
72 | ||
73 | %if %{with python3} | |
26555c57 | 74 | %py3_install |
d0fc539f JR |
75 | %endif |
76 | ||
d0fc539f JR |
77 | %if %{with python2} |
78 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
79 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
00ba8915 | 80 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/git/git.py |
d0fc539f JR |
81 | %endif |
82 | %if %{with python3} | |
83 | install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
84 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} | |
00ba8915 | 85 | %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/git/git.py |
d0fc539f JR |
86 | %endif |
87 | ||
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %if %{with python2} | |
92 | %files | |
93 | %defattr(644,root,root,755) | |
00ba8915 JB |
94 | %doc LICENSE-MIT README.rst |
95 | %{py_sitescriptdir}/docopt.py[co] | |
96 | %{py_sitescriptdir}/docopt-%{version}-py*.egg-info | |
d0fc539f JR |
97 | %{_examplesdir}/%{name}-%{version} |
98 | %endif | |
99 | ||
100 | %if %{with python3} | |
101 | %files -n python3-%{module} | |
102 | %defattr(644,root,root,755) | |
00ba8915 JB |
103 | %doc LICENSE-MIT README.rst |
104 | %{py3_sitescriptdir}/__pycache__/docopt.cpython-*.py[co] | |
105 | %{py3_sitescriptdir}/docopt.py | |
106 | %{py3_sitescriptdir}/docopt-%{version}-py*.egg-info | |
d0fc539f JR |
107 | %{_examplesdir}/python3-%{module}-%{version} |
108 | %endif |