File python3-jupyter_nbformat.spec of Package python3-jupyter_nbformat

#
# spec file for package python3-jupyter_nbformat
#
# Copyright (c) 2016 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 http://bugs.opensuse.org/
#


Name:           python3-jupyter_nbformat
Version:        4.0.1
Release:        0
Summary:        The Jupyter Notebook format
License:        BSD-3-Clause
Group:          Development/Languages/Python
Url:            http://jupyter.org
Source:         https://files.pythonhosted.org/packages/source/n/nbformat/nbformat-%{version}.tar.gz
BuildRequires:  python3-devel
BuildRequires:  python3-ipython_genutils
BuildRequires:  python3-jsonschema > 2.5.0
BuildRequires:  python3-jupyter_core
BuildRequires:  python3-setuptools
BuildRequires:  python3-traitlets
# Test requirements
BuildRequires:  python3-nose
Requires:       python3-ipython_genutils
Requires:       python3-jsonschema > 2.5.0
Requires:       python3-jupyter_core
Requires:       python3-traitlets
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

%description
This package contains the base implementation of the Jupyter Notebook format,
and Python APIs for working with notebooks.

%prep
%setup -q -n nbformat-%{version}

%build
python3 setup.py build

%install
python3 setup.py install --prefix=%{_prefix} --root=%{buildroot}

mv %{buildroot}%{_bindir}/jupyter-trust %{buildroot}%{_bindir}/jupyter3-trust
ln -s -f %{_bindir}/jupyter3-trust %{buildroot}%{_bindir}/jupyter-trust-%{py3_ver}

# Prepare for update-alternatives usage
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
ln -s -f %{_sysconfdir}/alternatives/jupyter-trust %{buildroot}%{_bindir}/jupyter-trust
# create a dummy target for /etc/alternatives/jupyter-trust
touch %{buildroot}%{_sysconfdir}/alternatives/jupyter-trust

%post
%_sbindir/update-alternatives \
   --install %{_bindir}/jupyter-trust jupyter-trust %{_bindir}/jupyter-trust-%{py3_ver} 30

%postun
if [ $1 -eq 0 ] ; then
    %_sbindir/update-alternatives --remove jupyter-trust %{_bindir}/jupyter-trust-%{py3_ver}
fi

%check
nosetests

%files
%defattr(-,root,root,-)
%doc COPYING.md README.md
%{_bindir}/jupyter-trust
%{_bindir}/jupyter3-trust
%{_bindir}/jupyter-trust-%{py3_ver}
%ghost %{_sysconfdir}/alternatives/jupyter-trust
%{python3_sitelib}/*

%changelog
openSUSE Build Service is sponsored by