File python-Markdown.spec of Package python-Markdown

#
# spec file for package python-Markdown
#
# 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-Markdown
Version:        2.6.8
Release:        0
Summary:        Python implementation of Markdown
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            http://packages.python.org/Markdown/
Source:         https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
BuildRequires:  %{python_module PyYAML}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module xml}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-xml
Requires(post):	update-alternatives
Requires(postun):	update-alternatives
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%ifpython2
# older python2 version provided the package in lowercase
Provides:       %{oldpython}-markdown = %{version}
Obsoletes:      %{oldpython}-markdown < %{version}
%endif

%python_subpackages

%description
This is a Python implementation of John Gruber's [Markdown][]. 
It is almost completely compliant with the reference implementation,
though there are a few known issues. See [Features][] for information 
on what exactly is supported and what is not. Additional features are 
supported by the [Available Extensions][].

%prep
%setup -q -n Markdown-%{version}
# Fix encoding
sed -i "s|\r$||" docs/release-2.2.0.txt

%build
%python_build

%install
%python_install
%fdupes %{buildroot}%{_prefix}

%python_clone -a %{buildroot}%{_bindir}/markdown_py

%check
%python_exec run-tests.py

%post
%python_install_alternative markdown_py

%postun
%python_uninstall_alternative markdown_py

%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE.md README.md docs/*
%python_alternative %{_bindir}/markdown_py
%{python_sitelib}/Markdown-%{version}-py%{python_version}.egg-info
%{python_sitelib}/markdown

%changelog
openSUSE Build Service is sponsored by