Blob Blame History Raw
%global pypi_name nbconvert

Name:           python-%{pypi_name}
Version:        5.3.1
Release:        5%{?dist}
Summary:        Converting Jupyter Notebooks

License:        BSD and MIT
URL:            http://jupyter.org
Source0:        https://files.pythonhosted.org/packages/source/n/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch:      noarch
 
BuildRequires:  python2-setuptools
BuildRequires:  python2-devel
BuildRequires:  python2-sphinx
 
BuildRequires:  python3-pandocfilters
BuildRequires:  python3-setuptools
BuildRequires:  python3-sphinx
BuildRequires:  python3-testpath
BuildRequires:  python3-devel

# for building docs
BuildRequires:  python3-nbsphinx
BuildRequires:  python3-ipython
BuildRequires:  python3-ipython-sphinx
BuildRequires:  pandoc

%description
The nbconvert tool, jupyter nbconvert, converts notebooks to various other 
formats via Jinja templates. The nbconvert tool allows you to convert an 
.ipynb notebook file into various static formats including HTML, LaTeX, 
PDF, Reveal JS, Markdown (md), ReStructured Text (rst) and executable script.

%package -n     python2-%{pypi_name}
Summary:        Converting Jupyter Notebooks
%{?python_provide:%python_provide python2-%{pypi_name}}
 
Requires:       python2-jinja2
Requires:       python2-pygments
Requires:       python2-traitlets
Requires:       python2-jupyter_core
Requires:       python2-nbformat
Requires:       python2-entrypoints
Requires:       python2-setuptools
Requires:       python2-testpath
Requires:       python2-pandocfilters
Requires:       python2-mistune
Requires:       python2-bleach
Requires:       pandoc

%description -n python2-%{pypi_name}

The nbconvert tool, jupyter nbconvert, converts notebooks to various other 
formats via Jinja templates. The nbconvert tool allows you to convert an 
.ipynb notebook file into various static formats including HTML, LaTeX, 
PDF, Reveal JS, Markdown (md), ReStructured Text (rst) and executable script.

%package -n     python3-%{pypi_name}
Summary:        Converting Jupyter Notebooks
%{?python_provide:%python_provide python3-%{pypi_name}}
 
Requires:       python3-jinja2
Requires:       python3-pygments
Requires:       python3-traitlets
Requires:       python3-jupyter_core
Requires:       python3-nbformat
Requires:       python3-entrypoints
Requires:       python3-setuptools
Requires:       python3-testpath
Requires:       python3-pandocfilters
Requires:       python3-mistune
Requires:       python3-bleach
Requires:       pandoc

# executables moved from py2 to py3
# https://bugzilla.redhat.com/show_bug.cgi?id=1410332
# Can be removed in Fedora 30
Conflicts:      python2-%{pypi_name} < 5.2.1-3

%description -n python3-%{pypi_name}

The nbconvert tool, jupyter nbconvert, converts notebooks to various other 
formats via Jinja templates. The nbconvert tool allows you to convert an 
.ipynb notebook file into various static formats including HTML, LaTeX, 
PDF, Reveal JS, Markdown (md), ReStructured Text (rst) and executable script.

%package -n python-%{pypi_name}-doc
Summary:        Documentation for nbconvert
%description -n python-%{pypi_name}-doc
Documentation for nbconvert

%prep
%autosetup -n %{pypi_name}-%{version}
rm -rf %{pypi_name}.egg-info

%build
%py2_build
%py3_build

# generate html docs 
sphinx-build-3 docs/source html

# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%install
%py2_install
rm %{buildroot}%{_bindir}/*

# fix permissions and shebangs
sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' %{buildroot}%{python2_sitelib}/%{pypi_name}/nbconvertapp.py
chmod 755 %{buildroot}%{python2_sitelib}/%{pypi_name}/nbconvertapp.py


%py3_install

# fix permissions and shebangs
sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' %{buildroot}%{python3_sitelib}/%{pypi_name}/nbconvertapp.py
chmod 755 %{buildroot}%{python3_sitelib}/%{pypi_name}/nbconvertapp.py


%files -n python2-%{pypi_name}
%license LICENSE
%doc docs/README.md
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%{python2_sitelib}/%{pypi_name}/

%files -n python3-%{pypi_name}
%license LICENSE
%doc docs/README.md
%{_bindir}/jupyter-nbconvert
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
%{python3_sitelib}/%{pypi_name}/

%files -n python-%{pypi_name}-doc
%doc html

%changelog
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Sat Jan 13 2018 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 5.3.1-4
- Add python-mistune, python-bleach and pandoc as dependencies

* Wed Jan 03 2018 Lumír Balhar <lbalhar@redhat.com> - 5.3.1-3
- Fix directory ownership in python subpackages

* Wed Dec 27 2017 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 5.3.1-2
- license file renamed to LICENSE (from copying.md)

* Wed Dec 27 2017 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 5.3.1-1
- Update to 5.3.1

* Mon Dec 11 2017 Iryna Shcherbina <ishcherb@redhat.com> - 5.2.1-5
- Fix ambiguous Python 2 dependency declarations
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Mon Oct 02 2017 Mukundan Ragavan <nonamedotc@gmail.com> - 5.2.1-4
- Fix requires (added pandocfilters and testpath)

* Fri Sep 01 2017 Miro Hrončok <mhroncok@redhat.com> - 5.2.1-3
- Move executables from py2 to py3 (#1410332)
- Add BRs to make the docs build

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

* Thu May 25 2017 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 5.2.1-1
- Update to 5.2.1

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

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

* Thu Nov 03 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 4.2.0-5
- Python dep chain fixed
- Fixes bug#1391124

* Wed Nov 02 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 4.2.0-4
- Fix pulling entire python{2,3} stack as deps
- Fixes bug#1391124

* Sun Oct 02 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 4.2.0-3
- Fix issues pointed out by rpmlint
- Fix license field

* Thu Aug 11 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 4.2.0-2
- Fix build errors

* Thu Aug 11 2016 Mukundan Ragavan <nonamedotc@gmail.com> - 4.2.0-1
- Initial package.