Blob Blame History Raw
%global pypi_name py-gfm
# Python 3 only for Fedora for now.
%if 0%{?rhel} >= 7
%global with_python3 1
%endif

%if 0%{?fedora} > 23
%global with_python2-markdown2 1
%endif

Name:           python-gfm
Version:        0.1.3
Release:        1%{?dist}
Summary:        Github-Flavored Markdown for Python-Markdown
License:        BSD
URL:            https://github.com/Zopieux/py-gfm
Source0:        https://files.pythonhosted.org/packages/source/%(n=%{pypi_name}; echo ${n:0:1})/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
# Missing LICENSE file in pypi package reported at https://github.com/Zopieux/py-gfm/issues/5
Source1:        https://github.com/Zopieux/py-gfm/blob/master/LICENSE

BuildArch:      noarch

BuildRequires:  python2-devel
%if 0%{with_python2-markdown2}
BuildRequires:  python2-markdown2
%else
BuildRequires:  python-markdown2
%endif
BuildRequires:  python2-setuptools
%if 0%{with python3}
BuildRequires:  python3-devel
BuildRequires:  python3-markdown2
BuildRequires:  python3-setuptools
%endif # if with_python3

%description
This is an implementation of GitHub-Flavored Markdown written as an extension
to the Python Markdown library. It aims for maximal compatibility with GitHub's
rendering.

%package -n python2-gfm
Summary:        %{summary}
%{?python_provide:%python_provide python2-gfm}
%if 0%{with_python2-markdown2}
Requires:  python2-markdown2
%else
Requires:  python-markdown2
%endif
%description -n python2-gfm
This is an implementation of GitHub-Flavored Markdown written as an extension
to the Python Markdown library. It aims for maximal compatibility with GitHub's
rendering.

%if 0%{with python3}
%package -n python3-gfm
Summary:        %{summary}
%{?python_provide:%python_provide python3-gfm}
Requires:  python3-markdown2
%description -n python3-gfm
This is an implementation of GitHub-Flavored Markdown written as an extension
to the Python Markdown library. It aims for maximal compatibility with GitHub's
rendering.
%endif # if with_python3

%prep
%setup -q -n %{pypi_name}-%{version}
cp %{SOURCE1} .

%build
%py2_build
%if 0%{with python3}
%py3_build
%endif # if with_python3

%install
%py2_install
%if %{with python3}
%py3_install
%endif # if with_python3

%check
%{__python2} setup.py test
%if 0%{with python3}
%{__python3} setup.py test
%endif # if with_python3

%files -n python2-gfm
%license LICENSE
%doc README.rst
%{python2_sitelib}/*

%if 0%{with python3}
%files -n python3-gfm
%license LICENSE
%doc README.rst
%{python3_sitelib}/*
%endif # if with_python3

%changelog
* Wed Aug 10 2016 Germano Massullo <germano.massullo@gmail.com> - 0.1.3-1
- First commit on Fedora's Git