Blob Blame History Raw
%global pypi_name qtconsole

Name:		python-%{pypi_name}
Version:	4.2.1
Release:	6%{?dist}
Summary:	Jupyter Qt console

#license clarification issue opened with upstream
License:	BSD

BuildArch:	noarch
BuildRequires:	python-setuptools
BuildRequires:	python2-devel
BuildRequires:	python-sphinx
BuildRequires:	python-ipython-sphinx
BuildRequires:	python3-setuptools
BuildRequires:	python3-devel
BuildRequires:	python3-ipython-sphinx

BuildRequires:	desktop-file-utils

Qt-based console for Jupyter with support for rich media output

%package -n     python2-%{pypi_name}
Summary:	Jupyter Qt console
%{?python_provide:%python_provide python2-%{pypi_name}}
Requires:	python-traitlets
Requires:	python-jupyter_core
Requires:	python-jupyter-client >= 4.1
Requires:	python-pygments
Requires:	python-ipykernel >= 4.1
Requires:	python-setuptools

%description -n python2-%{pypi_name}
Qt-based console for Jupyter with support for rich media output

%package -n     python3-%{pypi_name}
Summary:	Jupyter Qt console
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires:	python3-traitlets
Requires:	python3-jupyter_core
Requires:	python3-jupyter-client >= 4.1
Requires:	python3-pygments
Requires:	python3-ipykernel >= 4.1
Requires:	python3-setuptools

%description -n python3-%{pypi_name}
Qt-based console for Jupyter with support for rich media output

%package -n python-%{pypi_name}-doc
Summary:	Documentation subpackage for qtconsole

%description -n python-%{pypi_name}-doc
Documentation for qtconsole

%autosetup -n %{pypi_name}-%{version}

# prepare desktop files
pushd examples
sed 's/jupyter qtconsole/jupyter-qtconsole-2/' jupyter-qtconsole.desktop > jupyter-qtconsole-2.desktop
sed 's/jupyter qtconsole/jupyter-qtconsole-3/' jupyter-qtconsole.desktop > jupyter-qtconsole-3.desktop


# generate html docs 
sphinx-build docs/source html

# fix file encoding and utf-8
sed -i 's/\r$//' html/objects.inv

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

# Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every install.
cp %{buildroot}/%{_bindir}/jupyter-qtconsole %{buildroot}/%{_bindir}/jupyter-qtconsole-3
ln -sf %{_bindir}/jupyter-qtconsole-3 %{buildroot}/%{_bindir}/jupyter-qtconsole-%{python3_version}
desktop-file-install --dir=%{buildroot}%{_datadir}/applications examples/jupyter-qtconsole-3.desktop

sed -i '1s=^#!/usr/bin/\(python\|env python\)[23]\?=#!%{__python2}=' %{buildroot}/%{_bindir}/jupyter-qtconsole
cp %{buildroot}/%{_bindir}/jupyter-qtconsole %{buildroot}/%{_bindir}/jupyter-qtconsole-2
ln -sf %{_bindir}/jupyter-qtconsole-2 %{buildroot}/%{_bindir}/jupyter-qtconsole-%{python2_version}
desktop-file-install --dir=%{buildroot}%{_datadir}/applications examples/jupyter-qtconsole-2.desktop

%files -n python2-%{pypi_name} 
%dir %{python2_sitelib}/%{pypi_name}/

%files -n python3-%{pypi_name} 
%dir %{python3_sitelib}/%{pypi_name}/

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

* Wed Feb 22 2017 Mukundan Ragavan <> - 4.2.1-6
- Fix python dependencies (py2 sub-package does not req py3)

* Sat Feb 11 2017 Fedora Release Engineering <> - 4.2.1-5
- Rebuilt for

* Sat Sep 24 2016 Mukundan Ragavan <> - 4.2.1-4
- Removed scripts; F25+ only

* Sat Sep 24 2016 Mukundan Ragavan <> - 4.2.1-3
- Added scripts for desktop database (fixes embarassing oversight!)

* Sat Sep 24 2016 Mukundan Ragavan <> - 4.2.1-2
- Fix typos in description
- Fix typos in summary
- Add BR: desktop-file-utils
- Add desktop files

* Fri Aug 12 2016 Mukundan Ragavan <> - 4.2.1-1
- Initial package.