]> git.pld-linux.org Git - packages/python-colorama.git/blame - python-colorama.spec
rebuild with tests and docs
[packages/python-colorama.git] / python-colorama.spec
CommitLineData
c3d23001
JR
1#
2# Conditional build:
c3d23001
JR
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
5
f7b361fb 6%define module colorama
c3d23001 7Summary: Cross-platform colored terminal text
4ea1c680 8Summary(pl.UTF-8): Wieloplatformowe kolorowanie tekstu na terminalu
c3d23001 9Name: python-%{module}
a9968bc6 10Version: 0.4.4
ef1c446d 11Release: 4
c3d23001
JR
12License: BSD
13Group: Libraries/Python
4ea1c680
JB
14#Source0Download: https://pypi.org/simple/colorama/
15Source0: https://files.pythonhosted.org/packages/source/c/colorama/%{module}-%{version}.tar.gz
a9968bc6 16# Source0-md5: 57b22f2597f63df051b69906fbf310cc
f7b361fb 17URL: https://github.com/tartley/colorama
c3d23001 18BuildRequires: rpm-pythonprov
4ea1c680 19BuildRequires: rpmbuild(macros) >= 1.714
c3d23001 20%if %{with python2}
4ea1c680 21BuildRequires: python-modules >= 1:2.7
f7b361fb 22BuildRequires: python-setuptools
c3d23001
JR
23%endif
24%if %{with python3}
0291ba8e 25BuildRequires: python3-modules >= 1:3.5
f7b361fb 26BuildRequires: python3-setuptools
c3d23001 27%endif
0291ba8e
JB
28BuildRequires: sed >= 4.0
29Requires: python-modules >= 1:2.7
c3d23001
JR
30BuildArch: noarch
31BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33%description
34ANSI escape character sequences have long been used to produce colored
35terminal text and cursor positioning on Unix and Macs. Colorama makes
36this work on Windows, too, by wrapping stdout, stripping ANSI
37sequences it finds (which otherwise show up as gobbledygook in your
4ea1c680 38output), and converting them into the appropriate Win32 calls to
c3d23001
JR
39modify the state of the terminal. On other platforms, Colorama does
40nothing.
41
42Colorama also provides some shortcuts to help generate ANSI sequences
43but works fine in conjunction with any other ANSI sequence generation
0291ba8e 44library, such as Termcolor (<https://pypi.org/project/termcolor/>).
c3d23001
JR
45
46This has the upshot of providing a simple cross-platform API for
47printing colored terminal text from Python, and has the happy
48side-effect that existing applications or libraries which use ANSI
f7b361fb
ER
49sequences to produce colored output on Linux or Macs can now also work
50on Windows, simply by calling colorama.init().
c3d23001 51
4ea1c680
JB
52%description -l pl.UTF-8
53Do wyświetlania kolorowego tekstu na terminalu oraz przesuwania
54kursora w systemach Unix i Mac od dawna używane są sekwencje ANSI.
55Colorama sprawia, że działa to także pod Windows - poprzez
56przechwycenie stdout, wycinanie znalezionych sekwencji ANSI (które w
57przeciwnym wypadku wyświetliłyby się jako bełkot) i przekształcanie
58ich na odpowiednie wywołania Win32, modyfikujące stan terminala. Na
59innych platformach Colorama nie robi nic.
60
61Colorama zapewnia też pewne ułatwienia do generowania sekwencji ANSI,
62ale działa dobrze w połączeniu z dowolną inną biblioteką generującą
63sekwencje ANSI, taką jak Termcolor
0291ba8e 64(<https://pypi.org/project/termcolor/>).
4ea1c680
JB
65
66Efektem jest zapewnienie prostego, wieloplatformowego API do
67wypisywania kolorowego tekstu z Pythona, co ma miły efekt uboczny, że
68istniejące aplikacje czy biblioteki wykorzystujące sekwencje ANSI do
69tworzenia kolorowego wyjścia pod systemem Linux czy Mac będą teraz
70działać także pod Windows dzięki prostemu wywołaniu colorama.init().
71
c3d23001
JR
72%package -n python3-%{module}
73Summary: Cross-platform colored terminal text
4ea1c680 74Summary(pl.UTF-8): Wieloplatformowe kolorowanie tekstu na terminalu
c3d23001 75Group: Libraries/Python
0291ba8e 76Requires: python3-modules >= 1:3.5
c3d23001
JR
77
78%description -n python3-%{module}
79ANSI escape character sequences have long been used to produce colored
80terminal text and cursor positioning on Unix and Macs. Colorama makes
81this work on Windows, too, by wrapping stdout, stripping ANSI
82sequences it finds (which otherwise show up as gobbledygook in your
83output), and converting them into the appropriate win32 calls to
84modify the state of the terminal. On other platforms, Colorama does
85nothing.
86
87Colorama also provides some shortcuts to help generate ANSI sequences
88but works fine in conjunction with any other ANSI sequence generation
0291ba8e 89library, such as Termcolor (<https://pypi.org/project/termcolor/>).
c3d23001
JR
90
91This has the upshot of providing a simple cross-platform API for
92printing colored terminal text from Python, and has the happy
93side-effect that existing applications or libraries which use ANSI
f7b361fb
ER
94sequences to produce colored output on Linux or Macs can now also work
95on Windows, simply by calling colorama.init().
c3d23001 96
4ea1c680
JB
97%description -n python3-%{module} -l pl.UTF-8
98Do wyświetlania kolorowego tekstu na terminalu oraz przesuwania
99kursora w systemach Unix i Mac od dawna używane są sekwencje ANSI.
100Colorama sprawia, że działa to także pod Windows - poprzez
101przechwycenie stdout, wycinanie znalezionych sekwencji ANSI (które w
102przeciwnym wypadku wyświetliłyby się jako bełkot) i przekształcanie
103ich na odpowiednie wywołania Win32, modyfikujące stan terminala. Na
104innych platformach Colorama nie robi nic.
105
106Colorama zapewnia też pewne ułatwienia do generowania sekwencji ANSI,
107ale działa dobrze w połączeniu z dowolną inną biblioteką generującą
108sekwencje ANSI, taką jak Termcolor
0291ba8e 109(<https://pypi.org/project/termcolor/>).
4ea1c680
JB
110
111Efektem jest zapewnienie prostego, wieloplatformowego API do
112wypisywania kolorowego tekstu z Pythona, co ma miły efekt uboczny, że
113istniejące aplikacje czy biblioteki wykorzystujące sekwencje ANSI do
114tworzenia kolorowego wyjścia pod systemem Linux czy Mac będą teraz
115działać także pod Windows dzięki prostemu wywołaniu colorama.init().
116
c3d23001
JR
117%prep
118%setup -q -n %{module}-%{version}
119
0291ba8e
JB
120%{__sed} -i -e '1s,/usr/bin/env bash,/bin/sh,' demos/demo.sh
121
c3d23001
JR
122%build
123%if %{with python2}
0291ba8e 124%py_build
c3d23001
JR
125%endif
126
127%if %{with python3}
0291ba8e 128%py3_build
c3d23001
JR
129%endif
130
131%install
132rm -rf $RPM_BUILD_ROOT
133
134%if %{with python2}
da038363 135%py_install
0291ba8e 136
c3d23001 137%py_postclean
0291ba8e
JB
138
139install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
140cp -a demos/*.{py,sh} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
141%{__sed} -i -e '1s,/usr/bin/python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
142%{__sed} -i -e 's,^python ,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/demo.sh
c3d23001
JR
143%endif
144
145%if %{with python3}
da038363 146%py3_install
c3d23001 147
c3d23001 148install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
0291ba8e
JB
149cp -a demos/*.{py,sh} $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
150%{__sed} -i -e '1s,/usr/bin/python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
151%{__sed} -i -e 's,^python ,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/demo.sh
c3d23001
JR
152%endif
153
154%clean
155rm -rf $RPM_BUILD_ROOT
156
157%if %{with python2}
158%files
159%defattr(644,root,root,755)
4ea1c680 160%doc CHANGELOG.rst LICENSE.txt README.rst
52c7cb20 161%dir %{py_sitescriptdir}/%{module}
c3d23001 162%{py_sitescriptdir}/%{module}/*.py[co]
c3d23001 163%{py_sitescriptdir}/%{module}-*.egg-info
c3d23001
JR
164%{_examplesdir}/%{name}-%{version}
165%endif
166
167%if %{with python3}
168%files -n python3-%{module}
169%defattr(644,root,root,755)
4ea1c680 170%doc CHANGELOG.rst LICENSE.txt README.rst
c3d23001
JR
171%{py3_sitescriptdir}/%{module}
172%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
173%{_examplesdir}/python3-%{module}-%{version}
174%endif
This page took 0.114994 seconds and 4 git commands to generate.