e11fe99
%global github_name m2r
65ff8c3
%global commit 871d57941e74e29bb66ae6d65fa0517e6001f62a
e11fe99
%global shortcommit %(c=%{commit}; echo ${c:0:7})
e11fe99
%global desc M2R converts a markdown file including reST markups to a valid reST format.
e11fe99
e11fe99
Name:           python-%{github_name}
65ff8c3
Version:        0.1.6
65ff8c3
Release:        1.git%{shortcommit}%{?dist}
e11fe99
Summary:        Markdown to reStructuredText converter
e11fe99
e11fe99
License:        MIT
e11fe99
URL:            https://github.com/miyakogi/%{github_name}
e11fe99
Source0:        https://github.com/miyakogi/%{github_name}/archive/%{commit}/%{github_name}-%{commit}.tar.gz
e11fe99
e11fe99
BuildArch:      noarch
e11fe99
e11fe99
e11fe99
%description
e11fe99
%{desc}
e11fe99
e11fe99
e11fe99
%package -n python2-%{github_name}
e11fe99
BuildRequires:  python2-devel
e11fe99
BuildRequires:  python-docutils
e11fe99
BuildRequires:  python-mistune
e11fe99
BuildRequires:  python-pygments
e11fe99
BuildRequires:  python2-mock
e11fe99
Requires:       python-docutils
e11fe99
Requires:       python-mistune
e11fe99
Summary:        %{summary}
e11fe99
%{?python_provide:%python_provide python2-%{github_name}}
e11fe99
e11fe99
e11fe99
%description -n python2-%{github_name}
e11fe99
%{desc}
e11fe99
e11fe99
e11fe99
%package -n python3-%{github_name}
e11fe99
BuildRequires:  python3-devel
e11fe99
BuildRequires:  python3-docutils
e11fe99
BuildRequires:  python3-mistune
e11fe99
BuildRequires:  python3-pygments
e11fe99
BuildRequires:  python3-mock
e11fe99
Requires:       python3-docutils
e11fe99
Requires:       python3-mistune
e11fe99
Summary:        %{summary}
e11fe99
%{?python_provide:%python_provide python3-%{github_name}}
e11fe99
e11fe99
e11fe99
%description -n python3-%{github_name}
e11fe99
%{desc}
e11fe99
e11fe99
e11fe99
%prep
e11fe99
%setup -qn %{github_name}-%{commit}
e11fe99
e11fe99
# Remove upstream's egg-info
e11fe99
rm -rf %{github_name}.egg-info
e11fe99
e11fe99
# Remove shebang
e11fe99
sed -i '1{\@^#!/usr/bin/env python@d}' m2r.py
e11fe99
e11fe99
e11fe99
%build
e11fe99
%py2_build
e11fe99
%py3_build
e11fe99
e11fe99
e11fe99
%install
e11fe99
%py2_install
e11fe99
%py3_install
e11fe99
e11fe99
e11fe99
%check
e11fe99
PYTHONPATH=$(pwd) %{__python2} setup.py test -s tests
e11fe99
PYTHONPATH=$(pwd) %{__python3} setup.py test -s tests
e11fe99
e11fe99
e11fe99
%files -n python2-%{github_name}
e11fe99
%license LICENSE
e11fe99
%doc README.md
e11fe99
%{python2_sitelib}/%{github_name}.py{,c,o}
e11fe99
%{python2_sitelib}/%{github_name}-%{version}*-py%{python2_version}.egg-info
e11fe99
%exclude %{python2_sitelib}/tests
e11fe99
e11fe99
e11fe99
%files -n python3-%{github_name}
e11fe99
%license LICENSE
e11fe99
%doc README.md
e11fe99
%{_bindir}/m2r
e11fe99
%{python3_sitelib}/__pycache__/*
e11fe99
%{python3_sitelib}/%{github_name}.py
e11fe99
%{python3_sitelib}/%{github_name}-%{version}*-py%{python3_version}.egg-info
e11fe99
%exclude %{python3_sitelib}/tests
e11fe99
e11fe99
e11fe99
%changelog
65ff8c3
* Wed May 31 2017 Nikola Forró <nforro@redhat.com> - 0.1.6-1.git871d579
65ff8c3
- Update to 0.1.6
65ff8c3
  resolves: #1457165
65ff8c3
e11fe99
* Wed May 17 2017 Nikola Forró <nforro@redhat.com> - 0.1.5-2.git539a079
e11fe99
- Make image_link regex non-greedy
e11fe99
e11fe99
* Tue May 16 2017 Nikola Forró <nforro@redhat.com> - 0.1.5-1.git539a079
e11fe99
- Initial package