[python-markdown] Update to 2.1.0. Fix rhel conditional. Binary has been renamed. Build python3 subpackage. Include do
Thomas Moschny
thm at fedoraproject.org
Sat Dec 17 14:38:11 UTC 2011
commit 2ff5e4af8eaae64f8d73a686cc913c9208d0e52f
Author: Thomas Moschny <thm at fedoraproject.org>
Date: Sat Dec 17 15:35:13 2011 +0100
Update to 2.1.0.
Fix rhel conditional.
Binary has been renamed.
Build python3 subpackage.
Include documentation in HTML instead of Markdown format.
Run tests.
.gitignore | 1 +
python-markdown.spec | 91 ++++++++++++++++++++++++++++++++++++++++++++++---
sources | 2 +-
3 files changed, 87 insertions(+), 7 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5229752..63c792a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
Markdown-2.0.3.tar.gz
+/Markdown-2.1.0.tar.gz
diff --git a/python-markdown.spec b/python-markdown.spec
index 86b0cfd..28595c5 100644
--- a/python-markdown.spec
+++ b/python-markdown.spec
@@ -1,10 +1,15 @@
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+
+%if 0%{?fedora} || 0%{?rhel} > 6
+%global with_python3 1
+%{!?python3_version: %global python3_version %(%{__python3} -c "import sys; sys.stdout.write(sys.version[:3])")}
+%endif
%define srcname Markdown
Name: python-markdown
-Version: 2.0.3
-Release: 4%{?dist}
+Version: 2.1.0
+Release: 1%{?dist}
Summary: Markdown implementation in Python
Group: Development/Languages
License: BSD
@@ -13,10 +18,17 @@ Source0: http://pypi.python.org/packages/source/M/%{srcname}/%{srcname}-%
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel
-%if 0%{?rhel} < 7
+BuildRequires: python-nose
+%if 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: python-elementtree
Requires: python-elementtree
%endif
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-nose
+# for converting before running the tests:
+BuildRequires: /usr/bin/2to3
+%endif # with_python3
%description
@@ -25,6 +37,19 @@ almost completely compliant with the reference implementation, though
there are a few known issues.
+%if 0%{?with_python3}
+%package -n python3-markdown
+Summary: Markdown implementation in Python
+Group: Development/Languages
+
+
+%description -n python3-markdown
+This is a Python implementation of John Gruber's Markdown. It is
+almost completely compliant with the reference implementation, though
+there are a few known issues.
+%endif # with_python3
+
+
%prep
%setup -q -n %{srcname}-%{version}
@@ -32,15 +57,51 @@ there are a few known issues.
find markdown -type f -name '*.py' \
-exec sed -i -e '/^#!/{1D}' {} \;
+%if 0%{?with_python3}
+cp -a . %{py3dir}
+%endif # with_python3
+
%build
%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
%install
rm -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+# rename binary
+mv %{buildroot}%{_bindir}/markdown_py{,-%{python_version}}
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
+
+# rename binary
+mv %{buildroot}%{_bindir}/markdown_py{,-%{python3_version}}
+%endif # with_python3
+
+# 2.X binary is called by default for now
+ln -s markdown_py-%{python_version} %{buildroot}%{_bindir}/markdown_py
+
+
+%check
+./run-tests.py
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+2to3 -d -w -n markdown tests run-tests.py > /dev/null
+./run-tests.py
+popd
+%endif # with_python3
+
%clean
rm -rf %{buildroot}
@@ -48,12 +109,30 @@ rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
-%doc docs/*
+%doc build/docs/*
%{python_sitelib}/*
-%{_bindir}/markdown
+%{_bindir}/markdown_py
+%{_bindir}/markdown_py-%{python_version}
+
+
+%if 0%{?with_python3}
+%files -n python3-markdown
+%defattr(-,root,root,-)
+%doc build/docs/*
+%{python3_sitelib}/*
+%{_bindir}/markdown_py-%{python3_version}
+%endif # with_python3
%changelog
+* Sat Dec 17 2011 Thomas Moschny <thomas.moschny at gmx.de> - 2.1.0-1
+- Update to 2.1.0.
+- Fix rhel conditional.
+- Binary has been renamed.
+- Build python3 subpackage.
+- Include documentation in HTML instead of Markdown format.
+- Run tests.
+
* Wed Sep 07 2011 Jesse Keating <jkeating at redhat.com> - 2.0.3-4
- Set a version in the rhel macro
diff --git a/sources b/sources
index 2c2d985..cd1d7aa 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-751e8055be2433dfd1a82e0fb1b12f13 Markdown-2.0.3.tar.gz
+be5796ec9210865e7df5d83f208a4f7f Markdown-2.1.0.tar.gz
More information about the scm-commits
mailing list