]>
Commit | Line | Data |
---|---|---|
3cc171a0 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # unit tests | |
4 | %bcond_without python2 # CPython 2.x module | |
5 | %bcond_without python3 # CPython 3.x module | |
6 | ||
7 | %define module blessings | |
8 | %define egg_name blessings | |
9 | %define pypi_name blessings | |
10 | Summary: Python library for terminal coloring, styling, and positioning | |
11 | Name: python-%{module} | |
12 | Version: 1.7 | |
3080a8de | 13 | Release: 3 |
3cc171a0 ER |
14 | License: MIT |
15 | Group: Libraries/Python | |
16 | Source0: https://files.pythonhosted.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz | |
17 | # Source0-md5: 38555a2bba0ace706aec58444368e022 | |
18 | Patch1: 0001-fix-tests-when-run-without-a-tty-fixes-25.patch | |
19 | Patch2: 0002-more-fixes-for-tests-without-a-tty.patch | |
20 | URL: https://github.com/erikrose/blessings | |
21 | %if %{with python2} | |
22 | BuildRequires: python-modules >= 1:2.5 | |
23 | BuildRequires: python-nose | |
24 | BuildRequires: python-setuptools | |
25 | BuildRequires: python-six | |
26 | %endif | |
27 | %if %{with python3} | |
28 | BuildRequires: python3-modules >= 1:3.2 | |
29 | BuildRequires: python3-nose | |
30 | BuildRequires: python3-setuptools | |
31 | BuildRequires: python3-six | |
32 | %endif | |
3cc171a0 ER |
33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | Blessings is a thin, practical wrapper around terminal coloring, | |
38 | styling, and positioning in Python. | |
39 | ||
40 | %package -n python3-%{module} | |
41 | Summary: Python 3 library for terminal coloring, styling, and positioning | |
42 | Group: Libraries/Python | |
3cc171a0 ER |
43 | |
44 | %description -n python3-%{module} | |
45 | Blessings is a thin, practical wrapper around terminal coloring, | |
46 | styling, and positioning in Python. | |
47 | ||
48 | %prep | |
49 | %setup -q -n %{pypi_name}-%{version} | |
50 | %patch1 -p1 | |
51 | %patch2 -p1 | |
52 | rm -r blessings.egg-info | |
53 | ||
54 | %build | |
55 | %if %{with python2} | |
56 | %py_build | |
57 | %if %{with tests} | |
58 | nosetests-%{py_ver} build-2/lib | |
59 | %endif | |
60 | %endif | |
61 | %if %{with python3} | |
62 | %py3_build | |
63 | %if %{with tests} | |
64 | nosetests-%{py3_ver} build-3/lib | |
65 | %endif | |
66 | %endif | |
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | %if %{with python2} | |
71 | %py_install | |
72 | %py_postclean | |
73 | %endif | |
74 | %if %{with python3} | |
75 | %py3_install | |
76 | %endif | |
77 | ||
78 | %clean | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
81 | %if %{with python2} | |
82 | %files | |
83 | %defattr(644,root,root,755) | |
84 | %doc README.rst LICENSE | |
85 | %{py_sitescriptdir}/%{module} | |
86 | %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
87 | %endif | |
88 | ||
89 | %if %{with python3} | |
90 | %files -n python3-%{module} | |
91 | %defattr(644,root,root,755) | |
92 | %doc README.rst LICENSE | |
93 | %{py3_sitescriptdir}/%{module} | |
94 | %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info | |
95 | %endif |