ralph pushed to python-ansi2html (f20). "Modernize python2 macros."
notifications at fedoraproject.org
notifications at fedoraproject.org
Mon Mar 30 19:15:00 UTC 2015
>From 8fd79d0f6406e8008d79533128ffc33d6e10e8e5 Mon Sep 17 00:00:00 2001
From: Ralph Bean <rbean at redhat.com>
Date: Mon, 13 Oct 2014 14:51:57 -0400
Subject: Modernize python2 macros.
diff --git a/python-ansi2html.spec b/python-ansi2html.spec
index 2f92a77..cbc60ab 100644
--- a/python-ansi2html.spec
+++ b/python-ansi2html.spec
@@ -2,11 +2,18 @@
%global with_python3 1
%endif
+# Define modern python2 macros for el6.
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
%global srcname ansi2html
Name: python-ansi2html
Version: 1.0.6
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Python module that converts text with ANSI color to HTML
Group: Development/Libraries
@@ -67,7 +74,7 @@ cp -a . %{py3dir}
%endif
%check
-%{__python} setup.py test
+%{__python2} setup.py test
%if 0%{?with_python3}
pushd %{py3dir}
@@ -76,7 +83,7 @@ popd
%endif
%build
-%{__python} setup.py build
+%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
@@ -93,13 +100,15 @@ mv %{buildroot}/%{_mandir}/man1/ansi2html.1 %{buildroot}/%{_mandir}/man1/python3
popd
%endif
-%{__python} setup.py install --skip-build --root=%{buildroot}
+# Note that this have to come after the py3 block so that the
+# _bindir/python3-ansi2html switch-a-roo can work.
+%{__python2} setup.py install --skip-build --root=%{buildroot}
%files
%doc LICENSE README.rst
-%{python_sitelib}/ansi2html
-%{python_sitelib}/ansi2html-%{version}-*
+%{python2_sitelib}/ansi2html
+%{python2_sitelib}/ansi2html-%{version}-*
%{_bindir}/ansi2html
%{_mandir}/man1/ansi2html*
@@ -114,6 +123,9 @@ popd
%changelog
+* Mon Oct 13 2014 Ralph Bean <rbean at redhat.com> - 1.0.6-5
+- Modernized python2 macros.
+
* Wed Aug 27 2014 Ralph Bean <rbean at redhat.com> - 1.0.6-4
- Added explicit dependency on python(3)-setuptools.
--
cgit v0.10.2
http://pkgs.fedoraproject.org/cgit/python-ansi2html.git/commit/?h=f20&id=8fd79d0f6406e8008d79533128ffc33d6e10e8e5
More information about the scm-commits
mailing list