# # spec file for package python-CommonMark # # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-CommonMark Version: 0.7.3 Release: 0 Summary: Python parser for the CommonMark Markdown spec License: BSD-3-Clause Group: Development/Languages/Python Url: https://pypi.python.org/pypi/CommonMark Source: https://files.pythonhosted.org/packages/source/C/CommonMark/CommonMark-%{version}.tar.gz BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: %{python_module future} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} Requires: python-future BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch Provides: python-commonmark = %{version} Obsoletes: python-commonmark < %{version} Requires(post): update-alternatives Requires(preun): update-alternatives %python_subpackages %description Pure Python port of jgm’s stmd.js, a Markdown parser and renderer for the CommonMark specification, using only native modules. Once both this project and the CommonMark specification are stable we will release the first 1.0 version and attempt to keep up to date with changes in stmd.js. We are currently at the same development stage (actually a bit ahead because we have implemented HTML entity conversion and href URL escaping) as stmd.js. Since Python versions pre-3.4 use outdated (i.e. not HTML5 spec) entity conversion, I’ve converted the 3.4 implementation into a single file, entitytrans.py which so far seems to work (all tests pass on 2.7, 3.3, and 3.4). %package -n %{name}-doc Summary: Documentation for CommonMark Provides: python2-CommonMark-doc = %{version} Provides: python3-CommonMark-doc = %{version} %description -n %{name}-doc Documentation for Pure Python port of jgm’s stmd.js, a Markdown parser and renderer for the CommonMark specification, using only native modules. %prep %setup -q -n CommonMark-%{version} chmod -x LICENSE chmod -x README.rst sed -i "s/\r//g" LICENSE # find and remove unneeded shebangs find CommonMark -name "*.py" | xargs sed -i '1 {/^#!/ d}' %build %python_build %install %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %python_clone -a %{buildroot}%{_bindir}/cmark # Test broken due to encoding issue # %check # export LANG=en_US.UTF-8 # export PYTHONPATH=%{buildroot}%{python_sitelib} # python setup.py test %post %python_install_alternative cmark %preun %python_uninstall_alternative cmark %files %{python_files} %defattr(-,root,root,-) %doc README.rst LICENSE %python_alternative %{_bindir}/cmark %{python_sitelib}/CommonMark/ %{python_sitelib}/CommonMark-%{version}-py*.egg-info %files -n %{name}-doc %defattr(-,root,root,-) %doc spec.txt LICENSE %changelog