Rebuild for ntl 11.1.0.

Optionally bundle thebe, threejs, and widgetsnbextension.
Add provides for the optionally bundled packages.
Add -flask patch.
Apply new guidelines for python files in nonstandard places.
This commit is contained in:
Jerry James 2018-07-04 14:15:07 -06:00
parent a87f7957b7
commit 2e5bf94715
2 changed files with 321 additions and 1 deletions

View file

@ -1,8 +1,14 @@
%global __provides_exclude_from .*/site-packages/.*\\.so
# This package install python files in nonstandard places
%global _python_bytecompile_extra 0
%bcond_with bundled_pexpect
%bcond_with bundled_ipython
%bcond_without bundled_ipywidgets
%bcond_without bundled_thebe
%bcond_without bundled_threejs
%bcond_without bundled_widgetsnbextension
%bcond_without install_hack
# for faster full rpm test builds
@ -52,6 +58,15 @@
%global sagenb_export_pkg sagenb_export-3.2
%global sagetex_pkg sagetex-3.0
%global Sphinx_pkg Sphinx-1.6.3
%if %{with bundled_thebe}
%global thebe_pkg thebe-9624e0a0
%endif
%if %{with bundled_threejs}
%global threejs_pkg threejs-r80
%endif
%if %{with bundled_widgetsnbextension}
%global widgetsnbextension_pkg widgetsnbextension-3.1.1
%endif
%global SAGE_ROOT %{_libdir}/sagemath
%global SAGE_LOCAL %{SAGE_ROOT}/local
@ -168,6 +183,9 @@ Patch25: %{name}-includes.patch
# Use atlas blas
Patch26: %{name}-atlas.patch
# Adapt to recent versions of the flask packages
Patch27: %{name}-flask.patch
BuildRequires: 4ti2
BuildRequires: arb-devel
BuildRequires: atlas-devel
@ -416,6 +434,13 @@ Requires: tachyon
Requires: texlive
Requires: vecmath
%if %{with bundled_thebe}
Provides: bundled(thebe) = %(cut -d- -f2- <<< %{thebe_pkg})
%endif
%if %{with bundled_threejs}
Provides: bundled(threejs) = %(cut -d- -f2- <<< %{threejs_pkg})
%endif
%description
Sage is a free open-source mathematics software system licensed
under the GPL. It combines the power of many existing open-source
@ -426,6 +451,15 @@ packages into a common Python-based interface.
Summary: Open Source Mathematics Software
Requires: %{name}%{?_isa} = %{version}-%{release}
Obsoletes: %{name}-devel < 6.8-1
%if %{with bundled_ipython}
Provides: bundled(ipython) = %(cut -d- -f2- <<< %{ipython_pkg})
%endif
%if %{with bundled_ipywidgets}
Provides: bundled(ipywidgets) = %(cut -d- -f2- <<< %{ipywidgets_pkg})
%endif
%if %{with bundled_widgetsnbextension}
Provides: bundled(widgetsnbextension) = %(cut -d- -f2- <<< %{widgetsnbextension_pkg})
%endif
%description core
This package contains the core sagemath python modules.
@ -759,6 +793,28 @@ popd
%endif
%endif
%if %{with bundled_thebe}
pushd build/pkgs/thebe
unzip ../../../upstream/%{thebe_pkg}.zip
mv %{thebe_pkg}* src
popd
%endif
%if %{with bundled_threejs}
pushd build/pkgs/threejs
mkdir src
cd src
tar zxf ../../../../upstream/%{threejs_pkg}.tar.gz
popd
%endif
%if %{with bundled_widgetsnbextension}
pushd build/pkgs/widgetsnbextension
tar zxf ../../../upstream/%{widgetsnbextension_pkg}.tar.gz
mv %{widgetsnbextension_pkg} src
popd
%endif
%patch1
%patch2
%patch3
@ -790,6 +846,7 @@ popd
%patch24
%patch25
%patch26
%patch27
sed -e 's|@@SAGE_ROOT@@|%{SAGE_ROOT}|' \
-e 's|@@SAGE_DOC@@|%{SAGE_DOC}|' \
@ -824,6 +881,10 @@ sed -i 's,#!%{_bindir}/env sage-python23,#!%{_bindir}/python2,' \
$(grep -Frl '#!%{_bindir}/env sage-python23')
sed -i 's,#!%{_bindir}/env ,#!%{_bindir}/,' $(grep -Frl '#!%{_bindir}/env')
sed -i 's,#!%{_bindir}/python$,&2,' $(grep -Frl '#!%{_bindir}/python')
sed -i 's,%{_bindir}/python,&2,' src/sage/misc/dev_tools.py
sed -e 's,local/bin/python,bin/python,' \
-e 's,#!%{_bindir}/python,&2,' \
-i src/sage/repl/preparse.py
########################################################################
%build
@ -877,6 +938,13 @@ pushd build/pkgs/ipywidgets/src
popd
%endif
%if %{with bundled_widgetsnbextension}
pushd build/pkgs/widgetsnbextension/src
%__python2 setup.py build
%__python2 setup.py install --root %{_builddir}
popd
%endif
%if %{with cython_hack}
cp -far %{python2_sitearch}/Cython %{_builddir}%{python2_sitearch}
BASE=$PWD/build/pkgs/cython/patches/
@ -1162,6 +1230,29 @@ mv %{_builddir}%{_bindir}/ip* %{buildroot}%{SAGE_LOCAL}/bin
mv %{_builddir}%{python2_sitelib}/ipywidgets %{buildroot}%{SAGE_PYTHONPATH}
%endif
#------------------------------------------------------------------------
%if %{with bundled_thebe}
pushd build/pkgs/thebe
mkdir -p $SAGE_SHARE/thebe
cp -p src/static/main-built.js $SAGE_SHARE/thebe/thebe.js
popd
%endif
#------------------------------------------------------------------------
%if %{with bundled_threejs}
pushd build/pkgs/threejs
cp -a src $SAGE_SHARE/threejs
popd
%endif
#------------------------------------------------------------------------
%if %{with bundled_widgetsnbextension}
pushd build/pkgs/widgetsnbextension/src
%py2_install "--install-purelib=%{python2_sitelib}"
mv %{buildroot}%{_prefix}%{_sysconfdir} %{buildroot}%{_sysconfdir}
popd
%endif
#------------------------------------------------------------------------
cat > %{buildroot}%{_bindir}/sage << EOF
#!/bin/bash -i
@ -1402,6 +1493,10 @@ chmod +x %{buildroot}%{SAGE_LOCAL}/bin/sage-list-packages
rm -fr %{buildroot}%{SAGE_DOC}/inventory
%endif
#------------------------------------------------------------------------
# Byte compile python files in nonstandard places
%py_byte_compile %{__python2} %{buildroot}%{_texmf_main}/tex/latex/sagetex
# last install command
rm -fr $DOT_SAGE
@ -1452,6 +1547,7 @@ exit 0
%doc %{SAGE_ROOT}/COPYING.txt
%dir %{SAGE_LOCAL}
%dir %{SAGE_LOCAL}/bin
%dir %{SAGE_SHARE}
%{SAGE_LOCAL}/bin/QuadraticSieve
%{SAGE_LOCAL}/bin/ecm
%{SAGE_LOCAL}/bin/gap
@ -1478,6 +1574,14 @@ exit 0
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{SAGE_SPKG_INST}
%if %{with bundled_thebe}
# MIT
%{SAGE_SHARE}/thebe
%endif
%if %{with bundled_threejs}
# MIT
%{SAGE_SHARE}/threejs
%endif
#------------------------------------------------------------------------
%files core
@ -1492,6 +1596,14 @@ exit 0
%if %{with bundled_ipywidgets}
%{SAGE_PYTHONPATH}/ipywidgets
%endif
%if %{with bundled_widgetsnbextension}
%dir %{_sysconfdir}/jupyter
%dir %{_sysconfdir}/jupyter/nbconfig
%dir %{_sysconfdir}/jupyter/nbconfig/notebook.d
%config(noreplace) %{_sysconfdir}/jupyter/nbconfig/notebook.d/*.json
%{_datadir}/jupyter/
%{python2_sitelib}/widgetsnbextension*
%endif
#------------------------------------------------------------------------
%files data
@ -1697,7 +1809,14 @@ exit 0
########################################################################
%changelog
* Fri May 18 2018 Jerry James <loganjerry@gmailc.om> - 8.2-1
* Tue Jul 3 2018 Jerry James <loganjerry@gmail.com> - 8.2-2
- Rebuild for ntl 11.1.0
- Optionally bundle thebe, threejs, and widgetsnbextension
- Add provides for the optionally bundled packages
- Add -flask patch
- Apply new guidelines for python files in nonstandard places
* Fri May 18 2018 Jerry James <loganjerry@gmail.com> - 8.2-1
- Update to sagemath 8.2
- Create the sagemath-data-combinatorial_designs subpackage
- Create the sagemath-notebook-export subpackage