]> git.pld-linux.org Git - packages/python-colorama.git/blob - python-colorama.spec
- release 6 (by relup.sh)
[packages/python-colorama.git] / python-colorama.spec
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  colorama
8 Summary:        Cross-platform colored terminal text
9 Name:           python-%{module}
10 Version:        0.3.1
11 Release:        6
12 License:        BSD
13 Group:          Libraries/Python
14 Source0:        https://pypi.python.org/packages/source/c/colorama/%{module}-%{version}.tar.gz
15 # Source0-md5:  95ce8bf32f5c25adea14b809db3509cb
16 URL:            https://pypi.python.org/pypi/colorama
17 BuildRequires:  rpm-pythonprov
18 BuildRequires:  rpmbuild(macros) >= 1.219
19 %if %{with python2}
20 BuildRequires:  python-distribute
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3-distribute
24 BuildRequires:  python3-modules
25 %endif
26 Requires:       python-modules
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 ANSI escape character sequences have long been used to produce colored
32 terminal text and cursor positioning on Unix and Macs. Colorama makes
33 this work on Windows, too, by wrapping stdout, stripping ANSI
34 sequences it finds (which otherwise show up as gobbledygook in your
35 output), and converting them into the appropriate win32 calls to
36 modify the state of the terminal. On other platforms, Colorama does
37 nothing.
38
39 Colorama also provides some shortcuts to help generate ANSI sequences
40 but works fine in conjunction with any other ANSI sequence generation
41 library, such as Termcolor (http://pypi.python.org/pypi/termcolor.)
42
43 This has the upshot of providing a simple cross-platform API for
44 printing colored terminal text from Python, and has the happy
45 side-effect that existing applications or libraries which use ANSI
46 sequences to produce colored output on Linux or Macs can now also
47 work on Windows, simply by calling colorama.init().
48
49 %package -n python3-%{module}
50 Summary:        Cross-platform colored terminal text
51 Group:          Libraries/Python
52
53 %description -n python3-%{module}
54 ANSI escape character sequences have long been used to produce colored
55 terminal text and cursor positioning on Unix and Macs. Colorama makes
56 this work on Windows, too, by wrapping stdout, stripping ANSI
57 sequences it finds (which otherwise show up as gobbledygook in your
58 output), and converting them into the appropriate win32 calls to
59 modify the state of the terminal. On other platforms, Colorama does
60 nothing.
61
62 Colorama also provides some shortcuts to help generate ANSI sequences
63 but works fine in conjunction with any other ANSI sequence generation
64 library, such as Termcolor (http://pypi.python.org/pypi/termcolor.)
65
66 This has the upshot of providing a simple cross-platform API for
67 printing colored terminal text from Python, and has the happy
68 side-effect that existing applications or libraries which use ANSI
69 sequences to produce colored output on Linux or Macs can now also
70 work on Windows, simply by calling colorama.init().
71
72 %prep
73 %setup -q -n %{module}-%{version}
74
75 %build
76 %if %{with python2}
77 %py_build %{?with_tests:test}
78 %endif
79
80 %if %{with python3}
81 %py3_build %{?with_tests:test}
82 %endif
83
84 %install
85 rm -rf $RPM_BUILD_ROOT
86
87 %if %{with python2}
88 %py_install
89
90 %py_postclean
91 %endif
92
93 %if %{with python3}
94 %py3_install
95 %endif
96
97 %if %{with python2}
98 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
100 %endif
101 %if %{with python3}
102 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
103 cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
104 find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
105         | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
106 %endif
107
108 %clean
109 rm -rf $RPM_BUILD_ROOT
110
111 %if %{with python2}
112 %files
113 %defattr(644,root,root,755)
114 %doc CHANGELOG.rst README.txt
115 %dir %{py_sitescriptdir}/%{module}
116 %{py_sitescriptdir}/%{module}/*.py[co]
117 %if "%{py_ver}" > "2.4"
118 %{py_sitescriptdir}/%{module}-*.egg-info
119 %endif
120 %{_examplesdir}/%{name}-%{version}
121 %endif
122
123 %if %{with python3}
124 %files -n python3-%{module}
125 %defattr(644,root,root,755)
126 %doc CHANGELOG.rst README.txt
127 %{py3_sitescriptdir}/%{module}
128 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
129 %{_examplesdir}/python3-%{module}-%{version}
130 %endif
This page took 0.062681 seconds and 3 git commands to generate.