5aff8a5
%global pypi_name qtconsole
5aff8a5
5aff8a5
Name:		python-%{pypi_name}
5aff8a5
Version:	4.2.1
5aff8a5
Release:	4%{?dist}
5aff8a5
Summary:	Jupyter Qt console
5aff8a5
5aff8a5
#license clarification issue opened with upstream
5aff8a5
# https://github.com/jupyter/qtconsole/issues/142
5aff8a5
License:	BSD
5aff8a5
5aff8a5
URL:		http://jupyter.org
5aff8a5
Source0:	https://files.pythonhosted.org/packages/source/q/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
5aff8a5
BuildArch:	noarch
5aff8a5
 
5aff8a5
BuildRequires:	python-setuptools
5aff8a5
BuildRequires:	python2-devel
5aff8a5
BuildRequires:	python-sphinx
5aff8a5
BuildRequires:	python-ipython-sphinx
5aff8a5
 
5aff8a5
BuildRequires:	python3-setuptools
5aff8a5
BuildRequires:	python3-devel
5aff8a5
BuildRequires:	python3-ipython-sphinx
5aff8a5
5aff8a5
BuildRequires:	desktop-file-utils
5aff8a5
5aff8a5
%description
5aff8a5
Qt-based console for Jupyter with support for rich media output
5aff8a5
5aff8a5
%package -n     python2-%{pypi_name}
5aff8a5
Summary:	Jupyter Qt console
5aff8a5
%{?python_provide:%python_provide python2-%{pypi_name}}
5aff8a5
 
5aff8a5
Requires:	python-traitlets
5aff8a5
Requires:	python-jupyter_core
5aff8a5
Requires:	python-jupyter-client >= 4.1
5aff8a5
Requires:	python-pygments
5aff8a5
Requires:	python-ipykernel >= 4.1
5aff8a5
Requires:	python-setuptools
5aff8a5
5aff8a5
5aff8a5
%description -n python2-%{pypi_name}
5aff8a5
Qt-based console for Jupyter with support for rich media output
5aff8a5
5aff8a5
%package -n     python3-%{pypi_name}
5aff8a5
Summary:	Jupyter Qt console
5aff8a5
%{?python_provide:%python_provide python3-%{pypi_name}}
5aff8a5
 
5aff8a5
Requires:	python3-traitlets
5aff8a5
Requires:	python3-jupyter_core
5aff8a5
Requires:	python3-jupyter-client >= 4.1
5aff8a5
Requires:	python3-pygments
5aff8a5
Requires:	python3-ipykernel >= 4.1
5aff8a5
Requires:	python3-setuptools
5aff8a5
5aff8a5
5aff8a5
%description -n python3-%{pypi_name}
5aff8a5
Qt-based console for Jupyter with support for rich media output
5aff8a5
5aff8a5
%package -n python-%{pypi_name}-doc
5aff8a5
Summary:	Documentation subpackage for qtconsole
5aff8a5
5aff8a5
%description -n python-%{pypi_name}-doc
5aff8a5
Documentation for qtconsole
5aff8a5
5aff8a5
%prep
5aff8a5
%autosetup -n %{pypi_name}-%{version}
5aff8a5
5aff8a5
# prepare desktop files
5aff8a5
pushd examples
5aff8a5
sed 's/jupyter qtconsole/jupyter-qtconsole-2/' jupyter-qtconsole.desktop > jupyter-qtconsole-2.desktop
5aff8a5
sed 's/jupyter qtconsole/jupyter-qtconsole-3/' jupyter-qtconsole.desktop > jupyter-qtconsole-3.desktop
5aff8a5
popd
5aff8a5
5aff8a5
%build
5aff8a5
%py2_build
5aff8a5
%py3_build
5aff8a5
5aff8a5
# generate html docs 
5aff8a5
sphinx-build docs/source html
5aff8a5
5aff8a5
# fix file encoding and utf-8
5aff8a5
sed -i 's/\r$//' html/objects.inv
5aff8a5
5aff8a5
5aff8a5
# remove the sphinx-build leftovers
5aff8a5
rm -rf html/.{doctrees,buildinfo}
5aff8a5
5aff8a5
%install
5aff8a5
# Must do the subpackages' install first because the scripts in /usr/bin are
5aff8a5
# overwritten with every setup.py install.
5aff8a5
%py3_install
5aff8a5
cp %{buildroot}/%{_bindir}/jupyter-qtconsole %{buildroot}/%{_bindir}/jupyter-qtconsole-3
5aff8a5
ln -sf %{_bindir}/jupyter-qtconsole-3 %{buildroot}/%{_bindir}/jupyter-qtconsole-%{python3_version}
5aff8a5
desktop-file-install --dir=%{buildroot}%{_datadir}/applications examples/jupyter-qtconsole-3.desktop
5aff8a5
5aff8a5
%py2_install
5aff8a5
cp %{buildroot}/%{_bindir}/jupyter-qtconsole %{buildroot}/%{_bindir}/jupyter-qtconsole-2
5aff8a5
ln -sf %{_bindir}/jupyter-qtconsole-2 %{buildroot}/%{_bindir}/jupyter-qtconsole-%{python2_version}
5aff8a5
desktop-file-install --dir=%{buildroot}%{_datadir}/applications examples/jupyter-qtconsole-2.desktop
5aff8a5
5aff8a5
%files -n python2-%{pypi_name} 
5aff8a5
%license COPYING.md
5aff8a5
%doc README.md
5aff8a5
%{_bindir}/jupyter-qtconsole
5aff8a5
%{_bindir}/jupyter-qtconsole-2
5aff8a5
%{_bindir}/jupyter-qtconsole-%{python2_version}
5aff8a5
%{_datadir}/applications/jupyter-qtconsole-2.desktop
5aff8a5
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
5aff8a5
%{python2_sitelib}/%{pypi_name}/*
5aff8a5
%dir %{python2_sitelib}/%{pypi_name}/
5aff8a5
5aff8a5
%files -n python3-%{pypi_name} 
5aff8a5
%license COPYING.md
5aff8a5
%doc README.md
5aff8a5
%{_bindir}/jupyter-qtconsole-3
5aff8a5
%{_bindir}/jupyter-qtconsole-%{python3_version}
5aff8a5
%{_datadir}/applications/jupyter-qtconsole-3.desktop
5aff8a5
%{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info
5aff8a5
%{python3_sitelib}/%{pypi_name}/*
5aff8a5
%dir %{python3_sitelib}/%{pypi_name}/
5aff8a5
5aff8a5
%files -n python-%{pypi_name}-doc
5aff8a5
%doc html 
5aff8a5
5aff8a5
%changelog
5aff8a5
* Sat Sep 24 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 4.2.1-4
5aff8a5
- Removed scripts; F25+ only
5aff8a5
5aff8a5
* Sat Sep 24 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 4.2.1-3
5aff8a5
- Added scripts for desktop database (fixes embarassing oversight!)
5aff8a5
5aff8a5
* Sat Sep 24 2016 Mukundan Ragavan <nonamedotc@fedoraproject.org> - 4.2.1-2
5aff8a5
- Fix typos in description
5aff8a5
- Fix typos in summary
5aff8a5
- Add BR: desktop-file-utils
5aff8a5
- Add desktop files
5aff8a5
5aff8a5
* Fri Aug 12 2016 Mukundan Ragavan <nonamedotc@gmail.com> - 4.2.1-1
5aff8a5
- Initial package.