File python-jupyter_ipython-doc.spec of Package python-jupyter_ipython

# spec file for package python-jupyter_ipython-doc
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

# This package has to be kept separate from the main package to avoid
# dependency loops with most of the core jupyter packages.
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define         oldpython python
Name:           python-jupyter_ipython-doc
Version:        7.4.0
Release:        0
Summary:        Documentation for python3-jupyter_ipython
License:        BSD-3-Clause
Group:          Documentation/Other
# Please make sure you update the documentation files at every release
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
BuildRequires:  unzip
Provides:       %{oldpython}-jupyter_ipython-doc-html = %{version}
Provides:       %{oldpython}-jupyter_ipython-doc-pdf = %{version}
Obsoletes:      %{oldpython}-jupyter_ipython-doc-html < %{version}
Obsoletes:      %{oldpython}-jupyter_ipython-doc-pdf < %{version}
Provides:       python-jupyter_ipython-doc = %{version}
Provides:       python-jupyter_ipython-doc-html = %{version}
Provides:       python-jupyter_ipython-doc-pdf = %{version}
Obsoletes:      python-jupyter_ipython-doc < %{version}
Obsoletes:      python-jupyter_ipython-doc-html < %{version}
Obsoletes:      python-jupyter_ipython-doc-pdf < %{version}
BuildArch:      noarch
# SECTION test requirements
BuildRequires:  python3-jupyter_ipython-iptest = %{version}

Documentation and help files for python3-jupyter_ipython.

%setup -q -n ipython-%{version}
unzip %{SOURCE2} -d docs
mv docs/ipython-* docs/html
rm docs/html/.buildinfo

find examples -type f -name "*.py" -exec sed -i "s|^#!%{_bindir}/env python$|#!%{_bindir}/python3|" {} \;

# Not needed

mkdir -p %{buildroot}%{_docdir}/python-jupyter_ipython

cp %{SOURCE1} %{buildroot}%{_docdir}/python-jupyter_ipython/
cp -r docs/html %{buildroot}%{_docdir}/python-jupyter_ipython/
cp -r examples %{buildroot}%{_docdir}/python-jupyter_ipython/

%fdupes %{buildroot}%{_docdir}/python-jupyter_ipython/

export LANG="en_US.UTF-8"
mkdir tester
pushd tester

%license COPYING.rst docs/source/about/license_and_copyright.rst
%dir %{_docdir}/python-jupyter_ipython/
%doc %{_docdir}/python-jupyter_ipython/ipython.pdf
%doc %{_docdir}/python-jupyter_ipython/html/
%doc %{_docdir}/python-jupyter_ipython/examples/

openSUSE Build Service is sponsored by