Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global srcname ansi2html

Name:       python-ansi2html
Version:    1.0.2
Release:    1%{?dist}
Summary:    Python module that converts text with ANSI color to HTML

Group:      Development/Libraries
License:    GPLv3+
URL:        http://github.com/ralphbean/ansi2html
Source0:    http://pypi.python.org/packages/source/a/ansi2html/ansi2html-%{version}.tar.gz

BuildArch:  noarch

BuildRequires:  python
BuildRequires:  python-setuptools
BuildRequires:  python-nose
BuildRequires:  python-mock
BuildRequires:  python-six

%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-nose
BuildRequires:  python3-mock
BuildRequires:  python3-six
%endif

%if %{?rhel}%{!?rhel:0} >= 6
BuildRequires:  python-ordereddict
Requires:       python-ordereddict
%endif

Requires:   python
Requires:   python-six

%description
The ansi2html module can convert text with ANSI color codes to HTML.

%if 0%{?with_python3}
%package -n python3-ansi2html
Summary:    Python 3 module that converts text with ANSI color to HTML
Group:      Development/Libraries

%if 0%{?with_python3}
Requires:   python3
Requires:   python3-six
%endif

%description -n python3-ansi2html
The ansi2html module can convert text with ANSI color codes to HTML.
%endif


%prep
%setup -q -n %{srcname}-%{version}

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%check
%{__python} setup.py test

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif

%build
%{__python} setup.py build

%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif

%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install --skip-build --root=%{buildroot}
mv %{buildroot}/%{_bindir}/ansi2html %{buildroot}/%{_bindir}/python3-ansi2html
mv %{buildroot}/%{_mandir}/man1/ansi2html.1 %{buildroot}/%{_mandir}/man1/python3-ansi2html.1
popd
%endif

%{__python} setup.py install --skip-build --root=%{buildroot}


%files
%doc LICENSE README.rst
%{python_sitelib}/ansi2html
%{python_sitelib}/ansi2html-%{version}-*
%{_bindir}/ansi2html
%{_mandir}/man1/ansi2html*

%if 0%{?with_python3}
%files -n python3-ansi2html
%doc LICENSE README.rst
%{python3_sitelib}/ansi2html
%{python3_sitelib}/ansi2html-%{version}-*
%{_bindir}/python3-ansi2html
%{_mandir}/man1/python3-ansi2html*
%endif


%changelog
* Fri Oct 04 2013 Ralph Bean <rbean@redhat.com> - 1.0.2-1
- Latest upstream.
- Manpages now included.

* Thu Sep 26 2013 Ralph Bean <rbean@redhat.com> - 0.10.0-3
- Latest upstream with a superior internal state model thanks to Sebastian
  Pipping.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Mar 26 2013 Ralph Bean <rbean@redhat.com> - 0.9.4-2
- Removed python3 rhel conditional.

* Mon Feb 25 2013 Ralph Bean <rbean@redhat.com> - 0.9.4-1
- Latest upstream fixes encoding issues.

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Sep 26 2012 Ralph Bean <rbean@redhat.com> - 0.9.2-1
- New upstream
- Fixes dict ordering issues.
- Solves some encoding issues.

* Mon Aug  6 2012 David Malcolm <dmalcolm@redhat.com> - 0.9.1-8
- fix dict ordering issues

* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 0.9.1-7
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jul 09 2012 Ralph Bean <rbean@redhat.com> - 0.9.1-5
- Re-enabled tests.
* Mon Jul 09 2012 Ralph Bean <rbean@redhat.com> - 0.9.1-4
- Temporarily removed both sets of tests until python-mock problems are sorted
  out.
* Mon Jul 09 2012 Ralph Bean <rbean@redhat.com> - 0.9.1-3
- Temporarily removed python3 tests until python3-mock is available.
* Mon Jul 09 2012 Ralph Bean <rbean@redhat.com> - 0.9.1-2
- Added requirements python-mock and python-ordereddict.
* Mon Jul 09 2012 Ralph Bean <rbean@redhat.com> - 0.9.1-1
- Latest upstream version.
* Tue Jun 26 2012 Ralph Bean <rbean@redhat.com> - 0.9.0-4
- Only Require python3 for python3-ansi2html.
* Wed May 23 2012 Ralph Bean <rbean@redhat.com> - 0.9.0-3
- Fix executable python2/python3 confusion.
- More explicit ownership of dirs in python_sitelib.
- Removed mixed use of tabs and spaces.
* Wed May 09 2012 Ralph Bean <rbean@redhat.com> - 0.9.0-2
- python3 support.
* Wed May 09 2012 Ralph Bean <rbean@redhat.com> - 0.9.0-1
- Packaged latest upstream version.
- Removed unnecessary defattr and buildroot
- New dependency on python-six
* Fri Feb 3 2012 Ralph Bean <rbean@redhat.com> - 0.8.3-1
- Included tests in check section.
- More concise file ownership declarations.
- Resolved license ambiguity in upstream.
- Removed shebang from non-executable file.
* Mon Jan 30 2012 Ralph Bean <rbean@redhat.com> - 0.8.2-1
- Updated ansi2html version to latest 0.8.2.
- Added _bindir entry for the ansi2html console-script.
- Removed dependency on genshi.
- Removed references to now EOL fedora 12.
* Wed Sep 15 2010 Ralph Bean <ralph.bean@gmail.com> - 0.5.2-1
- Updated spec based on comments from Mark McKinstry
* Tue Sep 7 2010 Ralph Bean <ralph.bean@gmail.com> - 0.5.1-1
- Initial RPM packaging