Blob Blame History Raw
%global with_python3 1
Name:		python-ansi
Version:	0.1.3
Release:	5%{?dist}
Summary:	ANSI cursor movement and graphics

License:	MIT
URL:		https://github.com/tehmaze/ansi
Source0:	https://pypi.python.org/packages/source/a/ansi/ansi-%{version}.tar.gz

BuildRequires:	python2-devel
%if 0%{?with_python3}
BuildRequires:	python3-devel
%endif # if with_python3
BuildArch:	noarch

%description
Various ANSI escape codes, used in moving the cursor in a text console or
rendering colored text with Python 2.


%if 0%{?with_python3}
%package -n python3-ansi
Summary:	ANSI cursor movement and graphics

%description -n python3-ansi
Various ANSI escape codes, used in moving the cursor in a text console or
rendering colored text with Python 3.
%endif # if with_python3

%prep
%setup -qc
mv ansi-%{version} python2
pushd python2
cp -pr README.md LICENSE.md ../
popd

%if 0%{?with_python3}
cp -a python2 python3
%endif # with_python3

%build
pushd python2
%{__python2} setup.py build
popd
%if 0%{?with_python3}
pushd python3
%{__python3} setup.py build
popd
%endif # with_python3

%install
pushd python2
%{__python2} setup.py install --skip-build --root %{buildroot}
popd
%if 0%{?with_python3}
pushd python3
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
%endif # if with_python3

%files
%license LICENSE.md
%doc README.md
%{python_sitelib}/*

%if 0%{?with_python3}
%files -n python3-ansi
%license LICENSE.md
%doc README.md
%{python3_sitelib}/*
%endif # if with_python3

%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.3-4
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Mon Jul 27 2015 Sebastian Dyroff <sdyroff@fedoraproject.org> 0.1.3-3
- Improve source url (BZ #1245356)
- Remove CFLAGS (BZ #1245356)
- Fix changelog (BZ #1245356)

* Wed Jul 08 2015 Sebasitan Dyroff <sdyroff@fedoraproject.org> 0.1.3-2
- Fix source url (BZ #1245356)

* Tue Jul 07 2015 Sebasitan Dyroff <sdyroff@fedoraproject.org> 0.1.3-1
- Initial packaging