From b248d0f66ff7c10178ea26fdf98a4c798ed872a6 Mon Sep 17 00:00:00 2001 From: Thomas Moschny Date: May 19 2012 12:35:12 +0000 Subject: Update to 1.4.2. - Build python3 subpackage. --- diff --git a/.gitignore b/.gitignore index 5a28e66..caf2d4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ markdown2-1.0.1.17.zip /markdown2-1.0.1.19.zip /markdown2-1.1.1.zip +/markdown2-1.4.2.zip diff --git a/python-markdown2.spec b/python-markdown2.spec index 69d7a9d..21dc122 100644 --- a/python-markdown2.spec +++ b/python-markdown2.spec @@ -1,11 +1,14 @@ -%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5) -%{!?python_sitelib: %global 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 %global srcname markdown2 Name: python-%{srcname} -Version: 1.1.1 +Version: 1.4.2 Release: 1%{?dist} Summary: A fast and complete Python implementation of Markdown Group: Development/Languages @@ -16,6 +19,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel BuildRequires: python-pygments +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-pygments +%endif # with_python3 + %description Markdown is a text-to-HTML filter; it translates an easy-to-read / @@ -30,13 +38,43 @@ For information about markdown itself, see http://daringfireball.net/projects/markdown/ +%if 0%{?with_python3} +%package -n python3-markdown2 +Summary: A fast and complete Python implementation of Markdown +Group: Development/Languages + + +%description -n python3-markdown2 +Markdown is a text-to-HTML filter; it translates an easy-to-read / +easy-to-write structured text format into HTML. Markdown's text format +is most similar to that of plain text email, and supports features +such as headers, emphasis, code blocks, blockquotes, and links. + +This is a fast and complete Python implementation of the Markdown +spec. + +For information about markdown itself, see +http://daringfireball.net/projects/markdown/ +%endif # with_python3 + + %prep %setup0 -q -n %{srcname}-%{version} +%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} @@ -47,6 +85,26 @@ find %{buildroot}%{python_sitelib} \( -name '*.py' -o -name 'py.*' \) \ -exec sed -i '1{/^#!/d}' {} \; \ -exec chmod u=rw,go=r {} \; +# rename binary +mv %{buildroot}%{_bindir}/markdown2{,-%{python_version}} + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install -O1 --skip-build --root %{buildroot} + +# remove shebangs and fix permissions +find %{buildroot}%{python3_sitelib} \( -name '*.py' -o -name 'py.*' \) \ + -exec sed -i '1{/^#!/d}' {} \; \ + -exec chmod u=rw,go=r {} \; + +# rename binary +mv %{buildroot}%{_bindir}/markdown2{,-%{python3_version}} +popd +%endif # with_python3 + +# 2.X binary is called by default for now +ln -s markdown2-%{python_version} %{buildroot}%{_bindir}/markdown2 + %clean rm -rf %{buildroot} @@ -56,15 +114,36 @@ rm -rf %{buildroot} cd test %{__python} test.py -- -knownfailure +%if 0%{?with_python3} +pushd %{py3dir} +cd test +%{__python3} test.py -- -knownfailure +popd +%endif # with_python3 + %files %defattr(-,root,root,-) %doc CHANGES.md CONTRIBUTORS.txt LICENSE.txt TODO.txt %{python_sitelib}/* %{_bindir}/markdown2 +%{_bindir}/markdown2-%{python_version} + + +%if 0%{?with_python3} +%files -n python3-markdown2 +%defattr(-,root,root,-) +%doc CHANGES.md CONTRIBUTORS.txt LICENSE.txt TODO.txt +%{python3_sitelib}/* +%{_bindir}/markdown2-%{python3_version} +%endif # with_python3 %changelog +* Sat May 19 2012 Thomas Moschny - 1.4.2-1 +- Update to 1.4.2. +- Build python3 subpackage. + * Fri Mar 16 2012 Thomas Moschny - 1.1.1-1 - Update to 1.1.1. diff --git a/sources b/sources index 9ba9ee5..5c7df9c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -2b25f16a32c80da5b2c0431cfa49bfc8 markdown2-1.1.1.zip +7e7a49ff11216b822faca8a4cb75ef2e markdown2-1.4.2.zip