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