Blob Blame Raw
%global pkgname m2r
%global desc M2R converts a markdown file including reST markups to a valid reST format.

Name:           python-%{pkgname}
Version:        0.1.10
Release:        2%{?dist}
Summary:        Markdown to reStructuredText converter

License:        MIT
URL:            https://github.com/miyakogi/%{pkgname}
Source0:        https://github.com/miyakogi/%{pkgname}/archive/v%{version}.tar.gz

BuildArch:      noarch


%description
%{desc}


%package -n python2-%{pkgname}
BuildRequires:  python2-devel
BuildRequires:  python-docutils
BuildRequires:  python-mistune
BuildRequires:  python-pygments
BuildRequires:  python2-mock
Requires:       python-docutils
Requires:       python-mistune
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{pkgname}}


%description -n python2-%{pkgname}
%{desc}


%package -n python3-%{pkgname}
BuildRequires:  python3-devel
BuildRequires:  python3-docutils
BuildRequires:  python3-mistune
BuildRequires:  python3-pygments
BuildRequires:  python3-mock
Requires:       python3-docutils
Requires:       python3-mistune
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{pkgname}}


%description -n python3-%{pkgname}
%{desc}


%prep
%setup -qn %{pkgname}-%{version}

# Remove upstream's egg-info
rm -rf %{pkgname}.egg-info

# Remove shebang
sed -i '1{\@^#!/usr/bin/env python@d}' m2r.py


%build
%py2_build
%py3_build


%install
%py2_install
%py3_install


%check
PYTHONPATH=$(pwd) %{__python2} setup.py test -s tests
PYTHONPATH=$(pwd) %{__python3} setup.py test -s tests


%files -n python2-%{pkgname}
%license LICENSE
%doc README.md
%{python2_sitelib}/%{pkgname}.py{,c,o}
%{python2_sitelib}/%{pkgname}-%{version}*-py%{python2_version}.egg-info
%exclude %{python2_sitelib}/tests


%files -n python3-%{pkgname}
%license LICENSE
%doc README.md
%{_bindir}/m2r
%{python3_sitelib}/__pycache__/*
%{python3_sitelib}/%{pkgname}.py
%{python3_sitelib}/%{pkgname}-%{version}*-py%{python3_version}.egg-info
%exclude %{python3_sitelib}/tests


%changelog
* Fri Aug 25 2017 Nikola Forró <nforro@redhat.com> - 0.1.10-2
- Add missing dist tag

* Tue Aug 15 2017 Nikola Forró <nforro@redhat.com> - 0.1.10-1
- Update to 0.1.10
- Switch to release versioning
  resolves: #1480575

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.7-2.git8e4ce37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu Jul 20 2017 Nikola Forró <nforro@redhat.com> - 0.1.7-1.git8e4ce37
- Update to 0.1.7
  resolves: #1473289

* Wed May 31 2017 Nikola Forró <nforro@redhat.com> - 0.1.6-1.git871d579
- Update to 0.1.6
  resolves: #1457165

* Wed May 17 2017 Nikola Forró <nforro@redhat.com> - 0.1.5-2.git539a079
- Make image_link regex non-greedy

* Tue May 16 2017 Nikola Forró <nforro@redhat.com> - 0.1.5-1.git539a079
- Initial package