From 02c8379a5575099c0e7d8bd10da9fe131bcbad75 Mon Sep 17 00:00:00 2001 From: Julien Enselme Date: Sat, 5 Dec 2015 20:06:44 +0100 Subject: [PATCH] Initial import (#1288453) --- .gitignore | 1 + python-CommonMark.spec | 109 +++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 111 insertions(+) create mode 100644 python-CommonMark.spec diff --git a/.gitignore b/.gitignore index e69de29..c96f6f6 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/CommonMark-0.5.4.tar.gz diff --git a/python-CommonMark.spec b/python-CommonMark.spec new file mode 100644 index 0000000..de47734 --- /dev/null +++ b/python-CommonMark.spec @@ -0,0 +1,109 @@ +%global pypi_name CommonMark +%global desc 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). + +Name: python-%{pypi_name} +Version: 0.5.4 +Release: 3%{?dist} +Summary: Python parser for the CommonMark Markdown spec + +License: BSD +URL: https://pypi.python.org/pypi/%{pypi_name} +Source0: https://pypi.python.org/packages/source/C/%{pypi_name}/%{pypi_name}-%{version}.tar.gz + +BuildArch: noarch + +%description +%{desc} + +%package -n python2-%{pypi_name} +BuildRequires: python2-devel +Suggests: python-CommonMark-doc +Summary: %{summary} +%{?python_provide:%python_provide python2-%{pypi_name}} + +%description -n python2-%{pypi_name} +%{desc} + + +%package doc +Summary: Documentation for python-%{pypi_name} + +%description doc +%{desc} + +Documentation package. + + +%package -n python3-%{pypi_name} +BuildRequires: python3-devel +Suggests: python-CommonMark-doc +Summary: %{summary} +%{?python_provide:%python_provide python3-%{pypi_name}} + +%description -n python3-%{pypi_name} +%{desc} + + +%prep +%setup -qn %{pypi_name}-%{version} +chmod -x LICENSE +chmod -x README.md +sed -i '1{\@^#!/usr/bin/env python@d}' CommonMark/CommonMark.py + + + +%build +%py2_build +%py3_build + + +%install +%py2_install +%py3_install + +# correct shebang +sed -i 's@^#!/usr/bin/python2@#!%{__python3}@' %{buildroot}%{_bindir}/cmark.py + + +%check +PYTHONPATH=$(pwd) %{__python2} CommonMark/test/test-CommonMark.py -np +PYTHONPATH=$(pwd) %{__python3} CommonMark/test/test-CommonMark.py -np + + +%files -n python2-%{pypi_name} +%license LICENSE +%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info +%{python2_sitelib}/%{pypi_name}/ + +%files -n python3-%{pypi_name} +%license LICENSE +%{_bindir}/cmark.py +%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info +%{python3_sitelib}/%{pypi_name}/ + +%files doc +%license LICENSE +%doc README.md docs/* + + +%changelog +* Sat Dec 5 2015 Julien Enselme - 0.5.4-3 +- Use only one doc package. +- Use %%summary to avoid summary repetition. +- Use %%__python3 macro to fix shebang. + +* Fri Dec 4 2015 Julien Enselme - 0.5.4-2 +- Correct shebang of cmark.py (/usr/bin/python2 -> /usr/bin/python3) +- Add doc packages. + +* Fri Dec 4 2015 Julien Enselme - 0.5.4-1 +- Inital package diff --git a/sources b/sources index e69de29..fbc4dec 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +8eaa7602f8086344ae9027d9a7b1d4b9 CommonMark-0.5.4.tar.gz