]> git.pld-linux.org Git - packages/python-blessings.git/blob - python-blessings.spec
aa4f24d21c63d625793b3b9529f82770bb0caaa1
[packages/python-blessings.git] / python-blessings.spec
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
13 Release:        1
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
33 Requires:       python-six
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
38 Blessings is a thin, practical wrapper around terminal coloring,
39 styling, and positioning in Python.
40
41 %package -n python3-%{module}
42 Summary:        Python 3 library for terminal coloring, styling, and positioning
43 Group:          Libraries/Python
44 Requires:       python3-six
45
46 %description -n python3-%{module}
47 Blessings is a thin, practical wrapper around terminal coloring,
48 styling, and positioning in Python.
49
50 %prep
51 %setup -q -n %{pypi_name}-%{version}
52 %patch1 -p1
53 %patch2 -p1
54 rm -r blessings.egg-info
55
56 %build
57 %if %{with python2}
58 %py_build
59 %if %{with tests}
60 nosetests-%{py_ver} build-2/lib
61 %endif
62 %endif
63 %if %{with python3}
64 %py3_build
65 %if %{with tests}
66 nosetests-%{py3_ver} build-3/lib
67 %endif
68 %endif
69
70 %install
71 rm -rf $RPM_BUILD_ROOT
72 %if %{with python2}
73 %py_install
74 %py_postclean
75 %endif
76 %if %{with python3}
77 %py3_install
78 %endif
79
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83 %if %{with python2}
84 %files
85 %defattr(644,root,root,755)
86 %doc README.rst LICENSE
87 %{py_sitescriptdir}/%{module}
88 %{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
89 %endif
90
91 %if %{with python3}
92 %files -n python3-%{module}
93 %defattr(644,root,root,755)
94 %doc README.rst LICENSE
95 %{py3_sitescriptdir}/%{module}
96 %{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
97 %endif
This page took 0.072248 seconds and 2 git commands to generate.