15
0
Files
python-CommonMark/python-CommonMark.spec

128 lines
4.4 KiB
RPMSpec
Raw Normal View History

#
# 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-%{**}}
%define oldpython python
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
%ifpython2
Obsoletes: %{oldpython}-commonmark < %{version}
Provides: %{oldpython}-commonmark = %{version}
%endif
%ifpython3
Provides: python3-commonmark = %{version}
Obsoletes: python3-commonmark < %{version}
%endif
%python_subpackages
%description
Pure Python port of jgms 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,
Ive 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: %{python_module CommonMark-doc = %{version}}
%description -n %{name}-doc
Documentation for Pure Python port of jgms stmd.js, a Markdown parser and
renderer for the CommonMark specification, using only native modules.
%package -n cmark-python
Summary: CommonMark parsing and rendering program in python
Requires: pyython3-CommonMark = %{version}
Conflicts: cmark
%description -n cmark-python
Pure Python port of jgms 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,
Ive 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).
This package provides the "cmark" executable, to avoid conflicts with other
implementations.
%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}
# Test broken due to encoding issue
# %check
# export LANG=en_US.UTF-8
# export PYTHONPATH=%{buildroot}%{python_sitelib}
# python setup.py test
%files %{python_files}
%defattr(-,root,root,-)
%doc README.rst LICENSE
%{python_sitelib}/CommonMark/
%{python_sitelib}/CommonMark-%{version}-py*.egg-info
%files -n %{name}-doc
%defattr(-,root,root,-)
%doc spec.txt LICENSE
%files -n cmark-python
%defattr(-,root,root,-)
%doc spec.txt LICENSE
%{_bindir}/cmark
%changelog