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