]>
Commit | Line | Data |
---|---|---|
9cc8b867 JB |
1 | # |
2 | # Conditional build: | |
52634668 | 3 | %bcond_without tests # do not perform "make test" (use for extras/testtools pair bootstrap) |
9cc8b867 JB |
4 | %bcond_without python2 # CPython 2.x module |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | Summary: Useful extra bits for Python - things that should be in the standard library | |
8 | Summary(pl.UTF-8): Przydatne dodatki do Pythona, które powinny być w bibliotece standardowej | |
9 | Name: python-extras | |
10 | Version: 0.0.3 | |
f034caa2 | 11 | Release: 5 |
9cc8b867 JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
14 | Source0: https://pypi.python.org/packages/source/e/extras/extras-%{version}.tar.gz | |
15 | # Source0-md5: 62d8ba049e3386a6df69b413ea81517b | |
9cc8b867 JB |
16 | URL: https://github.com/testing-cabal/extras |
17 | BuildRequires: python-distribute | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.219 | |
9cc8b867 JB |
20 | %if %{with python3} |
21 | BuildRequires: python3-distribute | |
22 | %endif | |
23 | %if %{with tests} | |
24 | %if %{with python2} | |
25 | BuildRequires: python-testtools | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-testtools | |
29 | %endif | |
30 | %endif | |
31 | Requires: python-modules | |
32 | BuildArch: noarch | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
36 | extras is a set of extensions to the Python standard library, | |
37 | originally written to make the code within testtools cleaner, but now | |
38 | split out for general use outside of a testing context. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | extras to zbiór rozszerzeń biblioteki standardowej Pythona, pierwotnie | |
42 | napisany, aby uczynić kod biblioteki testtools czytelniejszym, ale | |
43 | później wydzielony do ogólnego użytku, nie tylko w kontekście testów. | |
44 | ||
45 | %package -n python3-extras | |
46 | Summary: Useful extra bits for Python - things that should be in the standard library | |
47 | Summary(pl.UTF-8): Przydatne dodatki do Pythona, które powinny być w bibliotece standardowej | |
48 | Group: Libraries/Python | |
49 | Requires: python3-modules | |
50 | ||
51 | %description -n python3-extras | |
52 | extras is a set of extensions to the Python standard library, | |
53 | originally written to make the code within testtools cleaner, but now | |
54 | split out for general use outside of a testing context. | |
55 | ||
56 | %description -n python3-extras -l pl.UTF-8 | |
57 | extras to zbiór rozszerzeń biblioteki standardowej Pythona, pierwotnie | |
58 | napisany, aby uczynić kod biblioteki testtools czytelniejszym, ale | |
59 | później wydzielony do ogólnego użytku, nie tylko w kontekście testów. | |
60 | ||
61 | %prep | |
62 | %setup -q -n extras-%{version} | |
9cc8b867 JB |
63 | |
64 | %build | |
65 | %if %{with python2} | |
66 | %{__python} setup.py \ | |
67 | build --build-base build-2 \ | |
68 | %{?with_tests:test} | |
69 | %endif | |
70 | ||
71 | %if %{with python3} | |
72 | %{__python3} setup.py \ | |
73 | build --build-base build-3 \ | |
74 | %{?with_tests:test} | |
75 | %endif | |
76 | ||
77 | %install | |
78 | rm -rf $RPM_BUILD_ROOT | |
79 | ||
80 | %if %{with python2} | |
bcaed876 | 81 | %py_install |
9cc8b867 JB |
82 | |
83 | %py_postclean | |
84 | %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/extras/tests | |
85 | %endif | |
86 | ||
87 | %if %{with python3} | |
bcaed876 | 88 | %py3_install |
9cc8b867 JB |
89 | |
90 | %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/extras/tests | |
91 | %endif | |
92 | ||
93 | %clean | |
94 | rm -rf $RPM_BUILD_ROOT | |
95 | ||
96 | %if %{with python2} | |
97 | %files | |
98 | %defattr(644,root,root,755) | |
99 | %doc LICENSE NEWS README.rst | |
100 | %{py_sitescriptdir}/extras | |
101 | %{py_sitescriptdir}/extras-%{version}-py*.egg-info | |
102 | %endif | |
103 | ||
104 | %if %{with python3} | |
105 | %files -n python3-extras | |
106 | %defattr(644,root,root,755) | |
107 | %doc LICENSE NEWS README.rst | |
108 | %{py3_sitescriptdir}/extras | |
109 | %{py3_sitescriptdir}/extras-%{version}-py*.egg-info | |
110 | %endif |