2017-04-06 17:27:54 +00:00
#
# spec file for package python-recommonmark
#
2019-01-19 10:39:35 +00:00
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
2017-04-06 17:27:54 +00:00
#
# 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.
2018-12-04 13:58:57 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-04-06 17:27:54 +00:00
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
2017-05-06 04:26:08 +00:00
%define oldpython python
2017-04-06 17:27:54 +00:00
Name : python-recommonmark
2019-01-19 10:39:35 +00:00
Version : 0.5.0
2017-04-06 17:27:54 +00:00
Release : 0
Summary : Python docutils-compatibility bridge to CommonMark
License : MIT
Group : Development/Languages/Python
2018-12-07 10:18:17 +00:00
URL : https://github.com/rtfd/recommonmark
2017-04-06 17:27:54 +00:00
Source0 : https://files.pythonhosted.org/packages/source/r/recommonmark/recommonmark-%{version} .tar.gz
Source1 : https://raw.githubusercontent.com/rtfd/recommonmark/master/license.md
2017-07-27 16:26:01 +00:00
BuildRequires : %{python_module setuptools}
BuildRequires : fdupes
BuildRequires : python-rpm-macros
2019-01-19 10:39:35 +00:00
# SECTION tests
#BuildRequires: %%{python_module CommonMark >= 0.7.3}
#BuildRequires: %%{python_module Sphinx >= 1.3.1}
#BuildRequires: %%{python_module docutils >= 0.11}
# /SECTION tests
Requires : python-CommonMark >= 0.7.3
Requires : python-Sphinx >= 1.3.1
Requires : python-docutils >= 0.11
2018-12-07 10:18:17 +00:00
Requires(post) : update-alternatives
Requires(preun) : update-alternatives
Provides : python-reCommonMark = %{version}
Obsoletes : python-reCommonMark < %{version}
BuildArch : noarch
2017-05-06 04:26:08 +00:00
%if python2
Obsoletes : %{oldpython} -reCommonMark < %{version}
Provides : %{oldpython} -reCommonMark = %{version}
%endif
2017-04-06 17:27:54 +00:00
%python_subpackages
%description
A python docutils-compatibility bridge to CommonMark.
This allows you to write CommonMark inside of Docutils & Sphinx projects.
Documentation is available on Read the Docs:
http://recommonmark.readthedocs.org
%prep
%setup -q -n recommonmark-%{version}
# Remove upstream's egg-info
rm -rf %{pypi_name} .egg-info
#Add missing license and readme
cp -a %{SOURCE1} .
# find and remove unneeded shebangs
find recommonmark -name " * . p y " | xargs sed -i '1 {/^#!/ d}'
2019-01-19 10:39:35 +00:00
sed -i 's/from commonmark import Parser/from CommonMark import Parser/' recommonmark/parser.py
2017-04-06 17:27:54 +00:00
%build
%python_build
%install
%python_install
2018-12-07 10:18:17 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2017-04-06 17:27:54 +00:00
%python_clone -a %{buildroot} %{_bindir} /cm2html
%python_clone -a %{buildroot} %{_bindir} /cm2latex
%python_clone -a %{buildroot} %{_bindir} /cm2man
%python_clone -a %{buildroot} %{_bindir} /cm2pseudoxml
%python_clone -a %{buildroot} %{_bindir} /cm2xetex
%python_clone -a %{buildroot} %{_bindir} /cm2xml
2019-01-19 10:39:35 +00:00
# The tests in the tarball are missing all testdata, fixed in the next version: https://github.com/rtfd/recommonmark/commit/8e02e8309a011a7592d6b88c9a9560667964ffab
#%%check
#%%python_exec setup.py test
2017-04-06 17:27:54 +00:00
%post
%{python_install_alternative cm2man cm2latex cm2xetex cm2pseudoxml cm2html cm2xml}
%preun
%python_uninstall_alternative cm2man
%files %{python_files}
2018-12-07 10:18:17 +00:00
%license license.md
2017-04-06 17:27:54 +00:00
%python_alternative %{_bindir} /cm2html
%python_alternative %{_bindir} /cm2latex
%python_alternative %{_bindir} /cm2man
%python_alternative %{_bindir} /cm2pseudoxml
%python_alternative %{_bindir} /cm2xetex
%python_alternative %{_bindir} /cm2xml
%{python_sitelib} /recommonmark/
%{python_sitelib} /recommonmark-%{version} -py*.egg-info
2019-01-19 10:39:35 +00:00
%doc README.md
2017-04-06 17:27:54 +00:00
%changelog