%{!?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 # pygments is at 1.1.1 in rhel6 %if 0%{?rhel} == 6 %global skip_tests -pygments %endif %global srcname markdown2 Name: python-%{srcname} Version: 1.4.2 Release: 2%{?dist} Summary: A fast and complete Python implementation of Markdown Group: Development/Languages License: MIT URL: https://github.com/trentm/python-%{srcname}/ Source0: http://pypi.python.org/packages/source/m/%{srcname}/%{srcname}-%{version}.zip 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 / 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/ %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} %{__python} setup.py install -O1 --skip-build --root %{buildroot} # remove shebangs and fix permissions 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} %check cd test %{__python} test.py -- -knownfailure %{?skip_tests} %if 0%{?with_python3} pushd %{py3dir} cd test %{__python3} test.py -- -knownfailure %{?skip_tests} 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-2 - Skip pygments test on rhel6. * Sat May 19 2012 Thomas Moschny - 1.4.2-1 - Update to 1.4.2. - Build python3 subpackage. * Sat Mar 17 2012 Thomas Moschny - 1.1.1-2 - Skip pygments tests on rhel6. * Fri Mar 16 2012 Thomas Moschny - 1.1.1-1 - Update to 1.1.1. * Thu Jul 21 2011 Thomas Moschny - 1.0.1.19-1 - Update to 1.0.1.19. - Drop patch applied upstream. - Update project URL. - Update macros, use %%global. - Update %%doc. - Do not run tests known to fail. * Sat Jul 3 2010 Thomas Moschny - 1.0.1.17-1 - Update to 1.0.17. * Tue Dec 29 2009 Thomas Moschny - 1.0.1.16-2 - Patch for older pygments on rhel no longer needed, pygments has been updated in EPEL. * Fri Dec 18 2009 Thomas Moschny - 1.0.1.16-1 - Update to 1.0.1.16. * Thu Oct 8 2009 Thomas Moschny - 1.0.1.15-1 - Update to 1.0.1.15. Fixes three issues, two of them being security-related. * Wed Sep 2 2009 Thomas Moschny - 1.0.1.13-3 - Patch syntax_color test case for older pygments version on rhel. * Sun Jul 26 2009 Fedora Release Engineering - 1.0.1.13-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Sat Jul 11 2009 Thomas Moschny - 1.0.1.13-1 - Update to 1.0.1.13. * Thu Feb 26 2009 Fedora Release Engineering - 1.0.1.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 1.0.1.11-2 - Rebuild for Python 2.6 * Wed Oct 1 2008 Thomas Moschny - 1.0.1.11-1 - Update to 1.0.11, also fixes the syntax_color test for the latest Pygments (should fix FTBFS bug 465049). * Fri Sep 26 2008 Thomas Moschny - 1.0.1.10-1 - Update to 1.0.1.10. * Fri Sep 12 2008 Thomas Moschny - 1.0.1.9-1 - Update to 1.0.1.9. * Thu Sep 11 2008 Thomas Moschny - 1.0.1.8-1 - Update to 1.0.1.8. - Simplify the cmdline wrapper. * Tue Sep 9 2008 Thomas Moschny - 1.0.1.7-1 - New package.