## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Created by pyp2rpm-2.0.0

Name:           python-pypandoc
Version:        1.8.1
Release:        %autorelease
Summary:        Thin wrapper for pandoc

License:        MIT
URL:            https://github.com/bebraw/pypandoc
Source0:        https://files.pythonhosted.org/packages/source/p/pypandoc/pypandoc-%{version}.tar.gz
BuildArch:      noarch

# for tests
BuildRequires:  pandoc
BuildRequires:  texlive-scheme-basic
BuildRequires:  texlive-collection-fontsrecommended
BuildRequires:  tex(ecrm1000.tfm)

BuildRequires:  python%{python3_pkgversion}-devel
BuildRequires:  python%{python3_pkgversion}-setuptools
BuildRequires:  python%{python3_pkgversion}-pip
BuildRequires:  python%{python3_pkgversion}-wheel

%global _description %{expand:
pypandoc provides a thin Python wrapper for pandoc, a universal
document converter, allowing parsing and conversion of
pandoc-formatted text.}

%description %_description

%package -n     python%{python3_pkgversion}-pypandoc
Summary:        %{summary}
%{?python_provide:%python_provide python%{python3_pkgversion}-pypandoc}
Requires:       pandoc
%if 0%{?fedora} || 0%{?rhel} >= 8
Recommends:     texlive-scheme-basic
Recommends:     texlive-collection-fontsrecommended
%endif

%description -n python%{python3_pkgversion}-pypandoc  %_description

%prep
%autosetup -n pypandoc-%{version}

# Upstream pins pip and wheel in install_requires, but they're not needed at runtime
# https://github.com/bebraw/pypandoc/commit/c91c6d6fd23fb133a3676bce7af2a710ae7990d8
sed -Ei -e "s/(, )?'pip>=[^']+'//" -e "s/(, )?'wheel>=[^']+'//" setup.py

%build
%py3_build

%install
%py3_install

%check
# Old pandoc on EL7, no docx, no twiki
%if 0%{?rhel} && 0%{?rhel} <= 7
sed -i -e '/twiki/d' tests.py
%endif

# Disable test that requires network
sed -i -r 's/test_basic_conversion_from_http_url/_disabled_\0/' tests.py

# https://github.com/NicklasTegner/pypandoc/issues/277
sed -i -r 's/test_basic_conversion_from_file_pattern/_disabled_\0/' tests.py

%python3 tests.py

%global _docdir_fmt %{name}

%files -n python%{python3_pkgversion}-pypandoc
%license LICENSE
%doc README.md examples/
%{python3_sitelib}/pypandoc
%{python3_sitelib}/pypandoc-%{version}-py%{python3_version}.egg-info

%changelog
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> 1.8.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Tue Aug 16 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> 1.8.1-1
- Version 1.8.1 (rhbz#2089345)

* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> 1.8-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> 1.8-2
- Rebuilt for Python 3.11

* Thu May 12 2022 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> 1.8-1
- Version 1.8 (rhbz#2083944)

* Mon Apr 04 2022 Nick Black <dankamongmen@gmail.com> 1.7.5-1
- new upstream 1.7.5

* Mon Mar 21 2022 Nick Black <dankamongmen@gmail.com> 1.7.4-1
- new upstream 1.7.4

* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 1.7.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Fri Dec 17 2021 Nick Black <dankamongmen@gmail.com> 1.7.2-1
- new upstream 1.7.2

* Sun Sep 12 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> 1.6.4-1
- Version 1.6.4 (#2003420)

* Fri Aug 20 2021 Nick Black <dankamongmen@gmail.com> 1.6.3-2
- pandoc-citeproc has been deprecated in favor of citeproc

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.5-5
- Rebuilt for Python 3.10

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.5-2
- Rebuilt for Python 3.9

* Mon May 04 2020 Orion Poplawski <orion@nwra.com> - 1.5-1
- Update to 1.5

* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Nov 14 2019 Miro Hrončok <mhroncok@redhat.com> - 1.4-11
- Subpackage python2-pypandoc has been removed
  See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal

* Mon Sep 02 2019 Miro Hrončok <mhroncok@redhat.com> - 1.4-10
- Drop unneeded runtime dependency on pip and wheel

* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.4-9
- Rebuilt for Python 3.8

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4-6
- Drop explicit locale setting
  See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.4-4
- Rebuilt for Python 3.7

* Mon Mar 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 1.4-3
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Mar 15 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4-2
- Disable tests that require network and/or are incompatible with pandoc-2 (#1556255)

* Wed Feb 14 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.4-1
- Update to latest version

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

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

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.3.3-3
- Rebuild for Python 3.6

* Tue Nov 29 2016 Orion Poplawski <orion@cora.nwra.com> - 1.3.3-2
- Also exclude test_convert_with_custom_writer with old pandoc

* Mon Nov 28 2016 Orion Poplawski <orion@cora.nwra.com> - 1.3.3-1
- Update to 1.3.3

* Mon Nov 28 2016 Orion Poplawski <orion@cora.nwra.com> - 1.1.3-3
- Enable EPEL builds

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.3-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Apr 07 2016 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.1.3-1
- Initial package.