- Improve the -ecm patch.
- Add -formatargspec patch to silence doc-building warnings.
- Add -data-elliptic_curves_large subpackage.
- Build with bliss, coxeter3, and mcqd support.
- Fix typo that made the singular.hlp file inaccessible.
- Add more gap packages to get closer to the set shipped by upstream.
- Refactor Requires so they apply to the correct subpackages.
- More python 3 patching due to changes in python 3.8.
- Use upstream's method of installing jupyter support.
- Obsolete the sagemath-notebook-export subpackage.
This commit is contained in:
Jerry James 2019-09-12 20:34:03 -06:00
parent e4003eb1b4
commit ecae6482c5
12 changed files with 723 additions and 176 deletions

View file

@ -40,6 +40,7 @@
%global combinatorial_designs_pkg combinatorial_designs-20140630
%global conway_polynomials_pkg conway_polynomials-0.5
%global cremona_ver 2016-10-17
%global elliptic_curves_pkg elliptic_curves-0.8.1
%global flintqs_pkg flintqs-1.0
%global graphs_pkg graphs-20161026
@ -76,9 +77,11 @@
%endif
# Spkg equivalents of required rpms; we pretend they are installed as spkgs.
# The version numbers shown are those of the latest released spkg, if the Fedora
# version is not behind.
%global SAGE_REQUIRED_PKGS 4ti2-1.6.7 cbc-2.9.4 CoCoALib-0.99564 cryptominisat-5.6.6 gap_packages-4.10.1 gmp-6.1.2 libsirocco-2.0 lrslib-062+autotools-2017-03-03 qepcad-B.1.71 saclib-2.2.7 surf-1.0.6-gcc6
%global SAGE_REQUIRED_PKGS 4ti2-1.6.9 bliss-0.73 cbc-2.10.3 CoCoALib-0.99601 coxeter3-1.1 cryptominisat-5.6.8 database_cremona_ellcurve-%{cremona_ver} gap_packages-4.10.2 gmp-6.1.2 libsirocco-2.0 lrslib-070 mcqd-1.0 qepcad-B.1.72 saclib-2.2.7 surf-1.0.6-gcc6
%ifarch %{ix86} x86_64
%global SAGE_REQUIRED_PKGS %{SAGE_REQUIRED_PKGS} fes-0.2
%endif
%global SAGE_ROOT %{_libdir}/sagemath
%global SAGE_LOCAL %{SAGE_ROOT}/local
@ -92,14 +95,15 @@
Name: sagemath
Summary: A free open-source mathematics software system
Version: 8.8
Release: 4%{?dist}
Release: 5%{?dist}
# The file ${SAGE_ROOT}/COPYING.txt is the upstream license breakdown file
# Additionally, every $files section has a comment with the license name
# before files with that license
License: ASL 2.0 and BSD and GPL+ and GPLv2+ and LGPLv2+ and MIT and Public Domain
URL: http://www.sagemath.org
Source0: http://files.sagemath.org/src/sage-%{version}.tar.gz
Source1: gprc.expect
Source1: https://github.com/JohnCremona/ecdata/archive/%{cremona_ver}/ecdata-%{cremona_ver}.tar.gz
Source2: gprc.expect
# Follow maxima's ExclusiveArch
ExclusiveArch: aarch64 %{arm} %{ix86} x86_64 ppc sparcv9
@ -143,9 +147,8 @@ Patch9: %{name}-4ti2.patch
# FIXME besides not using X and told so, fails if DISPLAY is not set
Patch10: %{name}-jmol.patch
# only cremona mini database built and installed
# FIXME add a package with the full cremona database
# FIXME actually it should be already available in pari-elldata
# tell the user how to install the large Cremona database
# add a missing commit() that causes large database construction to fail
Patch11: %{name}-cremona.patch
# adapt to python 3 and cython running in python 3 mode
@ -212,13 +215,20 @@ Patch31: %{name}-env.patch
# Make notebook minimally function until upstream finally removes it
Patch32: %{name}-sagenb-python3.patch
# Replace python's deprecated formatargspec with a custom implementation
# https://trac.sagemath.org/ticket/27971
# https://git.sagemath.org/sage.git/commit/?id=bbd5b28fc8e451bea4f87c2f2b0c27586386262a
Patch33: %{name}-formatargspec.patch
BuildRequires: 4ti2
BuildRequires: arb-devel
BuildRequires: bliss-devel
BuildRequires: boost-devel
BuildRequires: brial-devel
BuildRequires: cddlib-tools
BuildRequires: cliquer-devel
BuildRequires: coin-or-Cbc-devel
BuildRequires: coxeter-devel
BuildRequires: desktop-file-utils
BuildRequires: dvipng
BuildRequires: ecl
@ -234,8 +244,13 @@ BuildRequires: gap-libs
BuildRequires: gap-pkg-atlasrep
BuildRequires: gap-pkg-crime
BuildRequires: gap-pkg-design
BuildRequires: gap-pkg-forms
BuildRequires: gap-pkg-francy
BuildRequires: gap-pkg-guava
BuildRequires: gap-pkg-hapcryst
BuildRequires: gap-pkg-hecke
BuildRequires: gap-pkg-jupyterviz
BuildRequires: gap-pkg-singular
BuildRequires: gap-pkg-sonata
BuildRequires: gap-pkg-toric
BuildRequires: gc-devel
@ -273,6 +288,7 @@ BuildRequires: m4ri-devel
BuildRequires: m4rie-devel
BuildRequires: mathjax
BuildRequires: maxima-runtime-ecl
BuildRequires: mcqd-devel
BuildRequires: mpfi-devel
BuildRequires: nauty
BuildRequires: ntl-devel
@ -317,12 +333,14 @@ BuildRequires: python3dist(networkx)
BuildRequires: python3dist(notebook)
%if %{with bundled_ipython}
BuildRequires: python3dist(path.py)
%endif
BuildRequires: python3dist(pathlib2)
%endif
%if %{without bundled_pexpect}
BuildRequires: python3dist(pexpect)
%endif
%if %{with bundled_ipython}
BuildRequires: python3dist(pickleshare)
%endif
BuildRequires: python3dist(pip)
BuildRequires: python3dist(pkgconfig)
BuildRequires: python3dist(psutil)
@ -367,28 +385,58 @@ BuildRequires: xorg-x11-server-Xvfb
BuildRequires: zlib-devel
BuildRequires: zn_poly-devel
Requires: hicolor-icon-theme
Requires: %{name}-core
Requires: %{name}-data
%if %{with docs}
Requires: %{name}-doc-en
%endif
Requires: %{name}-notebook
Requires: %{name}-rubiks
Requires: %{name}-sagetex
%if %{with bundled_thebe}
Provides: bundled(thebe) = %{thebe_ver}
%endif
%if %{with bundled_threejs}
Provides: bundled(threejs) = %{threejs_ver}
%endif
# This can be removed when Fedora 30 reaches EOL
Obsoletes: %{name}-notebook-export < 8.8-5
Provides: %{name}-notebook-export = %{version}-%{release}
%description
Sage is a free open-source mathematics software system licensed
under the GPL. It combines the power of many existing open-source
packages into a common Python-based interface.
#------------------------------------------------------------------------
%package core
Summary: Open Source Mathematics Software
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: 4ti2
Requires: cddlib-tools
Requires: ecl
Requires: gap
Requires: GAPDoc
Requires: gap-pkg-atlasrep
Requires: gap-pkg-crime
Requires: gap-pkg-design
Requires: gap-pkg-forms
Requires: gap-pkg-francy
Requires: gap-pkg-guava
Requires: gap-pkg-hapcryst
Requires: gap-pkg-hecke
Requires: gap-pkg-jupyterviz
Requires: gap-pkg-sonata
Requires: gap-pkg-toric
Requires: gfan
Requires: gmp-ecm
Requires: hicolor-icon-theme
Requires: jmol
Requires: jsmol
Requires: jsmath-fonts
Requires: jsmol
Requires: latte-integrale
Requires: lrslib-utils
Requires: mathjax
Requires: maxima-gui
Requires: maxima-runtime-ecl
Requires: nauty
Requires: palp
@ -401,10 +449,6 @@ Requires: python3dist(cysignals)
Requires: python3dist(cvxopt)
Requires: python3dist(cython)
Requires: python3dist(docutils)
Requires: python3dist(flask-autoindex)
Requires: python3dist(flask-babel)
Requires: python3dist(flask-openid)
Requires: python3dist(flask-silk)
Requires: python3dist(fpylll)
Requires: python3dist(future)
Requires: python3dist(gmpy2)
@ -416,71 +460,41 @@ Requires: python3dist(ipykernel)
%if %{without bundled_ipython}
Requires: python3dist(ipython)
%endif
Requires: python3dist(kiwisolver)
Requires: python3dist(matplotlib)
Requires: python3dist(networkx)
Requires: python3dist(notebook)
%if %{with bundled_ipython}
Requires: python3dist(path.py)
%endif
Requires: python3dist(pathlib2)
%endif
%if %{without bundled_pexpect}
Requires: python3dist(pexpect)
%endif
%if %{with bundled_ipython}
Requires: python3dist(pickleshare)
Requires: python3dist(pillow)
%endif
Requires: python3dist(pplpy)
Requires: python3dist(psutil)
Requires: python3dist(ptyprocess)
Requires: python3dist(pycryptosat)
Requires: python3dist(rpy2)
Requires: python3dist(scipy)
Requires: python3dist(send2trash)
%if %{with bundled_ipython}
BuildRequires: python3dist(simplegeneric)
%endif
Requires: python3dist(six)
Requires: python3dist(speaklater)
Requires: python3dist(sphinx)
Requires: python3dist(sympy)
Requires: python3dist(twisted)
%if %{with bundled_ipython}
Requires: python3dist(pyzmq)
%endif
Requires: python3dist(rpy2)
Requires: python3dist(scipy)
%if %{with bundled_ipython}
Requires: python3dist(simplegeneric)
%endif
Requires: python3dist(six)
Requires: python3dist(sphinx)
Requires: python3dist(sympy)
Requires: python3dist(zodb3)
Requires: qepcad-B
Requires: R
Requires: %{name}-core
Requires: %{name}-data
%if %{with docs}
Requires: %{name}-doc-en
%endif
Requires: %{name}-notebook
Requires: %{name}-rubiks
Requires: %{name}-sagetex
Requires: Singular
# Required by widgetsnbextension and thebe; remove when they are unbundled
Requires: stix-math-fonts
Requires: sympow
Requires: tachyon
Requires: texlive
Requires: vecmath
%if %{with bundled_thebe}
Provides: bundled(thebe) = %{thebe_ver}
%endif
%if %{with bundled_threejs}
Provides: bundled(threejs) = %{threejs_ver}
%endif
%description
Sage is a free open-source mathematics software system licensed
under the GPL. It combines the power of many existing open-source
packages into a common Python-based interface.
#------------------------------------------------------------------------
%package core
Summary: Open Source Mathematics Software
Requires: %{name}%{?_isa} = %{version}-%{release}
%if %{with bundled_ipython}
Provides: bundled(ipython) = %{ipython_ver}
Provides: bundled(prompt_toolkit) = %{prompt_toolkit_ver}
@ -539,11 +553,22 @@ BuildArch: noarch
Includes two databases:
* A small subset of the data in John Cremona's database of elliptic curves up
to conductor 10000. See http://www.warwick.ac.uk/~masgaj/ftp/data/ or
http://sage.math.washington.edu/cremona/INDEX.html
to conductor 10000. See http://johncremona.github.io/ecdata/.
* William Stein's database of interesting curves
#------------------------------------------------------------------------
%package data-elliptic_curves_large
Summary: Large database of elliptic curves
Requires: %{name}-data = %{version}-%{release}
BuildArch: noarch
%description data-elliptic_curves_large
John Cremona's full database of elliptic curves, and also data related to
the BSD conjecture and modular degrees for all of these curves, and
generators for the Mordell-Weil groups. See
http://johncremona.github.io/ecdata/.
#------------------------------------------------------------------------
%package data-etc
Summary: Extcode for Sagemath
@ -665,6 +690,9 @@ This package contains the Turkish %{name} documentation.
Summary: The Sage Notebook
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python-jupyter-filesystem
Requires: python3dist(flask-silk)
Requires: python3dist(send2trash)
Requires: vecmath
%description notebook
The Sage Notebook is a web-based graphical user interface for
@ -697,6 +725,7 @@ Eric Dietz (GPL) http://www.wrongway.org/?rubiksource
%package sagetex
Summary: Sagemath into LaTeX documents
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: python3dist(pillow)
Requires: tex(color.sty)
Requires: tex(fancyvrb.sty)
Requires: tex(graphicx.sty)
@ -718,6 +747,7 @@ computations, and plots from the Sage mathematics software suite
########################################################################
%prep
%setup -q -n sage-%{version}
%setup -q -n sage-%{version} -T -D -a 1
pushd build/pkgs/combinatorial_designs
tar jxf ../../../upstream/%{combinatorial_designs_pkg}.tar.bz2
@ -877,6 +907,7 @@ popd
%patch30
%patch31
%patch32
%patch33
sed -e 's|@@SAGE_ROOT@@|%{SAGE_ROOT}|' \
-e 's|@@SAGE_DOC@@|%{SAGE_DOC}|' \
@ -1078,6 +1109,7 @@ export SAGE_SHARE=%{buildroot}%{SAGE_SHARE}
export SAGE_ETC=%{buildroot}%{SAGE_ETC}
export SAGE_EXTCODE=%{buildroot}%{SAGE_ETC}
export SAGE_DOC=%{buildroot}%{SAGE_DOC}
export SAGE_PYTHON3=yes
export SAGE_PYTHONPATH=%{buildroot}%{SAGE_PYTHONPATH}
export DESTDIR=%{buildroot}
export SAGE_DEBUG=no
@ -1116,7 +1148,7 @@ pushd src/ext
fi
done
cp -far pari $SAGE_ETC
cp -fa %{SOURCE1} $SAGE_ETC
cp -fa %{SOURCE2} $SAGE_ETC
popd
#------------------------------------------------------------------------
@ -1518,7 +1550,10 @@ rm -r %{buildroot}%{python3_sitearch}/sage_setup
mkdir -p %{buildroot}%{SAGE_SPKG_INST}
pushd upstream
for file in *.tar.*; do
mkdir %{buildroot}%{SAGE_SPKG_INST}/$(echo $file | sed -e 's|\.tar.*||')
mkdir %{buildroot}%{SAGE_SPKG_INST}/${file%.tar.*}
done
for file in *.zip; do
mkdir %{buildroot}%{SAGE_SPKG_INST}/${file%.zip}
done
popd
pushd %{buildroot}%{SAGE_SPKG_INST}
@ -1542,7 +1577,7 @@ done
if [ \$INSTALLED = no ]; then
exit 0
fi
LIST=\$(cd %{SAGE_SPKG_INST}; echo *)
LIST=\$(ls -1 %{SAGE_SPKG_INST})
if [ \$NOVERSION = false ]; then
for pkg in \$LIST; do
echo \$pkg | sed -e 's/-/ /'
@ -1567,18 +1602,35 @@ chmod +x %{buildroot}%{SAGE_LOCAL}/bin/sage-list-packages
#------------------------------------------------------------------------
# Jupyter integration
mkdir -p %{buildroot}%{_datadir}/jupyter/kernels/sagemath
pushd %{buildroot}%{_datadir}/jupyter/kernels/sagemath
ln -s %{_docdir}/%{name}/html/en doc
ln -s %{SAGE_ETC}/notebook-ipython/logo-64x64.png logo-64x64.png
ln -s %{SAGE_ETC}/notebook-ipython/logo.svg logo.svg
cat > kernel.json << EOF
{"display_name": "SageMath %{version}", "argv": ["%{_bindir}/sage", "--python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}"]}
pushd src
%{__python3} << EOF
from sage.repl.ipython_kernel.install import SageKernelSpec
SageKernelSpec.update(prefix='%{buildroot}%{_prefix}')
EOF
popd
# Allow displaying 3d plots in the jupyter notebook
mkdir -p %{buildroot}%{_datadir}/jupyter/nbextensions/
ln -sf %{_jsdir}/jsmol %{buildroot}%{_datadir}/jupyter/nbextensions/
# Remove buildroot from the json and symbolic links
pushd %{buildroot}%{_datadir}/jupyter
sed -i 's,%{buildroot},,g' kernels/sagemath/kernel.json
for link in $(find . -type l); do
target=$(readlink $link)
if [[ "$target" =~ "%{buildroot}" ]]; then
rm $link
ln -s ${target#%{buildroot}} $link
fi
done
popd
#------------------------------------------------------------------------
# Build the large Cremona database
PATH=%{buildroot}%{SAGE_LOCAL}/bin:$PATH
PYTHONPATH=%{buildroot}%{SAGE_PYTHONPATH}:%{buildroot}%{python3_sitearch}
cat > cremona.sage << EOF
import sage.databases.cremona
db_path = '%{buildroot}%{SAGE_SHARE}/cremona/cremona'
c = sage.databases.cremona.LargeCremonaDatabase(db_path, False, True)
c._init_from_ftpdata('ecdata-%{cremona_ver}')
EOF
%{buildroot}%{SAGE_LOCAL}/bin/sage cremona.sage
# last install command
rm -fr $DOT_SAGE
@ -1604,6 +1656,7 @@ rm -fr $DOT_SAGE
%{SAGE_LOCAL}/lib
%{SAGE_LOCAL}/share
%{SAGE_LOCAL}/var
%exclude %{SAGE_LOCAL}/var/lib/sage/installed/database_cremona_ellcurve-%{cremona_ver}
%{SAGE_ROOT}/doc
%{SAGE_ROOT}/devel
%{SAGE_ROOT}/share
@ -1661,9 +1714,17 @@ rm -fr $DOT_SAGE
#------------------------------------------------------------------------
%files data-elliptic_curves
# GPLv2+
%{SAGE_SHARE}/cremona
%dir %{SAGE_SHARE}/cremona/
%{SAGE_SHARE}/cremona/cremona_mini.db
%{SAGE_SHARE}/ellcurves
#------------------------------------------------------------------------
%files data-elliptic_curves_large
# GPLv2+
%dir %{SAGE_SHARE}/cremona/
%{SAGE_SHARE}/cremona/cremona.db
%{SAGE_LOCAL}/var/lib/sage/installed/database_cremona_ellcurve-%{cremona_ver}
#------------------------------------------------------------------------
%files data-etc
# GPLv2+
@ -1847,6 +1908,18 @@ rm -fr $DOT_SAGE
########################################################################
%changelog
* Thu Sep 12 2019 Jerry James <loganjerry@gmail.com> - 8.8-5
- Improve the -ecm patch
- Add -formatargspec patch to silence doc-building warnings
- Add -data-elliptic_curves_large subpackage
- Build with bliss, coxeter3, and mcqd support
- Fix typo that made the singular.hlp file inaccessible
- Add more gap packages to get closer to the set shipped by upstream
- Refactor Requires so they apply to the correct subpackages
- More python 3 patching due to changes in python 3.8
- Use upstream's method of installing jupyter support
- Obsolete the sagemath-notebook-export subpackage
* Tue Aug 20 2019 Susi Lehtola <jussilehtola@fedoraproject.org> - 8.8-4
- Rebuilt for GSL 2.6.