[packages/python-colorama] - new

baggins baggins at pld-linux.org
Fri Jul 4 21:31:19 CEST 2014


commit c3d2300137a216a7a51c9615a958d8cd268dedab
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Jul 4 21:31:28 2014 +0200

    - new

 python-colorama.spec | 137 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 137 insertions(+)
---
diff --git a/python-colorama.spec b/python-colorama.spec
new file mode 100644
index 0000000..b5043c1
--- /dev/null
+++ b/python-colorama.spec
@@ -0,0 +1,137 @@
+#
+# Conditional build:
+%bcond_without	tests	# do not perform "make test"
+%bcond_without	python2 # CPython 2.x module
+%bcond_without	python3 # CPython 3.x module
+
+%define		module	colorama
+Summary:	Cross-platform colored terminal text
+Name:		python-%{module}
+Version:	0.3.1
+Release:	1
+License:	BSD
+Group:		Libraries/Python
+Source0:	https://pypi.python.org/packages/source/c/colorama/%{module}-%{version}.tar.gz
+# Source0-md5:	95ce8bf32f5c25adea14b809db3509cb
+URL:		https://pypi.python.org/pypi/colorama
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.219
+%if %{with python2}
+BuildRequires:	python-distribute
+%endif
+%if %{with python3}
+BuildRequires:	python3-distribute
+BuildRequires:	python3-modules
+%endif
+Requires:	python-modules
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+ANSI escape character sequences have long been used to produce colored
+terminal text and cursor positioning on Unix and Macs. Colorama makes
+this work on Windows, too, by wrapping stdout, stripping ANSI
+sequences it finds (which otherwise show up as gobbledygook in your
+output), and converting them into the appropriate win32 calls to
+modify the state of the terminal. On other platforms, Colorama does
+nothing.
+
+Colorama also provides some shortcuts to help generate ANSI sequences
+but works fine in conjunction with any other ANSI sequence generation
+library, such as Termcolor (http://pypi.python.org/pypi/termcolor.)
+
+This has the upshot of providing a simple cross-platform API for
+printing colored terminal text from Python, and has the happy
+side-effect that existing applications or libraries which use ANSI
+sequences to produce colored output on Linux or Macs can now also
+work on Windows, simply by calling colorama.init().
+
+%package -n python3-%{module}
+Summary:	Cross-platform colored terminal text
+Group:		Libraries/Python
+
+%description -n python3-%{module}
+ANSI escape character sequences have long been used to produce colored
+terminal text and cursor positioning on Unix and Macs. Colorama makes
+this work on Windows, too, by wrapping stdout, stripping ANSI
+sequences it finds (which otherwise show up as gobbledygook in your
+output), and converting them into the appropriate win32 calls to
+modify the state of the terminal. On other platforms, Colorama does
+nothing.
+
+Colorama also provides some shortcuts to help generate ANSI sequences
+but works fine in conjunction with any other ANSI sequence generation
+library, such as Termcolor (http://pypi.python.org/pypi/termcolor.)
+
+This has the upshot of providing a simple cross-platform API for
+printing colored terminal text from Python, and has the happy
+side-effect that existing applications or libraries which use ANSI
+sequences to produce colored output on Linux or Macs can now also
+work on Windows, simply by calling colorama.init().
+
+%prep
+%setup -q -n %{module}-%{version}
+
+%build
+%if %{with python2}
+%{__python} setup.py build --build-base build-2 %{?with_tests:test}
+%endif
+
+%if %{with python3}
+%{__python3} setup.py build --build-base build-3 %{?with_tests:test}
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%{__python} setup.py \
+	build --build-base build-2 \
+	install --skip-build \
+	--optimize=2 \
+	--root=$RPM_BUILD_ROOT
+
+%py_postclean
+%endif
+
+%if %{with python3}
+%{__python3} setup.py \
+	build --build-base build-3 \
+	install --skip-build \
+	--optimize=2 \
+	--root=$RPM_BUILD_ROOT
+%endif
+
+%if %{with python2}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%endif
+%if %{with python3}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+cp -a demos/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
+find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
+	| xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%if %{with python2}
+%files
+%defattr(644,root,root,755)
+%doc CHANGELOG.rst README.txt
+%{py_sitescriptdir}/%{module}/*.py[co]
+%if "%{py_ver}" > "2.4"
+%{py_sitescriptdir}/%{module}-*.egg-info
+%endif
+%{_examplesdir}/%{name}-%{version}
+%endif
+
+%if %{with python3}
+%files -n python3-%{module}
+%defattr(644,root,root,755)
+%doc CHANGELOG.rst README.txt
+%{py3_sitescriptdir}/%{module}
+%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info
+%{_examplesdir}/python3-%{module}-%{version}
+%endif
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-colorama.git/commitdiff/c3d2300137a216a7a51c9615a958d8cd268dedab



More information about the pld-cvs-commit mailing list