[arch-commits] Commit in sagemath/repos (36 files)

Antonio Rojas arojas at archlinux.org
Sat Jun 3 13:58:53 UTC 2017


    Date: Saturday, June 3, 2017 @ 13:58:52
  Author: arojas
Revision: 233757

archrelease: copy trunk to community-staging-i686, community-staging-x86_64

Added:
  sagemath/repos/community-staging-i686/
  sagemath/repos/community-staging-i686/PKGBUILD
    (from rev 233756, sagemath/trunk/PKGBUILD)
  sagemath/repos/community-staging-i686/cython-sys-path.patch
    (from rev 233756, sagemath/trunk/cython-sys-path.patch)
  sagemath/repos/community-staging-i686/ecm-7.patch
    (from rev 233756, sagemath/trunk/ecm-7.patch)
  sagemath/repos/community-staging-i686/env.patch
    (from rev 233756, sagemath/trunk/env.patch)
  sagemath/repos/community-staging-i686/fes02.patch
    (from rev 233756, sagemath/trunk/fes02.patch)
  sagemath/repos/community-staging-i686/increase-rtol.patch
    (from rev 233756, sagemath/trunk/increase-rtol.patch)
  sagemath/repos/community-staging-i686/jupyter-path.patch
    (from rev 233756, sagemath/trunk/jupyter-path.patch)
  sagemath/repos/community-staging-i686/latte-count.patch
    (from rev 233756, sagemath/trunk/latte-count.patch)
  sagemath/repos/community-staging-i686/package.patch
    (from rev 233756, sagemath/trunk/package.patch)
  sagemath/repos/community-staging-i686/r-no-readline.patch
    (from rev 233756, sagemath/trunk/r-no-readline.patch)
  sagemath/repos/community-staging-i686/sagemath-planarity3.patch
    (from rev 233756, sagemath/trunk/sagemath-planarity3.patch)
  sagemath/repos/community-staging-i686/sagemath-pynac-0.7.6.patch
    (from rev 233756, sagemath/trunk/sagemath-pynac-0.7.6.patch)
  sagemath/repos/community-staging-i686/sagemath-python3-notebook.patch
    (from rev 233756, sagemath/trunk/sagemath-python3-notebook.patch)
  sagemath/repos/community-staging-i686/sagemath-singular-4.1.0.p2.patch
    (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p2.patch)
  sagemath/repos/community-staging-i686/sagemath-singular-4.1.0.p3.patch
    (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p3.patch)
  sagemath/repos/community-staging-i686/skip-check.patch
    (from rev 233756, sagemath/trunk/skip-check.patch)
  sagemath/repos/community-staging-i686/test-optional.patch
    (from rev 233756, sagemath/trunk/test-optional.patch)
  sagemath/repos/community-staging-x86_64/
  sagemath/repos/community-staging-x86_64/PKGBUILD
    (from rev 233756, sagemath/trunk/PKGBUILD)
  sagemath/repos/community-staging-x86_64/cython-sys-path.patch
    (from rev 233756, sagemath/trunk/cython-sys-path.patch)
  sagemath/repos/community-staging-x86_64/ecm-7.patch
    (from rev 233756, sagemath/trunk/ecm-7.patch)
  sagemath/repos/community-staging-x86_64/env.patch
    (from rev 233756, sagemath/trunk/env.patch)
  sagemath/repos/community-staging-x86_64/fes02.patch
    (from rev 233756, sagemath/trunk/fes02.patch)
  sagemath/repos/community-staging-x86_64/increase-rtol.patch
    (from rev 233756, sagemath/trunk/increase-rtol.patch)
  sagemath/repos/community-staging-x86_64/jupyter-path.patch
    (from rev 233756, sagemath/trunk/jupyter-path.patch)
  sagemath/repos/community-staging-x86_64/latte-count.patch
    (from rev 233756, sagemath/trunk/latte-count.patch)
  sagemath/repos/community-staging-x86_64/package.patch
    (from rev 233756, sagemath/trunk/package.patch)
  sagemath/repos/community-staging-x86_64/r-no-readline.patch
    (from rev 233756, sagemath/trunk/r-no-readline.patch)
  sagemath/repos/community-staging-x86_64/sagemath-planarity3.patch
    (from rev 233756, sagemath/trunk/sagemath-planarity3.patch)
  sagemath/repos/community-staging-x86_64/sagemath-pynac-0.7.6.patch
    (from rev 233756, sagemath/trunk/sagemath-pynac-0.7.6.patch)
  sagemath/repos/community-staging-x86_64/sagemath-python3-notebook.patch
    (from rev 233756, sagemath/trunk/sagemath-python3-notebook.patch)
  sagemath/repos/community-staging-x86_64/sagemath-singular-4.1.0.p2.patch
    (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p2.patch)
  sagemath/repos/community-staging-x86_64/sagemath-singular-4.1.0.p3.patch
    (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p3.patch)
  sagemath/repos/community-staging-x86_64/skip-check.patch
    (from rev 233756, sagemath/trunk/skip-check.patch)
  sagemath/repos/community-staging-x86_64/test-optional.patch
    (from rev 233756, sagemath/trunk/test-optional.patch)

-----------------------------------------------------------+
 community-staging-i686/PKGBUILD                           |  166 ++
 community-staging-i686/cython-sys-path.patch              |   10 
 community-staging-i686/ecm-7.patch                        |   79 +
 community-staging-i686/env.patch                          |   94 +
 community-staging-i686/fes02.patch                        |   57 
 community-staging-i686/increase-rtol.patch                |   37 
 community-staging-i686/jupyter-path.patch                 |   22 
 community-staging-i686/latte-count.patch                  |   84 +
 community-staging-i686/package.patch                      |   38 
 community-staging-i686/r-no-readline.patch                |   11 
 community-staging-i686/sagemath-planarity3.patch          |  113 +
 community-staging-i686/sagemath-pynac-0.7.6.patch         |   44 
 community-staging-i686/sagemath-python3-notebook.patch    |   27 
 community-staging-i686/sagemath-singular-4.1.0.p2.patch   |  777 ++++++++++++
 community-staging-i686/sagemath-singular-4.1.0.p3.patch   |  118 +
 community-staging-i686/skip-check.patch                   |   22 
 community-staging-i686/test-optional.patch                |   25 
 community-staging-x86_64/PKGBUILD                         |  166 ++
 community-staging-x86_64/cython-sys-path.patch            |   10 
 community-staging-x86_64/ecm-7.patch                      |   79 +
 community-staging-x86_64/env.patch                        |   94 +
 community-staging-x86_64/fes02.patch                      |   57 
 community-staging-x86_64/increase-rtol.patch              |   37 
 community-staging-x86_64/jupyter-path.patch               |   22 
 community-staging-x86_64/latte-count.patch                |   84 +
 community-staging-x86_64/package.patch                    |   38 
 community-staging-x86_64/r-no-readline.patch              |   11 
 community-staging-x86_64/sagemath-planarity3.patch        |  113 +
 community-staging-x86_64/sagemath-pynac-0.7.6.patch       |   44 
 community-staging-x86_64/sagemath-python3-notebook.patch  |   27 
 community-staging-x86_64/sagemath-singular-4.1.0.p2.patch |  777 ++++++++++++
 community-staging-x86_64/sagemath-singular-4.1.0.p3.patch |  118 +
 community-staging-x86_64/skip-check.patch                 |   22 
 community-staging-x86_64/test-optional.patch              |   25 
 34 files changed, 3448 insertions(+)

Copied: sagemath/repos/community-staging-i686/PKGBUILD (from rev 233756, sagemath/trunk/PKGBUILD)
===================================================================
--- community-staging-i686/PKGBUILD	                        (rev 0)
+++ community-staging-i686/PKGBUILD	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,166 @@
+# $Id$
+# Maintainer: Evgeniy Alekseev <arcanis.arch at gmail dot com>
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
+# Contributor: Thomas Dziedzic <gostrc at gmail dot com>
+# Contributor: Osman Ugus <ugus11 at yahoo dot com>
+# Contributor: Stefan Husmann <stefan-husmann at t-online dot de>
+# Special thanks to Nareto for moving the compile from the .install to the PKGBUILD
+
+pkgbase=sagemath
+pkgname=(sagemath sagemath-jupyter)
+pkgver=7.6
+pkgrel=5
+pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
+arch=(i686 x86_64)
+url="http://www.sagemath.org"
+license=(GPL)
+depends=(ipython2 ppl palp brial cliquer maxima-ecl gfan sympow nauty python2-rpy2 python2-fpylll python2-psutil
+  python2-matplotlib python2-scipy python2-sympy python2-networkx python2-pillow python2-future libgap flintqs lcalc lrcalc arb
+  eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox rubiks pari-galdata pari-seadata-small planarity rankwidth
+  sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials)
+optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cython code'
+  'jmol: 3D plots' 'sage-notebook: Browser-based (flask) notebook interface'
+  'sagemath-doc: Documentation and inline help' 'python2-igraph: igraph backend for graph theory'
+  'coin-or-cbc: COIN backend for numerical computations' 'coin-or-csdp: for computing Lovász theta-function of graphs'
+  'buckygen: for generating fullerene graphs' 'plantri: for generating some classes of graphs' 'benzene: for generating fusenes and benzenoids'
+  'modular_decomposition: modular decomposition of graphs' 'ffmpeg: to export animations to video' 'imagemagick: to show animations'
+  'coxeter3: Coxeter groups implementation' 'cryptominisat2: SAT solver' 'gap-data: for computing Galois groups'
+  'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes'
+  'libhomfly: for computing the homfly polynomial of links' 'libbraiding: for computing in braid groups'
+  'libfes: exhaustive search of solutions for boolean equations' 'python2-pynormaliz: Normaliz backend for polyhedral computations'
+  'latte-integrale: integral point count in polyhedra'
+  'three.js: alternative 3D plots engine' 'tachyon: alternative 3D plots engine')
+makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding
+  mcqd coxeter3 cryptominisat2 modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe libfes)
+source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
+        env.patch skip-check.patch cython-sys-path.patch package.patch latte-count.patch
+        jupyter-path.patch sagemath-python3-notebook.patch test-optional.patch ecm-7.patch increase-rtol.patch r-no-readline.patch
+        sagemath-planarity3.patch fes02.patch sagemath-singular-4.1.0.p2.patch sagemath-singular-4.1.0.p3.patch sagemath-pynac-0.7.6.patch)
+sha256sums=('e6e0729ab25446e7c922058db0eee4b0b294b32c196e34842e843ea9fae41423'
+            'dc0a92b81e9e2faab05cf8a5adb40ae7010be74446bc80d5aea15f59706f2cff'
+            'b02b3d2d5620ca20f96adb62b6fef05e4676c0a60983310a1450fdf3d923cb04'
+            'ff7e034d08ab084fdb193484f7fe3a659ebcd8ab33a2b7177237d65b26de7872'
+            '4a2297e4d9d28f0b3a1f58e1b463e332affcb109eafde44837b1657e309c8212'
+            'b816c71d345fb1188c3faa01c4e75cfa04ba6506080231d5d2c303a2288e9b50'
+            '775051aa9076ebf631c8a291af38b6ec4a13c904740dc9da831641d592d8bcd8'
+            '27aa73d427d92aeb2c181a233aa3a574a4158cd7dee33832808f69edaec55ea2'
+            '81d08c6a760f171f3381455b66a6c84789c9f0eefddbe6ca5794075514ad8c3a'
+            '65ad84c83d5f956fde8eab961f2caad56d64044324c4abc0e56bcd9f44061cb6'
+            'be925eefeac3f28e639794ddc20d64e6faafd7181804e29417a510224d19ccc7'
+            'ef9f401fa84fe1772af9efee6816643534f2896da4c23b809937b19771bdfbbf'
+            'a1c562ebe4538d672404ca3ac2e954a3c955afeb7463f7b4fe6eaa6fa74fe5c7'
+            'a39da083c038ada797ffc5bedc9ba47455a3f77057d42f86484ae877ef9172ea'
+            'e2980048e51a81a8f60761c0ea66c81b4e36d75198de2f4e5f0d5e4fd5ef5172'
+            '18ea03c046435693a9008329bb725a9cf2ed0d88a0d731bc71b5586bf84dfddf'
+            '42d6549d9a07bcea9fa79bb63961ebbfaaa4ca64e9c6a402ae90d559bb256c12')
+
+prepare(){
+  cd sage-$pkgver
+
+# Arch-specific patches
+# assume all optional packages are installed
+  patch -p0 -i ../package.patch
+# set env variables
+  patch -p0 -i ../env.patch
+# skip checking build status
+  patch -p0 -i ../skip-check.patch
+# don't list optional packages when running tests
+  patch -p0 -i ../test-optional.patch
+# set jupyter path
+  patch -p0 -i ../jupyter-path.patch
+# search system paths for cython includes
+  patch -p1 -i ../cython-sys-path.patch
+# fix regressions with ECM 7
+  patch -p1 -i ../ecm-7.patch
+# increase numerical tolerance, needed by scipy 0.18
+  patch -p1 -i ../increase-rtol.patch
+# fix freezes in R interface with readline 7 (Debian)
+  patch -p1 -i ../r-no-readline.patch
+# fix build with planarity 3 (Debian)
+  patch -p2 -i ../sagemath-planarity3.patch
+# fix build with Singular 4.1.0-p3
+  patch -p1 -i ../sagemath-singular-4.1.0.p2.patch
+  patch -p1 -i ../sagemath-singular-4.1.0.p3.patch
+# use correct latte-count binary name
+  patch -p1 -i ../latte-count.patch
+# make 'sage -notebook=jupyter' work with our python3 jupyter-notebook package
+  patch -p1 -i ../sagemath-python3-notebook.patch
+
+# Upstream patches  
+# fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
+  patch -p1 -i ../fes02.patch
+# port to pynac 0.7.6 https://trac.sagemath.org/ticket/22838
+  patch -p1 -i ../sagemath-pynac-0.7.6.patch
+
+# use python2
+  sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*
+  sed -e 's|cython {OPT}|cython2 {OPT}|' -e 's|python setup.py|python2 setup.py|' -i src/sage/misc/cython.py
+  sed -e 's|exec ipython|exec ipython2|' -e 's|cygdb|cygdb2|g' -i src/bin/sage
+  sed -e "s|'cython'|'cython2'|" -i src/bin/sage-cython
+  sed -e 's|bin/python|bin/python2|g' -i src/bin/sage-env
+}
+
+
+build() {
+  cd sage-$pkgver/src
+
+  export SAGE_LOCAL="/usr"
+  export SAGE_ROOT="$PWD"
+  export SAGE_SRC="$PWD"
+  export CC=gcc
+
+  python2 setup.py build
+}
+
+package_sagemath() {
+  optdepends+=('sagemath-jupyter: Jupyter kernel')
+  conflicts=(sage-mathematics)
+  replaces=(sage-mathematics) 
+  provides=(sage-mathematics)
+
+  cd sage-$pkgver/src
+
+  export SAGE_ROOT="$PWD"
+  export SAGE_LOCAL="/usr"
+  export JUPYTER_PATH="$pkgdir"/usr/share/jupyter
+
+  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
+
+  mkdir -p "$pkgdir"/usr/bin
+  cp bin/sage "$pkgdir"/usr/bin
+  for _i in arch-env banner cachegrind callgrind cleaner coverage coverageall cython env eval grep grepdoc inline-fortran ipython \
+    massif maxima.lisp native-execute notebook num-threads.py omega open preparse python rst2ipynb rst2sws rst2txt run run-cython \
+    runtests startuptime.py sws2rst valgrind version.sh
+  do
+    cp bin/sage-$_i "$pkgdir"/usr/bin
+  done
+  cp bin/math-readline "$pkgdir"/usr/bin
+  
+  mkdir -p "$pkgdir"/usr/share/sage
+  cp -r ext "$pkgdir"/usr/share/sage
+  
+# Create SAGE_SRC, needed for the notebook and help
+  mkdir "$pkgdir"/usr/share/sage/source
+  ln -s /usr/share/doc/sage "$pkgdir"/usr/share/sage/source/doc
+
+# Remove sage_setup
+  rm -r "$pkgdir"/usr/lib/python2.7/site-packages/sage_setup
+
+# Split jupyter kernel
+  rm -r "$pkgdir"/usr/share/jupyter
+}
+
+package_sagemath-jupyter() {
+  pkgdesc='Jupyter kernel for SageMath'
+  depends=(sagemath python2-jupyter_client python2-ipywidgets mathjax)
+  optdepends=('sage-notebook-exporter: convert flask notebooks to Jupyter')
+
+  cd sage-$pkgver/src
+
+  export SAGE_ROOT="$PWD"
+  export SAGE_LOCAL="/usr"
+  export JUPYTER_PATH="$pkgdir"/usr/share/jupyter
+
+  python2 -c "from sage.repl.ipython_kernel.install import SageKernelSpec; SageKernelSpec.update()"
+}

Copied: sagemath/repos/community-staging-i686/cython-sys-path.patch (from rev 233756, sagemath/trunk/cython-sys-path.patch)
===================================================================
--- community-staging-i686/cython-sys-path.patch	                        (rev 0)
+++ community-staging-i686/cython-sys-path.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,10 @@
+--- sage-7.1/src/setup.py.orig	2016-04-08 16:59:24.691349473 +0000
++++ sage-7.1/src/setup.py	2016-04-08 17:03:03.847153796 +0000
+@@ -414,6 +414,7 @@
+             build_dir=SAGE_CYTHONIZED,
+             force=force,
+             aliases=aliases,
++            include_path=sys.path,
+             compiler_directives={
+                 'autotestdict': False,
+                 'cdivision': True,

Copied: sagemath/repos/community-staging-i686/ecm-7.patch (from rev 233756, sagemath/trunk/ecm-7.patch)
===================================================================
--- community-staging-i686/ecm-7.patch	                        (rev 0)
+++ community-staging-i686/ecm-7.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,79 @@
+--- a/src/sage/interfaces/ecm.py.orig	2016-05-16 22:18:03.894827738 +0200
++++ b/src/sage/interfaces/ecm.py	2016-05-16 22:19:14.674904932 +0200
+@@ -140,9 +140,6 @@
+         - ``ve`` -- integer `n`. Verbosely show short (`< n`
+           character) expressions on each loop
+ 
+-        - ``cofdec`` -- boolean. Force cofactor output in decimal
+-          (even if expressions are used )
+-
+         - ``B2scale`` -- integer. Multiplies the default B2 value
+ 
+         - ``go`` -- integer. Preload with group order val, which can
+@@ -395,15 +392,15 @@
+             if m is not None:
+                 factor = m.group('factor')
+                 primality = m.group('primality')
+-                assert primality in ['probable prime', 'composite']
+-                result += [(ZZ(factor), primality == 'probable prime')]
++                assert primality in ['prime', 'composite']
++                result += [(ZZ(factor), primality == 'prime')]
+                 continue  # cofactor on the next line
+             m = self._found_cofactor_re.match(line)
+             if m is not None:
+                 cofactor = m.group('cofactor')
+                 primality = m.group('primality')
+-                assert primality in ['Probable prime', 'Composite']
+-                result += [(ZZ(cofactor), primality == 'Probable prime')]
++                assert primality in ['Prime', 'Composite']
++                result += [(ZZ(cofactor), primality == 'Prime')]
+                 # assert len(result) == 2
+                 return result
+         raise ValueError('failed to parse ECM output')
+@@ -501,7 +498,6 @@
+         if factor_digits is not None:
+             B1 = self.recommended_B1(factor_digits)
+         kwds['one'] = True
+-        kwds['cofdec'] = True
+         cmd = self._make_cmd(B1, None, kwds)
+         out = self._run_ecm(cmd, n)
+         return self._parse_output(n, out)
+@@ -828,8 +828,8 @@
+ Step 1 took 12ms
+ Step 2 took 17ms
+ ********** Factor found in step 2: 79792266297612017
+-Found probable prime factor of 17 digits: 79792266297612017
+-Probable prime cofactor 6366805760909027985741435139224233 has 34 digits
++Found prime factor of 17 digits: 79792266297612017
++Prime cofactor 6366805760909027985741435139224233 has 34 digits
+ """
+ 
+ TEST_ECM_OUTPUT_2 = """
+@@ -839,8 +839,8 @@
+ Step 1 took 2ms
+ Step 2 took 3ms
+ ********** Factor found in step 2: 179424673
+-Found probable prime factor of  9 digits: 179424673
+-Probable prime cofactor 179424673 has 9 digits
++Found prime factor of  9 digits: 179424673
++Prime cofactor 179424673 has 9 digits
+ """
+ 
+ TEST_ECM_OUTPUT_3 = """
+@@ -858,7 +858,7 @@
+ Step 1 took 5ms
+ Step 2 took 4ms
+ ********** Factor found in step 2: 197002597249
+-Found probable prime factor of 12 digits: 197002597249
++Found prime factor of 12 digits: 197002597249
+ Composite cofactor 339872432034468861533158743041639097889948066859 has 48 digits
+ """
+ 
+@@ -870,5 +870,5 @@
+ Step 2 took 2ms
+ ********** Factor found in step 2: 265748496095531068869578877937
+ Found composite factor of 30 digits: 265748496095531068869578877937
+-Probable prime cofactor 251951573867253012259144010843 has 30 digits
++Prime cofactor 251951573867253012259144010843 has 30 digits
+ """
+

Copied: sagemath/repos/community-staging-i686/env.patch (from rev 233756, sagemath/trunk/env.patch)
===================================================================
--- community-staging-i686/env.patch	                        (rev 0)
+++ community-staging-i686/env.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,94 @@
+--- src/bin/sage-env.orig	2015-01-06 10:46:04.469687605 +0100
++++ src/bin/sage-env	2015-01-06 10:49:59.547762019 +0100
+@@ -110,41 +110,7 @@
+ }
+ 
+ 
+-# New value for SAGE_ROOT: either SAGE_ROOT (if given)
+-# or a guessed value based on pwd.
+-if [ -n "$SAGE_ROOT" ]; then
+-    NEW_SAGE_ROOT="$SAGE_ROOT"
+-elif [ -f sage -a -d build ]; then
+-    NEW_SAGE_ROOT="."
+-elif [ -f ../../sage -a -d ../../build ]; then
+-    NEW_SAGE_ROOT="../.."
+-else
+-    # No idea what SAGE_ROOT should be...
+-    echo >&2 "Error: You must set the SAGE_ROOT environment variable or run this"
+-    echo >&2 "script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory."
+-    return 1
+-fi
+-
+-# Make NEW_SAGE_ROOT absolute
+-NEW_SAGE_ROOT=`cd "$NEW_SAGE_ROOT" && pwd -P`
+-
+-# Sanity check NEW_SAGE_ROOT
+-if [ -f "$NEW_SAGE_ROOT/sage" -a -d "$NEW_SAGE_ROOT/build" ]; then
+-    :
+-else
+-    echo >&2 "Error: SAGE_ROOT is set to a bad value:"
+-    echo >&2 "SAGE_ROOT=$SAGE_ROOT"
+-    echo >&2 "You must correct it or erase it and run this script from the SAGE_ROOT"
+-    echo >&2 "or SAGE_ROOT/local/bin/ directory."
+-    return 1
+-fi
+-
+-# Warn if NEW_SAGE_ROOT does not equal the old SAGE_ROOT
+-if [ "$SAGE_ROOT" != "$NEW_SAGE_ROOT" -a -n "$SAGE_ROOT" ]; then
+-    echo >&2 "Warning: overwriting SAGE_ROOT environment variable:"
+-    echo >&2 "Old SAGE_ROOT=$SAGE_ROOT"
+-    echo >&2 "New SAGE_ROOT=$NEW_SAGE_ROOT"
+-fi
++NEW_SAGE_ROOT="/usr"
+ 
+ # Display the Sage startup banner, used in src/bin/sage
+ sage_banner() {
+@@ -187,7 +187,7 @@
+ 
+ # SAGE_LOCAL is the installation prefix and can be customized
+ if [ -z "$SAGE_LOCAL" ]; then
+-    export SAGE_LOCAL="$SAGE_ROOT/local"
++    export SAGE_LOCAL="/usr"
+ fi
+ 
+ # sage-env must know where the Sage's script files are
+@@ -233,8 +233,9 @@
+ export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
+ export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
+ export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
+-export SAGE_SRC="$SAGE_ROOT/src"
+-export SAGE_DOC_SRC="$SAGE_SRC/doc"
++export GAP_ROOT_DIR="/usr/lib/gap"
++export SAGE_SRC="$SAGE_SHARE/sage/source"
++export SAGE_DOC_SRC="$SAGE_SHARE/doc/sage"
+ export SAGE_DOC="$SAGE_SHARE/doc/sage"
+ 
+ if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
+@@ -374,6 +337,9 @@
+     export SAGE_STARTUP_FILE
+ fi
+ 
++export LIBMTX="$DOT_SAGE/meataxe"
++[[ -d $LIBMTX ]] || mkdir -p $LIBMTX # Create meataxe data dir
++
+ if [ -z "$IPYTHONDIR" ]; then
+     # We hardcode a version number in the directory name. The idea is
+     # that we keep using the same version number as long as that is
+@@ -468,7 +400,6 @@
+         fi
+     fi
+ fi
+-export MAXIMA_PREFIX="$SAGE_LOCAL"
+ 
+ PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB
+ 
+@@ -629,9 +608,6 @@
+     LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH
+ fi
+ 
+-# See trac 7186 -- this is needed if ecl is moved
+-ECLDIR="$SAGE_LOCAL/lib/ecl/" && export ECLDIR
+-
+ # Handle parallel building/testing/...
+ # See Trac Ticket #12016
+ # First, figure out the right values for SAGE_NUM_THREADS (default

Copied: sagemath/repos/community-staging-i686/fes02.patch (from rev 233756, sagemath/trunk/fes02.patch)
===================================================================
--- community-staging-i686/fes02.patch	                        (rev 0)
+++ community-staging-i686/fes02.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,57 @@
+From b1f5e3ecc789db674fe17552812f2d0e2ab84be0 Mon Sep 17 00:00:00 2001
+From: Charles Bouillaguet <charles.bouillaguet at lifl.fr>
+Date: Thu, 19 Sep 2013 10:31:11 +0200
+Subject: updating the libFES binding to match a change in the interface
+
+---
+ src/sage/libs/fes.pyx | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/sage/libs/fes.pyx b/src/sage/libs/fes.pyx
+index 40b9c23..d188cf0 100644
+--- a/src/sage/libs/fes.pyx
++++ b/src/sage/libs/fes.pyx
+@@ -1,17 +1,19 @@
+ """
+-Binding for the FES library.
++Binding for the libFES library.
+ 
+ Finding solutions of systems of boolean equations by exhaustive
+ search, via the fes library. This is usually (much) faster than
+ computing a Groebner basis, except in special cases where the latter
+ is particularly easy.
+ 
+-The FES library is presently only able to deal with polynomials in 64
++More information is available at [http://www.lifl.fr/~bouillag/fes].
++
++The libFES library is presently only able to deal with polynomials in 64
+ variables. Performing a full exhaustive search over 64 variables will
+ take a **long** time. The number of variables can be artificially
+ reduced to 64 by specializing some of them.
+ 
+-Note that the FES library **requires** at least of the equations to be
++Note that the libFES library **requires** at least of the equations to be
+ non-linear.
+ 
+ AUTHORS:
+@@ -71,7 +73,7 @@ from libc.stdint cimport uint64_t
+ cdef extern from "fes_interface.h":
+     ctypedef int (*solution_callback_t)(void *, uint64_t)
+ 
+-    void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose)
++    void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose, int T)
+ 
+ 
+ include 'sage/ext/interrupt.pxi'  #sig_on(), sig_off()
+@@ -219,7 +221,7 @@ def exhaustive_search(eqs,  max_sols=Infinity, verbose=False):
+ 
+     # ------- runs the library
+     sig_on()
+-    exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose)
++    exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose, 0)
+     sig_off()
+ 
+     # ------- frees memory occupied by the dense representation of the equations
+-- 
+cgit v1.0-1-gd88e
+

Copied: sagemath/repos/community-staging-i686/increase-rtol.patch (from rev 233756, sagemath/trunk/increase-rtol.patch)
===================================================================
--- community-staging-i686/increase-rtol.patch	                        (rev 0)
+++ community-staging-i686/increase-rtol.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,37 @@
+diff -ru sage-7.3.orig/src/sage/coding/code_bounds.py sage-7.3/src/sage/coding/code_bounds.py
+--- sage-7.3.orig/src/sage/coding/code_bounds.py        2016-08-05 20:26:10.033204091 +0200
++++ sage-7.3/src/sage/coding/code_bounds.py     2016-08-05 20:32:27.276579565 +0200
+@@ -554,7 +554,7 @@
+     if q < 2:   # Here we check that q is actually at least 2
+         raise ValueError("The value q must be an integer greater than 1")
+ 
+-    eps  = 4.5e-16 # find_root has about this as the default xtol
++    eps  = 4.5e-15 # find_root has about this as the default xtol
+     ymax = 1 - 1/q
+     if x <= eps:
+         return 0
+diff -ru sage-7.3.orig/src/sage/numerical/optimize.py sage-7.3/src/sage/numerical/optimize.py
+--- sage-7.3.orig/src/sage/numerical/optimize.py        2016-08-05 20:26:10.816536625 +0200
++++ sage-7.3/src/sage/numerical/optimize.py     2016-08-05 20:32:21.449907130 +0200
+@@ -15,7 +15,7 @@
+ from sage.rings.real_double import RDF
+ 
+ 
+-def find_root(f, a, b, xtol=10e-13, rtol=4.5e-16, maxiter=100, full_output=False):
++def find_root(f, a, b, xtol=10e-13, rtol=4.5e-15, maxiter=100, full_output=False):
+     """
+     Numerically find a root of ``f`` on the closed interval `[a,b]`
+     (or `[b,a]`) if possible, where ``f`` is a function in the one variable.
+diff -ru sage-7.3.orig/src/sage/symbolic/expression.pyx sage-7.3/src/sage/symbolic/expression.pyx
+--- sage-7.3.orig/src/sage/symbolic/expression.pyx      2016-08-05 20:26:11.333202767 +0200
++++ sage-7.3/src/sage/symbolic/expression.pyx   2016-08-05 20:32:14.236566826 +0200
+@@ -10884,7 +10884,7 @@
+             ret = ret[0]
+         return ret
+ 
+-    def find_root(self, a, b, var=None, xtol=10e-13, rtol=4.5e-16, maxiter=100, full_output=False):
++    def find_root(self, a, b, var=None, xtol=10e-13, rtol=4.5e-15, maxiter=100, full_output=False):
+         """
+         Numerically find a root of self on the closed interval [a,b] (or
+         [b,a]) if possible, where self is a function in the one variable.
+

Copied: sagemath/repos/community-staging-i686/jupyter-path.patch (from rev 233756, sagemath/trunk/jupyter-path.patch)
===================================================================
--- community-staging-i686/jupyter-path.patch	                        (rev 0)
+++ community-staging-i686/jupyter-path.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,22 @@
+--- src/sage/repl/ipython_kernel/install.py.orig	2015-10-23 19:23:39.728456590 +0000
++++ src/sage/repl/ipython_kernel/install.py	2015-10-23 19:24:00.965018978 +0000
+@@ -13,8 +13,7 @@
+     SAGE_ROOT, SAGE_DOC, SAGE_LOCAL, SAGE_EXTCODE,
+     SAGE_VERSION
+ )
+-from jupyter_core.paths import ENV_JUPYTER_PATH
+-JUPYTER_PATH = ENV_JUPYTER_PATH[0]
++JUPYTER_PATH = os.environ.get('JUPYTER_PATH') 
+ 
+ class SageKernelSpec(object):
+
+@@ -208,7 +208,7 @@
+             sage: spec._symlink_resources()    # not tested
+         """
+         path = os.path.join(SAGE_EXTCODE, 'notebook-ipython')
+-        for filename in os.listdir(path):
++        for filename in os.listdir('ext/notebook-ipython'):
+             self.symlink(
+                 os.path.join(path, filename),
+                 os.path.join(self.kernel_dir, filename)
+

Copied: sagemath/repos/community-staging-i686/latte-count.patch (from rev 233756, sagemath/trunk/latte-count.patch)
===================================================================
--- community-staging-i686/latte-count.patch	                        (rev 0)
+++ community-staging-i686/latte-count.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,84 @@
+diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py
+index 50d99f99e4..3a3a8cb214 100644
+--- a/src/sage/geometry/polyhedron/base.py
++++ b/src/sage/geometry/polyhedron/base.py
+@@ -4629,7 +4629,7 @@ class Polyhedron_base(Element):
+             ...
+             RuntimeError: LattE integrale program failed (exit code 1):
+             ...
+-            Invocation: count '--redundancy-check=none' --cdd /dev/stdin
++            Invocation: latte-count '--redundancy-check=none' --cdd /dev/stdin
+             ...
+             Parse error in CDD-style input file /dev/stdin
+             sage: Q.integral_points_count(verbose=True) # optional - latte_int
+diff --git a/src/sage/geometry/polyhedron/base_ZZ.py b/src/sage/geometry/polyhedron/base_ZZ.py
+index 268af9db0d..70d41dfa30 100644
+--- a/src/sage/geometry/polyhedron/base_ZZ.py
++++ b/src/sage/geometry/polyhedron/base_ZZ.py
+@@ -228,7 +228,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(maxdet=5, verbose=True)  # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd '--maxdet=5' /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd '--maxdet=5' /dev/stdin
+             ...
+             sage: p    # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -236,7 +236,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(dual=True, verbose=True)  # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --dual /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --dual /dev/stdin
+             ...
+             sage: p   # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -244,7 +244,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(irrational_primal=True, verbose=True)   # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-primal /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-primal /dev/stdin
+             ...
+             sage: p   # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -252,7 +252,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(irrational_all_primal=True, verbose=True)  # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-all-primal /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-all-primal /dev/stdin
+             ...
+             sage: p   # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -264,7 +264,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             ...
+             RuntimeError: LattE integrale program failed (exit code 1):
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd '--bim-bam-boum=19' /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd '--bim-bam-boum=19' /dev/stdin
+             Unknown command/option --bim-bam-boum=19
+         """
+         if self.is_empty():
+diff --git a/src/sage/interfaces/latte.py b/src/sage/interfaces/latte.py
+index 066cedd401..302b39910d 100644
+--- a/src/sage/interfaces/latte.py
++++ b/src/sage/interfaces/latte.py
+@@ -86,7 +86,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False,
+         sage: n = count(cddin, cdd=True, verbose=True, raw_output=True)  # optional - latte_int
+         This is LattE integrale ...
+         ...
+-        Invocation: count '--redundancy-check=none' --cdd /dev/stdin
++        Invocation: latte-count '--redundancy-check=none' --cdd /dev/stdin
+         ...
+         Total Unimodular Cones: ...
+         Maximum number of simplicial cones in memory at once: ...
+@@ -106,7 +106,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False,
+     from sage.misc.misc import SAGE_TMP
+     from sage.rings.integer import Integer
+ 
+-    args = ['count']
++    args = ['latte-count']
+     if ehrhart_polynomial and multivariate_generating_function:
+         raise ValueError
+     if ehrhart_polynomial:

Copied: sagemath/repos/community-staging-i686/package.patch (from rev 233756, sagemath/trunk/package.patch)
===================================================================
--- community-staging-i686/package.patch	                        (rev 0)
+++ community-staging-i686/package.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,38 @@
+--- src/sage/misc/package.py.orig	2014-11-23 15:58:13.000000000 +0100
++++ src/sage/misc/package.py	2015-01-22 20:32:25.651383902 +0100
+@@ -343,7 +343,7 @@
+         sage: for pkg in list_packages('pip', local=True):
+         ....:     assert not is_package_installed(pkg)
+     """
+-    return any(p.split('-')[0] == package for p in installed_packages(exclude_pip))
++    return True
+ 
+ def package_versions(package_type, local=False):
+     r"""
+--- src/sage_setup/optional_extension.py.orig  2016-10-19 18:35:10.092577510 +0000
++++ src/sage_setup/optional_extension.py       2016-10-19 18:38:13.514765366 +0000
+@@ -21,8 +21,6 @@
+ from distutils.extension import Extension
+ from sage.misc.package import is_package_installed, list_packages
+ 
+-all_packages = list_packages(local=True)
+-
+ 
+ class CythonizeExtension(Extension):
+     """
+@@ -76,14 +74,7 @@
+         condition = kwds.pop("condition")
+     except KeyError:
+         pkg = kwds.pop("package")
+-        try:
+-            pkginfo = all_packages[pkg]
+-        except KeyError:
+-            # Might be an installed old-style package
+-            condition = is_package_installed(pkg)
+-        else:
+-            condition = (pkginfo["installed_version"] == pkginfo["remote_version"])
+-
++        condition = True
+     if condition:
+         return Extension(*args, **kwds)
+     else:

Copied: sagemath/repos/community-staging-i686/r-no-readline.patch (from rev 233756, sagemath/trunk/r-no-readline.patch)
===================================================================
--- community-staging-i686/r-no-readline.patch	                        (rev 0)
+++ community-staging-i686/r-no-readline.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,11 @@
+--- a/src/sage/interfaces/r.py
++++ b/src/sage/interfaces/r.py
+@@ -331,7 +331,7 @@
+                   prompt = '> ', #default, later comes the change
+ 
+                   # This is the command that starts up your program
+-                  command = "R --vanilla --quiet",
++                  command = "R --no-readline --vanilla --quiet",
+ 
+                   server=server,
+                   server_tmpdir=server_tmpdir,

Copied: sagemath/repos/community-staging-i686/sagemath-planarity3.patch (from rev 233756, sagemath/trunk/sagemath-planarity3.patch)
===================================================================
--- community-staging-i686/sagemath-planarity3.patch	                        (rev 0)
+++ community-staging-i686/sagemath-planarity3.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,113 @@
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: https://trac.sagemath.org/ticket/21774
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage/graphs/planarity.pyx
++++ b/sage/src/sage/graphs/planarity.pyx
+@@ -3,13 +3,19 @@
+ """
+ 
+ cdef extern from "planarity/graph.h":
+-    ctypedef struct graphNode:
+-        int v
++    ctypedef struct vertexRec:
+         int link[2]
+-    ctypedef graphNode * graphNodeP
++        int index
++    ctypedef vertexRec * vertexRecP
++
++    ctypedef struct edgeRec:
++        int link[2]
++        int neighbor
++    ctypedef edgeRec * edgeRecP
+ 
+     ctypedef struct BM_graph:
+-        graphNodeP G
++        vertexRecP V
++        edgeRecP E
+         int N
+     ctypedef BM_graph * graphP
+ 
+@@ -93,15 +99,16 @@
+             g._pos = { u: [0,0], v: [0,1] }
+         return (True, None) if kuratowski else True
+ 
+-    # create to and from mappings to relabel vertices to the set {0,...,n-1}
++    # create to and from mappings to relabel vertices to the set {1,...,n}
++    # (planarity 3 uses 1-based array indexing, with 0 representing NIL)
+     cdef int i
+     listto = g.vertices()
+     ffrom = {}
+     for vvv in listto:
+-        ffrom[vvv] = listto.index(vvv)
++        ffrom[vvv] = listto.index(vvv) + 1
+     to = {}
+     for i from 0 <= i < len(listto):
+-        to[i] = listto[i]
++        to[i + 1] = listto[i]
+     g.relabel(ffrom)
+ 
+     cdef graphP theGraph
+@@ -125,7 +132,7 @@
+     status = gp_Embed(theGraph, EMBEDFLAGS_PLANAR)
+     gp_SortVertices(theGraph)
+ 
+-    # use to and from mappings to relabel vertices back from the set {0,...,n-1}
++    # use to and from mappings to relabel vertices back from the set {1,...,n}
+     g.relabel(to)
+ 
+     if status == NOTOK:
+@@ -134,12 +141,12 @@
+         # Kuratowski subgraph isolator
+         g_dict = {}
+         from sage.graphs.graph import Graph
+-        for i from 0 <= i < theGraph.N:
++        for i from 0 < i <= theGraph.N:
+             linked_list = []
+-            j = theGraph.G[i].link[1]
+-            while j >= theGraph.N:
+-                linked_list.append(to[theGraph.G[j].v])
+-                j = theGraph.G[j].link[1]
++            j = theGraph.V[i].link[1]
++            while j:
++                linked_list.append(to[theGraph.E[j].neighbor])
++                j = theGraph.E[j].link[1]
+             if len(linked_list) > 0:
+                 g_dict[to[i]] = linked_list
+         G = Graph(g_dict)
+@@ -153,12 +160,12 @@
+             if set_embedding:
+                 emb_dict = {}
+                 #for i in range(theGraph.N):
+-                for i from 0 <= i < theGraph.N:
++                for i from 0 < i <= theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[1]
+-                    while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[1]
++                    j = theGraph.V[i].link[1]
++                    while j:
++                        linked_list.append(to[theGraph.E[j].neighbor])
++                        j = theGraph.E[j].link[1]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+             if set_pos:
+@@ -174,12 +181,12 @@
+ 
+                 emb_dict = {}
+                 #for i in range(theGraph.N):
+-                for i from 0 <= i < theGraph.N:
++                for i from 0 < i <= theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[0]
+-                    while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[0]
++                    j = theGraph.V[i].link[0]
++                    while j:
++                        linked_list.append(to[theGraph.E[j].neighbor])
++                        j = theGraph.E[j].link[0]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+         gp_Free(&theGraph)

Copied: sagemath/repos/community-staging-i686/sagemath-pynac-0.7.6.patch (from rev 233756, sagemath/trunk/sagemath-pynac-0.7.6.patch)
===================================================================
--- community-staging-i686/sagemath-pynac-0.7.6.patch	                        (rev 0)
+++ community-staging-i686/sagemath-pynac-0.7.6.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,44 @@
+diff --git a/src/sage/libs/pynac/pynac.pxd b/src/sage/libs/pynac/pynac.pxd
+index 15e8ac2..568dbd6 100644
+--- a/src/sage/libs/pynac/pynac.pxd
++++ b/src/sage/libs/pynac/pynac.pxd
+@@ -319,7 +319,7 @@ cdef extern from "sage/libs/pynac/wrap.h":
+ 
+ 
+     GEx g_abs "GiNaC::abs" (GEx x)                      except + # absolute value
+-    GEx g_step "GiNaC::step" (GEx x)                    except + # step function
++    GEx g_step "GiNaC::unit_step" (GEx x)               except + # step function
+     GEx g_csgn "GiNaC::csgn" (GEx x)                    except + # complex sign
+     GEx g_conjugate "GiNaC::conjugate_function" (GEx x) except + # complex conjugation
+     GEx g_real_part "GiNaC::real_part_function" (GEx x) except + # real part
+diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
+index 01319b5..735d6fa 100644
+--- a/src/sage/symbolic/expression.pyx
++++ b/src/sage/symbolic/expression.pyx
+@@ -7018,7 +7018,7 @@ cdef class Expression(CommutativeRingElement):
+     def step(self, hold=False):
+         """
+         Return the value of the Heaviside step function, which is 0 for
+-        negative x, 1/2 for 0, and 1 for positive x.
++        negative x, 1 for 0, and 1 for positive x.
+ 
+         EXAMPLES::
+ 
+@@ -7026,7 +7026,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: SR(1.5).step()
+             1
+             sage: SR(0).step()
+-            1/2
++            1
+             sage: SR(-1/2).step()
+             0
+             sage: SR(float(-1)).step()
+@@ -7038,7 +7038,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: SR(2).step()
+             1
+             sage: SR(2).step(hold=True)
+-            step(2)
++            unit_step(2)
+ 
+         """
+         return new_Expression_from_GEx(self._parent,

Copied: sagemath/repos/community-staging-i686/sagemath-python3-notebook.patch (from rev 233756, sagemath/trunk/sagemath-python3-notebook.patch)
===================================================================
--- community-staging-i686/sagemath-python3-notebook.patch	                        (rev 0)
+++ community-staging-i686/sagemath-python3-notebook.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,27 @@
+diff --git a/src/bin/sage-notebook b/src/bin/sage-notebook
+index 74192da240..0ede281aad 100755
+--- a/src/bin/sage-notebook
++++ b/src/bin/sage-notebook
+@@ -96,8 +96,7 @@ class NotebookJupyter(object):
+         if not have_prerequisites():
+             print(self.PREREQUISITE_ERROR)
+             raise SystemExit(1)
+-        from notebook.notebookapp import main
+-        main(argv)
++        os.execvp('jupyter-notebook', ['jupyter-notebook'] + argv)
+ 
+ 
+ class SageNBExport(NotebookJupyter):
+diff --git a/src/sage/repl/ipython_kernel/install.py b/src/sage/repl/ipython_kernel/install.py
+index 3912b8cdf5..bd40cdadda 100644
+--- a/src/sage/repl/ipython_kernel/install.py
++++ b/src/sage/repl/ipython_kernel/install.py
+@@ -281,7 +281,6 @@ def have_prerequisites(debug=True):
+         True
+     """
+     try:
+-        from notebook.notebookapp import NotebookApp
+         return True
+     except ImportError:
+         if debug:
+

Copied: sagemath/repos/community-staging-i686/sagemath-singular-4.1.0.p2.patch (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p2.patch)
===================================================================
--- community-staging-i686/sagemath-singular-4.1.0.p2.patch	                        (rev 0)
+++ community-staging-i686/sagemath-singular-4.1.0.p2.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,777 @@
+diff --git a/src/doc/de/tutorial/interfaces.rst b/src/doc/de/tutorial/interfaces.rst
+index edc59c5..83a8a8b 100644
+--- a/src/doc/de/tutorial/interfaces.rst
++++ b/src/doc/de/tutorial/interfaces.rst
+@@ -198,7 +198,7 @@ Sages Singular-Schnittstelle (ohne die ``....:``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst
+index f7e663d..a312548 100644
+--- a/src/doc/en/constructions/algebraic_geometry.rst
++++ b/src/doc/en/constructions/algebraic_geometry.rst
+@@ -164,7 +164,7 @@ Other methods
+        sage: klein1 = f.Adj_div(); print(klein1)
+        [1]:
+           [1]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 2
+        //        block   1 : ordering lp
+        //                  : names    x y
+@@ -187,13 +187,13 @@ Other methods
+        sage: print(klein1)
+        [1]:
+           [1]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 2
+        //        block   1 : ordering lp
+        //                  : names    x y
+        //        block   2 : ordering C
+           [2]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 3
+        //        block   1 : ordering lp
+        //                  : names    x y z
+@@ -210,7 +210,7 @@ Other methods
+        [5]:
+           [1]:
+              [1]:
+-                //   characteristic : 2
++                //   coefficients: ZZ/2
+        //   number of vars : 3
+        //        block   1 : ordering ls
+        //                  : names    x y t
+@@ -325,7 +325,7 @@ Singular itself to help an understanding of how the wrapper works.
+        sage: X = Curve(f); pts = X.rational_points()
+        sage: D = X.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ])
+        sage: X.riemann_roch_basis(D)
+-       [(-2*x + y)/(x + y), (-x + z)/(x + y)]
++       [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)]
+ 
+ -  Using Singular's ``BrillNoether`` command (for details see the section
+    Brill-Noether in the Singular online documentation
+diff --git a/src/doc/en/constructions/rings.rst b/src/doc/en/constructions/rings.rst
+index 58abf8a..076184e 100644
+--- a/src/doc/en/constructions/rings.rst
++++ b/src/doc/en/constructions/rings.rst
+@@ -57,7 +57,7 @@ Here's an example using the Singular interface:
+     sage: I = singular.ideal(['a+b+c+d', 'ab+ad+bc+cd', 'abc+abd+acd+bcd', 'abcd-1'])
+     sage: R
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 97
++    //   coefficients: ZZ/97
+     //   number of vars : 4
+     //        block   1 : ordering lp
+     //                  : names    a b c d
+diff --git a/src/doc/en/developer/coding_in_other.rst b/src/doc/en/developer/coding_in_other.rst
+index 640c8ac..b1728ea 100644
+--- a/src/doc/en/developer/coding_in_other.rst
++++ b/src/doc/en/developer/coding_in_other.rst
+@@ -402,7 +402,7 @@ interface to Singular::
+     sage: singular.LIB("brnoeth.lib")
+     sage: singular.ring(5,'(x,y)','lp')
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 5
++        //   coefficients: ZZ/5
+         //   number of vars : 2
+         //        block   1 : ordering lp
+         //                  : names    x y
+diff --git a/src/doc/en/tutorial/interfaces.rst b/src/doc/en/tutorial/interfaces.rst
+index 5a27631..ca7ae7a 100644
+--- a/src/doc/en/tutorial/interfaces.rst
++++ b/src/doc/en/tutorial/interfaces.rst
+@@ -197,7 +197,7 @@ Singular (do not type the ``....:``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/fr/tutorial/interfaces.rst b/src/doc/fr/tutorial/interfaces.rst
+index 75f36a4..8109a67 100644
+--- a/src/doc/fr/tutorial/interfaces.rst
++++ b/src/doc/fr/tutorial/interfaces.rst
+@@ -199,7 +199,7 @@ fournie par Sage (n'entrez pas les ``....:``) :
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/ja/tutorial/interfaces.rst b/src/doc/ja/tutorial/interfaces.rst
+index 560032a..6438103 100644
+--- a/src/doc/ja/tutorial/interfaces.rst
++++ b/src/doc/ja/tutorial/interfaces.rst
+@@ -173,7 +173,7 @@ Singularは,グレブナー基底,多変数多項式のgcd,平面曲線の
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/pt/tutorial/interfaces.rst b/src/doc/pt/tutorial/interfaces.rst
+index 5f611f8..4539bf6 100644
+--- a/src/doc/pt/tutorial/interfaces.rst
++++ b/src/doc/pt/tutorial/interfaces.rst
+@@ -197,7 +197,7 @@ digite ``...``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y 
+diff --git a/src/doc/ru/tutorial/interfaces.rst b/src/doc/ru/tutorial/interfaces.rst
+index 234731a..bc2983c 100644
+--- a/src/doc/ru/tutorial/interfaces.rst
++++ b/src/doc/ru/tutorial/interfaces.rst
+@@ -191,7 +191,7 @@ Singular предоставляет массивную и продуманную
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py
+index cd8b9db..cccc344 100644
+--- a/src/sage/categories/pushout.py
++++ b/src/sage/categories/pushout.py
+@@ -3202,7 +3202,7 @@ class BlackBoxConstructionFunctor(ConstructionFunctor):
+         Gap
+         sage: FS(QQ['t'])
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 0
++        //   coefficients: QQ
+         //   number of vars : 1
+         //        block   1 : ordering lp
+         //                  : names    t
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 6a44b29..9a9ed5e 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -1216,7 +1216,7 @@ If this all works, you can then make calls like:
+             sage: R.<x> = QQ[]; f = x^3 + x + 1;  g = x^3 - x - 1; r = f.resultant(g); gap(ZZ); singular(R)
+             Integers
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py
+index e4cfe51..2865c70 100644
+--- a/src/sage/interfaces/interface.py
++++ b/src/sage/interfaces/interface.py
+@@ -735,7 +735,7 @@ class InterfaceElement(Element):
+             sage: S = singular.ring(0, ('x'))
+             sage: loads(dumps(S))
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py
+index 2af7bc1..43745a2 100644
+--- a/src/sage/interfaces/singular.py
++++ b/src/sage/interfaces/singular.py
+@@ -65,7 +65,7 @@ factorization::
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+@@ -243,7 +243,7 @@ Groebner basis for some ideal, using Singular through Sage.
+     sage: singular.lib('poly.lib')
+     sage: singular.ring(32003, '(a,b,c,d,e,f)', 'lp')
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 32003
++            //   coefficients: ZZ/32003
+             //   number of vars : 6
+             //        block   1 : ordering lp
+             //                        : names    a b c d e f
+@@ -1000,7 +1000,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: R = singular.ring(0, '(x,y,z)', 'dp')
+             sage: R
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1080,7 +1080,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: S = singular.ring('real', '(a,b)', 'lp')
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a b
+@@ -1088,7 +1088,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: singular.set_ring(R)
+             sage: singular.current_ring()
+             polynomial ring, over a field, local ordering
+-            //   characteristic : 7
++            //   coefficients: ZZ/7
+             //   number of vars : 2
+             //        block   1 : ordering ds
+             //                  : names    a b
+@@ -1130,14 +1130,14 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: r = PolynomialRing(GF(127),3,'xyz', order='invlex')
+             sage: r._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 3
+             //        block   1 : ordering rp
+             //                  : names    x y z
+             //        block   2 : ordering C
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 3
+             //        block   1 : ordering rp
+             //                  : names    x y z
+@@ -1360,7 +1360,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: cpQ.set_ring()
+             sage: cpQ
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1911,7 +1911,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+ 
+             sage: singular('basering')
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 3
+             //        block   1 : ordering lp
+             //                  : names    x y z
+@@ -1996,7 +1996,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: S = singular.ring('real', '(a,b)', 'lp')
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a b
+@@ -2004,7 +2004,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: R.set_ring()
+             sage: singular.current_ring()
+             polynomial ring, over a field, local ordering
+-            //   characteristic : 7
++            //   coefficients: ZZ/7
+             //   number of vars : 2
+             //        block   1 : ordering ds
+             //                  : names    a b
+@@ -2260,7 +2260,7 @@ def reduce_load():
+ 
+         sage: loads(dumps(singular.ring()))
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 0
++        //   coefficients: QQ
+         //   number of vars : 1
+         //        block   1 : ordering lp
+         //                  : names    x
+diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
+index 4afc0cc..2dec5d8 100644
+--- a/src/sage/libs/singular/decl.pxd
++++ b/src/sage/libs/singular/decl.pxd
+@@ -484,8 +484,8 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     ring *rDefault(int char , int nvars, char **names)
+     ring *rDefault(const n_Procs_s* cf, int nvars, char **names)
+-    ring *rDefault(int ch             , int nvars, char **names,int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
+-    ring *rDefault(const n_Procs_s* cf, int nvars, char **names,int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
++    ring *rDefault(int ch             , int nvars, char **names,int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl)
++    ring *rDefault(const n_Procs_s* cf, int nvars, char **names,int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl)
+ 
+ 
+ 
+diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
+index 2813a6f..0f3b76f 100644
+--- a/src/sage/libs/singular/function.pyx
++++ b/src/sage/libs/singular/function.pyx
+@@ -282,7 +282,7 @@ cdef class RingWrap:
+             sage: l = ringlist(P)
+             sage: ring = singular_function("ring")
+             sage: ring(l, ring=P)._output()
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+diff --git a/src/sage/libs/singular/ring.pyx b/src/sage/libs/singular/ring.pyx
+index 4a6e167..f221132 100644
+--- a/src/sage/libs/singular/ring.pyx
++++ b/src/sage/libs/singular/ring.pyx
+@@ -21,7 +21,7 @@ from sage.libs.gmp.mpz cimport mpz_init_set_ui, mpz_init_set
+ from sage.libs.singular.decl cimport number, poly, ring, currRing
+ from sage.libs.singular.decl cimport rChangeCurrRing, rCopy0, rComplete, rDelete, idInit
+ from sage.libs.singular.decl cimport omAlloc0, omStrDup, omAlloc, omAlloc0Bin,  sip_sring_bin, rnumber_bin
+-from sage.libs.singular.decl cimport ringorder_dp, ringorder_Dp, ringorder_lp, ringorder_rp, ringorder_ds, ringorder_Ds, ringorder_ls, ringorder_M, ringorder_C, ringorder_wp, ringorder_Wp, ringorder_ws, ringorder_Ws, ringorder_a
++from sage.libs.singular.decl cimport ringorder_dp, ringorder_Dp, ringorder_lp, ringorder_rp, ringorder_ds, ringorder_Ds, ringorder_ls, ringorder_M, ringorder_C, ringorder_wp, ringorder_Wp, ringorder_ws, ringorder_Ws, ringorder_a, rRingOrder_t
+ from sage.libs.singular.decl cimport p_Copy, prCopyR
+ from sage.libs.singular.decl cimport n_unknown,  n_Zp,  n_Q,   n_R,   n_GF,  n_long_R,  n_algExt,n_transExt,n_long_C,   n_Z,   n_Zn,  n_Znm,  n_Z2m,  n_CF
+ from sage.libs.singular.decl cimport n_coeffType, cfInitCharProc
+@@ -165,7 +165,7 @@ cdef ring *singular_ring_new(base_ring, n, names, term_order) except NULL:
+     ##         q    q : GF(q=p^n)       *names         TRUE              (todo)
+ 
+     _wvhdl  = <int **>omAlloc0((nblcks + 2) * sizeof(int *))
+-    _order  = <int *>omAlloc0((nblcks + 2) * sizeof(int))
++    _order  = <rRingOrder_t *>omAlloc0((nblcks + 2) * sizeof(int))
+     _block0 = <int *>omAlloc0((nblcks + 2) * sizeof(int))
+     _block1 = <int *>omAlloc0((nblcks + 2) * sizeof(int))
+ 
+diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py
+index eeafd87..c79ff28 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_element.py
++++ b/src/sage/rings/polynomial/multi_polynomial_element.py
+@@ -1994,7 +1994,7 @@ def degree_lowest_rational_function(r,x):
+     ::
+ 
+         sage: r = f/g; r
+-        (-2*b*c^2 - 1)/(2*a*b^3*c^6 + a*c)
++        (-b*c^2 + 2)/(a*b^3*c^6 - 2*a*c)
+         sage: degree_lowest_rational_function(r,a)
+         (-1, 3)
+         sage: degree_lowest_rational_function(r,b)
+diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+index 06ffc67..21f60c0 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+@@ -190,7 +190,7 @@ when the system has no solutions over the rationals.
+     The Groebner basis modulo any product of the prime factors is also non-trivial::
+ 
+         sage: I.change_ring(P.change_ring( IntegerModRing(2*7) )).groebner_basis()
+-        [x + 3*y + 11*z, y^2 + 3*y, y*z + 11*y + 4, 2*y + 6, z^2 + 3, 2*z + 10]
++        [x + 9*y + 13*z, y^2 + 3*y, y*z + 7*y + 6, 2*y + 6, z^2 + 3, 2*z + 10]
+ 
+     Modulo any other prime the Groebner basis is trivial so there are
+     no other solutions. For example::
+@@ -3646,11 +3646,13 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \
+             sage: P.<a,b,c> = PolynomialRing(Zmod(1000),3)
+             sage: I = P * (a + 2*b + 2*c - 1, a^2 - a + 2*b^2 + 2*c^2, 2*a*b + 2*b*c - b)
+             sage: I.groebner_basis()
+-            [b*c^2 + 992*b*c + 712*c^2 + 332*b + 96*c,
+-             2*c^3 + 214*b*c + 862*c^2 + 762*b + 268*c,
++            [b*c^2 + 732*b*c + 808*b,
++             2*c^3 + 884*b*c + 666*c^2 + 320*b,
+              b^2 + 438*b*c + 281*b,
+              5*b*c + 156*c^2 + 112*b + 948*c,
+-             50*c^2 + 600*b + 650*c, a + 2*b + 2*c + 999, 125*b]
++             50*c^2 + 600*b + 650*c,
++             a + 2*b + 2*c + 999,
++             125*b]
+ 
+         ::
+ 
+diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+index 947eeb2..220e4d3 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+@@ -594,7 +594,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+ 
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1182,7 +1182,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = QQ[]
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1198,9 +1198,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = PolynomialRing(k,3)
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 3
+-            //   1 parameter    : a
+-            //   minpoly        : (a^3-a+1)
++            //   coefficients: ZZ/3[a]/(a^3-a+1)
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1216,7 +1214,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x> = QQ[]
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1256,7 +1254,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = QQ[]
+             sage: P._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1271,9 +1269,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R.<x,y> = PolynomialRing(NumberField(w^2+1,'s'))
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   1 parameter    : s
+-            //   minpoly        : (s^2+1)
++            //   coefficients: QQ[s]/(s^2+1)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1282,9 +1278,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(2**8,'a'),10,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
+-            //   1 parameter    : a
+-            //   minpoly        : (a^8+a^4+a^3+a^2+1)
++            //   coefficients: ZZ/2[a]/(a^8+a^4+a^3+a^2+1)
+             //   number of vars : 10
+             //        block   1 : ordering rp
+             //                  : names    x0 x1 x2 x3 x4 x5 x6 x7 x8 x9
+@@ -1293,7 +1287,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(127),2,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 2
+             //        block   1 : ordering rp
+             //                  : names    x0 x1
+@@ -1302,7 +1296,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,2,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering rp
+             //                  : names    x0 x1
+@@ -1311,7 +1305,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,2,'x', order='degneglex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering a
+             //                  : names    x0 x1
+@@ -1323,7 +1317,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1332,7 +1326,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(127),'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1341,7 +1335,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = ZZ['x,y']
+             sage: singular(R)
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1350,7 +1344,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : Z/2^10
++            //   coefficients: Z/2^10
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1359,7 +1353,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(15)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : ZZ/15
++            //   coefficients: ZZ/bigint(15)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1370,7 +1364,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x> = QQ[]
+             sage: P._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/rings/polynomial/pbori.pyx b/src/sage/rings/polynomial/pbori.pyx
+index 23c346e..812f3b9 100644
+--- a/src/sage/rings/polynomial/pbori.pyx
++++ b/src/sage/rings/polynomial/pbori.pyx
+@@ -1410,7 +1410,7 @@ cdef class BooleanPolynomialRing(MPolynomialRing_generic):
+             sage: B.<x,y> = BooleanPolynomialRing(2)
+             sage: B._singular_() # indirect doctest
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
++            //   coefficients: ZZ/2
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    x y
+diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring.py b/src/sage/rings/polynomial/polynomial_quotient_ring.py
+index d5db40b..28fa62b 100644
+--- a/src/sage/rings/polynomial/polynomial_quotient_ring.py
++++ b/src/sage/rings/polynomial/polynomial_quotient_ring.py
+@@ -612,7 +612,7 @@ class PolynomialQuotientRing_generic(CommutativeRing):
+             sage: Q = P.quo([(x^2+1)])
+             sage: singular(Q)        # indirect doctest
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    xbar
+diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
+index 3f0d1d0..1230a5e 100644
+--- a/src/sage/rings/polynomial/polynomial_singular_interface.py
++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
+@@ -81,9 +81,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x,y> = PolynomialRing(CC,'x',2)
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (complex:15 digits, additional 0 digits)
+-            //   1 parameter    : I
+-            //   minpoly        : (I^2+1)
++            //   coefficients: float[I](complex:15 digits, additional 0 digits)/(I^2+1)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -91,7 +89,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x,y> = PolynomialRing(RealField(100),'x',2)
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -101,9 +99,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x> = PolynomialRing(NumberField(w^2+1,'s'))
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   1 parameter    : s
+-            //   minpoly        : (s^2+1)
++            //   coefficients: QQ[s]/(s^2+1)
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -112,7 +108,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(GF(127),1,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -121,7 +117,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(QQ,1,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -130,7 +126,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(QQ,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -139,7 +135,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(GF(127),'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -148,9 +144,7 @@ class PolynomialRing_singular_repr:
+             sage: R = Frac(ZZ['a,b'])['x,y']
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   2 parameter    : a b
+-            //   minpoly        : 0
++            //   coefficients: QQ(a, b)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -160,7 +154,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : Z/2^10
++            //   coefficients: Z/2^10
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -169,7 +163,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(15)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : ZZ/15
++            //   coefficients: ZZ/bigint(15)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -178,7 +172,7 @@ class PolynomialRing_singular_repr:
+             sage: R = ZZ['x,y']
+             sage: singular(R)
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -190,9 +184,7 @@ class PolynomialRing_singular_repr:
+             sage: S = K['y']
+             sage: singular(S)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 5
+-            //   1 parameter    : x
+-            //   minpoly        : 0
++            //   coefficients: ZZ/5(x)
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a y
+@@ -234,7 +226,7 @@ class PolynomialRing_singular_repr:
+ 
+             sage: PolynomialRing(QQ,'u_ba')._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    u_ba
+diff --git a/src/sage/rings/polynomial/term_order.py b/src/sage/rings/polynomial/term_order.py
+index 213a36c..c169f33 100644
+--- a/src/sage/rings/polynomial/term_order.py
++++ b/src/sage/rings/polynomial/term_order.py
+@@ -1756,7 +1756,7 @@ class TermOrder(SageObject):
+             '(lp(3),Dp(5),lp(2))'
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 10
+             //        block   1 : ordering lp
+             //                  : names    x0 x1 x2
+@@ -1784,7 +1784,7 @@ class TermOrder(SageObject):
+             '(a(1:2),ls(2),a(1:2),ls(2))'
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 4
+             //        block   1 : ordering a
+             //                  : names    x0 x1
+diff --git a/src/sage/rings/quotient_ring.py b/src/sage/rings/quotient_ring.py
+index a670513..d78fb70 100644
+--- a/src/sage/rings/quotient_ring.py
++++ b/src/sage/rings/quotient_ring.py
+@@ -1174,7 +1174,7 @@ class QuotientRing_nc(ring.Ring, sage.structure.parent_gens.ParentWithGens):
+             sage: S = R.quotient_ring(x^2+y^2)
+             sage: S._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+diff --git a/src/sage/rings/quotient_ring_element.py b/src/sage/rings/quotient_ring_element.py
+index e6565a7..d5bd037 100644
+--- a/src/sage/rings/quotient_ring_element.py
++++ b/src/sage/rings/quotient_ring_element.py
+@@ -786,7 +786,7 @@ class QuotientRingElement(RingElement):
+             sage: Q = P.quo(I)
+             sage: Q._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
++            //   coefficients: ZZ/2
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+diff --git a/src/sage/schemes/affine/affine_morphism.py b/src/sage/schemes/affine/affine_morphism.py
+index d061b40..611b274 100644
+--- a/src/sage/schemes/affine/affine_morphism.py
++++ b/src/sage/schemes/affine/affine_morphism.py
+@@ -670,7 +670,7 @@ class SchemeMorphism_polynomial_affine_space(SchemeMorphism_polynomial):
+             sage: H = Hom(A,A)
+             sage: F = H([1/2*x^2 + sqrt(3)])
+             sage: F.dynatomic_polynomial([1,1])
+-            (2.00000000000000*x^4 + 5.85640646055102*x^2 + 24.0000000000000)/(x^2 + (-2.00000000000000)*x + 3.46410161513775)
++            (0.125000000000000*x^4 + 0.366025403784439*x^2 + 1.50000000000000)/(0.500000000000000*x^2 - x + 1.73205080756888)
+         """
+         if self.domain() != self.codomain():
+             raise TypeError("must have same domain and codomain to iterate")
+diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py
+index e2de777..0e88d70 100644
+--- a/src/sage/schemes/curves/projective_curve.py
++++ b/src/sage/schemes/curves/projective_curve.py
+@@ -1830,7 +1830,7 @@ class ProjectivePlaneCurve_prime_finite_field(ProjectivePlaneCurve_finite_field)
+             sage: C = Curve(f); pts = C.rational_points()
+             sage: D = C.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ])
+             sage: C.riemann_roch_basis(D)
+-            [(-2*x + y)/(x + y), (-x + z)/(x + y)]
++            [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)]
+ 
+ 
+         .. NOTE::

Copied: sagemath/repos/community-staging-i686/sagemath-singular-4.1.0.p3.patch (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p3.patch)
===================================================================
--- community-staging-i686/sagemath-singular-4.1.0.p3.patch	                        (rev 0)
+++ community-staging-i686/sagemath-singular-4.1.0.p3.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,118 @@
+diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
+index 2dec5d8..676544a 100644
+--- a/src/sage/libs/singular/decl.pxd
++++ b/src/sage/libs/singular/decl.pxd
+@@ -534,6 +534,9 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     int rRing_has_Comp(ring *r)
+ 
++    int rHasGlobalOrdering(ring *r)
++    int rHasLocalOrMixedOrdering(ring *r)
++
+     # return new empty monomial
+ 
+     poly *p_Init(ring *r)
+@@ -598,7 +601,7 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     # homogenizes p by multiplying certain powers of the varnum-th variable
+ 
+-    poly *pHomogen (poly *p, int varnum)
++    poly *p_Homogen (poly *p, int varnum, ring *r)
+ 
+     # return whether a polynomial is homogenous
+ 
+@@ -710,7 +713,7 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     # inverse of poly, if possible
+ 
+-    poly *pInvers(int n, poly *, intvec *)
++    poly *p_Series(int n, poly *, poly *, intvec *, ring *r)
+ 
+     # gcd of f and g
+ 
+@@ -766,6 +769,10 @@ cdef extern from "singular/Singular/libsingular.h":
+     # Copy this number
+     number *n_Copy(number *n, ring* r)
+ 
++    # Invert this number
++    int n_IsUnit(number *n, const n_Procs_s *cf)
++    number *n_Invers(number *n, const n_Procs_s *cf)
++
+     # rational number from int
+ 
+     number *nlInit(int)
+diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+index ffc6787..656acc9 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+@@ -186,12 +186,13 @@ from sage.libs.singular.decl cimport n_unknown,  n_Zp,  n_Q,   n_R,   n_GF,  n_l
+ # singular functions
+ from sage.libs.singular.decl cimport (
+     errorreported,
++    n_IsUnit, n_Invers,
+     p_ISet, rChangeCurrRing, p_Copy, p_Init, p_SetCoeff, p_Setm, p_SetExp, p_Add_q,
+     p_NSet, p_GetCoeff, p_Delete, p_GetExp, pNext, rRingVar, omAlloc0, omStrDup,
+     omFree, pDivide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy,
+     pDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy,
+-    p_IsUnit, pInvers, p_Head, idInit, fast_map_common_subexp, id_Delete,
+-    p_IsHomogeneous, pHomogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
++    p_IsUnit, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
++    p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
+     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
+     p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
+     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
+@@ -1353,7 +1354,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coefficients: Z/2^10
++            //   coefficients: ZZ/(2^10)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -3112,11 +3113,11 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
+         cdef ring *_ring = self._parent_ring
+         if(_ring != currRing): rChangeCurrRing(_ring)
+ 
+-        if not p_IsUnit(self._poly, _ring):
++        if not (p_IsUnit(self._poly,_ring)):
+             raise ArithmeticError("Element is not a unit.")
+ 
+         sig_on()
+-        cdef MPolynomial_libsingular r = new_MP(self._parent, pInvers(0, self._poly, NULL))
++        cdef MPolynomial_libsingular r = new_MP(self._parent, p_NSet(n_Invers(p_GetCoeff(self._poly, _ring),_ring.cf),_ring))
+         sig_off()
+         return r
+ 
+@@ -3171,14 +3172,17 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
+ 
+         SEE: ``self.homogenize``
+         """
++        cdef ring *_ring = self._parent_ring
+         cdef MPolynomialRing_libsingular parent = self._parent
+         cdef MPolynomial_libsingular f
+ 
+         if self.is_homogeneous():
+             return self
+ 
++        if(_ring != currRing): rChangeCurrRing(_ring)
++
+         if var < parent._ring.N:
+-            return new_MP(parent, pHomogen(p_Copy(self._poly, self._parent_ring), var+1))
++            return new_MP(parent, p_Homogen(self._poly, var+1, _ring))
+         else:
+             raise TypeError("var must be < self.parent().ngens()")
+ 
+diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
+index 1230a5e..1eb2566 100644
+--- a/src/sage/rings/polynomial/polynomial_singular_interface.py
++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
+@@ -154,7 +154,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coefficients: Z/2^10
++            //   coefficients: ZZ/(2^10)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y

Copied: sagemath/repos/community-staging-i686/skip-check.patch (from rev 233756, sagemath/trunk/skip-check.patch)
===================================================================
--- community-staging-i686/skip-check.patch	                        (rev 0)
+++ community-staging-i686/skip-check.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,22 @@
+--- src/bin/sage.orig	2014-12-18 09:47:27.354829070 +0100
++++ src/bin/sage	2014-12-18 09:48:00.041563401 +0100
+@@ -352,18 +352,6 @@
+ 
+ # Prepare for running Sage, either interactively or non-interactively.
+ sage_setup() {
+-    # Check that we're not in a source tarball which hasn't been built yet (#13561).
+-    if [ ! -d "$SAGE_LOCAL/lib/python/site-packages/sage" ]; then
+-        echo >&2 '************************************************************************'
+-        echo >&2 'It seems that you are attempting to run Sage from an unpacked source'
+-        echo >&2 'tarball, but you have not compiled it yet (or maybe the build has not'
+-        echo >&2 'finished). You should run `make` in the Sage root directory first.'
+-        echo >&2 'If you did not intend to build Sage from source, you should download'
+-        echo >&2 'a binary tarball instead. Read README.txt for more information.'
+-        echo >&2 '************************************************************************'
+-        exit 1
+-    fi
+-
+     # Display the startup banner (unless SAGE_BANNER is explictly "no")
+     if [ "$SAGE_BANNER" != "no" ]; then
+         # can be 'bare', or 'yes', or unspecified
+

Copied: sagemath/repos/community-staging-i686/test-optional.patch (from rev 233756, sagemath/trunk/test-optional.patch)
===================================================================
--- community-staging-i686/test-optional.patch	                        (rev 0)
+++ community-staging-i686/test-optional.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,25 @@
+--- src/sage/doctest/control.py.orig       2016-10-20 19:39:53.714618246 +0200
++++ src/sage/doctest/control.py    2016-10-20 19:40:15.158049920 +0200
+@@ -307,22 +307,6 @@
+             if "all" in options.optional:
+                 # Special case to run all optional tests
+                 options.optional = True
+-            else:
+-                # We replace the 'optional' tag by all optional
+-                # packages for which the installed version matches the
+-                # latest available version (this implies in particular
+-                # that the package is actually installed).
+-                if 'optional' in options.optional:
+-                    options.optional.discard('optional')
+-                    from sage.misc.package import list_packages
+-                    for pkg in list_packages('optional', local=True).values():
+-                        if pkg['installed_version'] == pkg['remote_version']:
+-                            options.optional.add(pkg['name'])
+-
+-                # Check that all tags are valid
+-                for o in options.optional:
+-                    if not optionaltag_regex.search(o):
+-                        raise ValueError('invalid optional tag {!r}'.format(o))
+ 
+         self.options = options
+         self.files = args

Copied: sagemath/repos/community-staging-x86_64/PKGBUILD (from rev 233756, sagemath/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,166 @@
+# $Id$
+# Maintainer: Evgeniy Alekseev <arcanis.arch at gmail dot com>
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
+# Contributor: Thomas Dziedzic <gostrc at gmail dot com>
+# Contributor: Osman Ugus <ugus11 at yahoo dot com>
+# Contributor: Stefan Husmann <stefan-husmann at t-online dot de>
+# Special thanks to Nareto for moving the compile from the .install to the PKGBUILD
+
+pkgbase=sagemath
+pkgname=(sagemath sagemath-jupyter)
+pkgver=7.6
+pkgrel=5
+pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
+arch=(i686 x86_64)
+url="http://www.sagemath.org"
+license=(GPL)
+depends=(ipython2 ppl palp brial cliquer maxima-ecl gfan sympow nauty python2-rpy2 python2-fpylll python2-psutil
+  python2-matplotlib python2-scipy python2-sympy python2-networkx python2-pillow python2-future libgap flintqs lcalc lrcalc arb
+  eclib gmp-ecm zn_poly gd python2-cvxopt pynac linbox rubiks pari-galdata pari-seadata-small planarity rankwidth
+  sage-data-combinatorial_designs sage-data-elliptic_curves sage-data-graphs sage-data-polytopes_db sage-data-conway_polynomials)
+optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cython code'
+  'jmol: 3D plots' 'sage-notebook: Browser-based (flask) notebook interface'
+  'sagemath-doc: Documentation and inline help' 'python2-igraph: igraph backend for graph theory'
+  'coin-or-cbc: COIN backend for numerical computations' 'coin-or-csdp: for computing Lovász theta-function of graphs'
+  'buckygen: for generating fullerene graphs' 'plantri: for generating some classes of graphs' 'benzene: for generating fusenes and benzenoids'
+  'modular_decomposition: modular decomposition of graphs' 'ffmpeg: to export animations to video' 'imagemagick: to show animations'
+  'coxeter3: Coxeter groups implementation' 'cryptominisat2: SAT solver' 'gap-data: for computing Galois groups'
+  'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes'
+  'libhomfly: for computing the homfly polynomial of links' 'libbraiding: for computing in braid groups'
+  'libfes: exhaustive search of solutions for boolean equations' 'python2-pynormaliz: Normaliz backend for polyhedral computations'
+  'latte-integrale: integral point count in polyhedra'
+  'three.js: alternative 3D plots engine' 'tachyon: alternative 3D plots engine')
+makedepends=(cython2 boost ratpoints symmetrica python2-jinja coin-or-cbc libhomfly libbraiding
+  mcqd coxeter3 cryptominisat2 modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe libfes)
+source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz"
+        env.patch skip-check.patch cython-sys-path.patch package.patch latte-count.patch
+        jupyter-path.patch sagemath-python3-notebook.patch test-optional.patch ecm-7.patch increase-rtol.patch r-no-readline.patch
+        sagemath-planarity3.patch fes02.patch sagemath-singular-4.1.0.p2.patch sagemath-singular-4.1.0.p3.patch sagemath-pynac-0.7.6.patch)
+sha256sums=('e6e0729ab25446e7c922058db0eee4b0b294b32c196e34842e843ea9fae41423'
+            'dc0a92b81e9e2faab05cf8a5adb40ae7010be74446bc80d5aea15f59706f2cff'
+            'b02b3d2d5620ca20f96adb62b6fef05e4676c0a60983310a1450fdf3d923cb04'
+            'ff7e034d08ab084fdb193484f7fe3a659ebcd8ab33a2b7177237d65b26de7872'
+            '4a2297e4d9d28f0b3a1f58e1b463e332affcb109eafde44837b1657e309c8212'
+            'b816c71d345fb1188c3faa01c4e75cfa04ba6506080231d5d2c303a2288e9b50'
+            '775051aa9076ebf631c8a291af38b6ec4a13c904740dc9da831641d592d8bcd8'
+            '27aa73d427d92aeb2c181a233aa3a574a4158cd7dee33832808f69edaec55ea2'
+            '81d08c6a760f171f3381455b66a6c84789c9f0eefddbe6ca5794075514ad8c3a'
+            '65ad84c83d5f956fde8eab961f2caad56d64044324c4abc0e56bcd9f44061cb6'
+            'be925eefeac3f28e639794ddc20d64e6faafd7181804e29417a510224d19ccc7'
+            'ef9f401fa84fe1772af9efee6816643534f2896da4c23b809937b19771bdfbbf'
+            'a1c562ebe4538d672404ca3ac2e954a3c955afeb7463f7b4fe6eaa6fa74fe5c7'
+            'a39da083c038ada797ffc5bedc9ba47455a3f77057d42f86484ae877ef9172ea'
+            'e2980048e51a81a8f60761c0ea66c81b4e36d75198de2f4e5f0d5e4fd5ef5172'
+            '18ea03c046435693a9008329bb725a9cf2ed0d88a0d731bc71b5586bf84dfddf'
+            '42d6549d9a07bcea9fa79bb63961ebbfaaa4ca64e9c6a402ae90d559bb256c12')
+
+prepare(){
+  cd sage-$pkgver
+
+# Arch-specific patches
+# assume all optional packages are installed
+  patch -p0 -i ../package.patch
+# set env variables
+  patch -p0 -i ../env.patch
+# skip checking build status
+  patch -p0 -i ../skip-check.patch
+# don't list optional packages when running tests
+  patch -p0 -i ../test-optional.patch
+# set jupyter path
+  patch -p0 -i ../jupyter-path.patch
+# search system paths for cython includes
+  patch -p1 -i ../cython-sys-path.patch
+# fix regressions with ECM 7
+  patch -p1 -i ../ecm-7.patch
+# increase numerical tolerance, needed by scipy 0.18
+  patch -p1 -i ../increase-rtol.patch
+# fix freezes in R interface with readline 7 (Debian)
+  patch -p1 -i ../r-no-readline.patch
+# fix build with planarity 3 (Debian)
+  patch -p2 -i ../sagemath-planarity3.patch
+# fix build with Singular 4.1.0-p3
+  patch -p1 -i ../sagemath-singular-4.1.0.p2.patch
+  patch -p1 -i ../sagemath-singular-4.1.0.p3.patch
+# use correct latte-count binary name
+  patch -p1 -i ../latte-count.patch
+# make 'sage -notebook=jupyter' work with our python3 jupyter-notebook package
+  patch -p1 -i ../sagemath-python3-notebook.patch
+
+# Upstream patches  
+# fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209
+  patch -p1 -i ../fes02.patch
+# port to pynac 0.7.6 https://trac.sagemath.org/ticket/22838
+  patch -p1 -i ../sagemath-pynac-0.7.6.patch
+
+# use python2
+  sed -e 's|#!/usr/bin/env python|#!/usr/bin/env python2|' -e 's|exec python|exec python2|' -i src/bin/*
+  sed -e 's|cython {OPT}|cython2 {OPT}|' -e 's|python setup.py|python2 setup.py|' -i src/sage/misc/cython.py
+  sed -e 's|exec ipython|exec ipython2|' -e 's|cygdb|cygdb2|g' -i src/bin/sage
+  sed -e "s|'cython'|'cython2'|" -i src/bin/sage-cython
+  sed -e 's|bin/python|bin/python2|g' -i src/bin/sage-env
+}
+
+
+build() {
+  cd sage-$pkgver/src
+
+  export SAGE_LOCAL="/usr"
+  export SAGE_ROOT="$PWD"
+  export SAGE_SRC="$PWD"
+  export CC=gcc
+
+  python2 setup.py build
+}
+
+package_sagemath() {
+  optdepends+=('sagemath-jupyter: Jupyter kernel')
+  conflicts=(sage-mathematics)
+  replaces=(sage-mathematics) 
+  provides=(sage-mathematics)
+
+  cd sage-$pkgver/src
+
+  export SAGE_ROOT="$PWD"
+  export SAGE_LOCAL="/usr"
+  export JUPYTER_PATH="$pkgdir"/usr/share/jupyter
+
+  python2 setup.py install --root="$pkgdir" --optimize=1 --skip-build
+
+  mkdir -p "$pkgdir"/usr/bin
+  cp bin/sage "$pkgdir"/usr/bin
+  for _i in arch-env banner cachegrind callgrind cleaner coverage coverageall cython env eval grep grepdoc inline-fortran ipython \
+    massif maxima.lisp native-execute notebook num-threads.py omega open preparse python rst2ipynb rst2sws rst2txt run run-cython \
+    runtests startuptime.py sws2rst valgrind version.sh
+  do
+    cp bin/sage-$_i "$pkgdir"/usr/bin
+  done
+  cp bin/math-readline "$pkgdir"/usr/bin
+  
+  mkdir -p "$pkgdir"/usr/share/sage
+  cp -r ext "$pkgdir"/usr/share/sage
+  
+# Create SAGE_SRC, needed for the notebook and help
+  mkdir "$pkgdir"/usr/share/sage/source
+  ln -s /usr/share/doc/sage "$pkgdir"/usr/share/sage/source/doc
+
+# Remove sage_setup
+  rm -r "$pkgdir"/usr/lib/python2.7/site-packages/sage_setup
+
+# Split jupyter kernel
+  rm -r "$pkgdir"/usr/share/jupyter
+}
+
+package_sagemath-jupyter() {
+  pkgdesc='Jupyter kernel for SageMath'
+  depends=(sagemath python2-jupyter_client python2-ipywidgets mathjax)
+  optdepends=('sage-notebook-exporter: convert flask notebooks to Jupyter')
+
+  cd sage-$pkgver/src
+
+  export SAGE_ROOT="$PWD"
+  export SAGE_LOCAL="/usr"
+  export JUPYTER_PATH="$pkgdir"/usr/share/jupyter
+
+  python2 -c "from sage.repl.ipython_kernel.install import SageKernelSpec; SageKernelSpec.update()"
+}

Copied: sagemath/repos/community-staging-x86_64/cython-sys-path.patch (from rev 233756, sagemath/trunk/cython-sys-path.patch)
===================================================================
--- community-staging-x86_64/cython-sys-path.patch	                        (rev 0)
+++ community-staging-x86_64/cython-sys-path.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,10 @@
+--- sage-7.1/src/setup.py.orig	2016-04-08 16:59:24.691349473 +0000
++++ sage-7.1/src/setup.py	2016-04-08 17:03:03.847153796 +0000
+@@ -414,6 +414,7 @@
+             build_dir=SAGE_CYTHONIZED,
+             force=force,
+             aliases=aliases,
++            include_path=sys.path,
+             compiler_directives={
+                 'autotestdict': False,
+                 'cdivision': True,

Copied: sagemath/repos/community-staging-x86_64/ecm-7.patch (from rev 233756, sagemath/trunk/ecm-7.patch)
===================================================================
--- community-staging-x86_64/ecm-7.patch	                        (rev 0)
+++ community-staging-x86_64/ecm-7.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,79 @@
+--- a/src/sage/interfaces/ecm.py.orig	2016-05-16 22:18:03.894827738 +0200
++++ b/src/sage/interfaces/ecm.py	2016-05-16 22:19:14.674904932 +0200
+@@ -140,9 +140,6 @@
+         - ``ve`` -- integer `n`. Verbosely show short (`< n`
+           character) expressions on each loop
+ 
+-        - ``cofdec`` -- boolean. Force cofactor output in decimal
+-          (even if expressions are used )
+-
+         - ``B2scale`` -- integer. Multiplies the default B2 value
+ 
+         - ``go`` -- integer. Preload with group order val, which can
+@@ -395,15 +392,15 @@
+             if m is not None:
+                 factor = m.group('factor')
+                 primality = m.group('primality')
+-                assert primality in ['probable prime', 'composite']
+-                result += [(ZZ(factor), primality == 'probable prime')]
++                assert primality in ['prime', 'composite']
++                result += [(ZZ(factor), primality == 'prime')]
+                 continue  # cofactor on the next line
+             m = self._found_cofactor_re.match(line)
+             if m is not None:
+                 cofactor = m.group('cofactor')
+                 primality = m.group('primality')
+-                assert primality in ['Probable prime', 'Composite']
+-                result += [(ZZ(cofactor), primality == 'Probable prime')]
++                assert primality in ['Prime', 'Composite']
++                result += [(ZZ(cofactor), primality == 'Prime')]
+                 # assert len(result) == 2
+                 return result
+         raise ValueError('failed to parse ECM output')
+@@ -501,7 +498,6 @@
+         if factor_digits is not None:
+             B1 = self.recommended_B1(factor_digits)
+         kwds['one'] = True
+-        kwds['cofdec'] = True
+         cmd = self._make_cmd(B1, None, kwds)
+         out = self._run_ecm(cmd, n)
+         return self._parse_output(n, out)
+@@ -828,8 +828,8 @@
+ Step 1 took 12ms
+ Step 2 took 17ms
+ ********** Factor found in step 2: 79792266297612017
+-Found probable prime factor of 17 digits: 79792266297612017
+-Probable prime cofactor 6366805760909027985741435139224233 has 34 digits
++Found prime factor of 17 digits: 79792266297612017
++Prime cofactor 6366805760909027985741435139224233 has 34 digits
+ """
+ 
+ TEST_ECM_OUTPUT_2 = """
+@@ -839,8 +839,8 @@
+ Step 1 took 2ms
+ Step 2 took 3ms
+ ********** Factor found in step 2: 179424673
+-Found probable prime factor of  9 digits: 179424673
+-Probable prime cofactor 179424673 has 9 digits
++Found prime factor of  9 digits: 179424673
++Prime cofactor 179424673 has 9 digits
+ """
+ 
+ TEST_ECM_OUTPUT_3 = """
+@@ -858,7 +858,7 @@
+ Step 1 took 5ms
+ Step 2 took 4ms
+ ********** Factor found in step 2: 197002597249
+-Found probable prime factor of 12 digits: 197002597249
++Found prime factor of 12 digits: 197002597249
+ Composite cofactor 339872432034468861533158743041639097889948066859 has 48 digits
+ """
+ 
+@@ -870,5 +870,5 @@
+ Step 2 took 2ms
+ ********** Factor found in step 2: 265748496095531068869578877937
+ Found composite factor of 30 digits: 265748496095531068869578877937
+-Probable prime cofactor 251951573867253012259144010843 has 30 digits
++Prime cofactor 251951573867253012259144010843 has 30 digits
+ """
+

Copied: sagemath/repos/community-staging-x86_64/env.patch (from rev 233756, sagemath/trunk/env.patch)
===================================================================
--- community-staging-x86_64/env.patch	                        (rev 0)
+++ community-staging-x86_64/env.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,94 @@
+--- src/bin/sage-env.orig	2015-01-06 10:46:04.469687605 +0100
++++ src/bin/sage-env	2015-01-06 10:49:59.547762019 +0100
+@@ -110,41 +110,7 @@
+ }
+ 
+ 
+-# New value for SAGE_ROOT: either SAGE_ROOT (if given)
+-# or a guessed value based on pwd.
+-if [ -n "$SAGE_ROOT" ]; then
+-    NEW_SAGE_ROOT="$SAGE_ROOT"
+-elif [ -f sage -a -d build ]; then
+-    NEW_SAGE_ROOT="."
+-elif [ -f ../../sage -a -d ../../build ]; then
+-    NEW_SAGE_ROOT="../.."
+-else
+-    # No idea what SAGE_ROOT should be...
+-    echo >&2 "Error: You must set the SAGE_ROOT environment variable or run this"
+-    echo >&2 "script from the SAGE_ROOT or SAGE_ROOT/local/bin/ directory."
+-    return 1
+-fi
+-
+-# Make NEW_SAGE_ROOT absolute
+-NEW_SAGE_ROOT=`cd "$NEW_SAGE_ROOT" && pwd -P`
+-
+-# Sanity check NEW_SAGE_ROOT
+-if [ -f "$NEW_SAGE_ROOT/sage" -a -d "$NEW_SAGE_ROOT/build" ]; then
+-    :
+-else
+-    echo >&2 "Error: SAGE_ROOT is set to a bad value:"
+-    echo >&2 "SAGE_ROOT=$SAGE_ROOT"
+-    echo >&2 "You must correct it or erase it and run this script from the SAGE_ROOT"
+-    echo >&2 "or SAGE_ROOT/local/bin/ directory."
+-    return 1
+-fi
+-
+-# Warn if NEW_SAGE_ROOT does not equal the old SAGE_ROOT
+-if [ "$SAGE_ROOT" != "$NEW_SAGE_ROOT" -a -n "$SAGE_ROOT" ]; then
+-    echo >&2 "Warning: overwriting SAGE_ROOT environment variable:"
+-    echo >&2 "Old SAGE_ROOT=$SAGE_ROOT"
+-    echo >&2 "New SAGE_ROOT=$NEW_SAGE_ROOT"
+-fi
++NEW_SAGE_ROOT="/usr"
+ 
+ # Display the Sage startup banner, used in src/bin/sage
+ sage_banner() {
+@@ -187,7 +187,7 @@
+ 
+ # SAGE_LOCAL is the installation prefix and can be customized
+ if [ -z "$SAGE_LOCAL" ]; then
+-    export SAGE_LOCAL="$SAGE_ROOT/local"
++    export SAGE_LOCAL="/usr"
+ fi
+ 
+ # sage-env must know where the Sage's script files are
+@@ -233,8 +233,9 @@
+ export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
+ export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
+ export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
+-export SAGE_SRC="$SAGE_ROOT/src"
+-export SAGE_DOC_SRC="$SAGE_SRC/doc"
++export GAP_ROOT_DIR="/usr/lib/gap"
++export SAGE_SRC="$SAGE_SHARE/sage/source"
++export SAGE_DOC_SRC="$SAGE_SHARE/doc/sage"
+ export SAGE_DOC="$SAGE_SHARE/doc/sage"
+ 
+ if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
+@@ -374,6 +337,9 @@
+     export SAGE_STARTUP_FILE
+ fi
+ 
++export LIBMTX="$DOT_SAGE/meataxe"
++[[ -d $LIBMTX ]] || mkdir -p $LIBMTX # Create meataxe data dir
++
+ if [ -z "$IPYTHONDIR" ]; then
+     # We hardcode a version number in the directory name. The idea is
+     # that we keep using the same version number as long as that is
+@@ -468,7 +400,6 @@
+         fi
+     fi
+ fi
+-export MAXIMA_PREFIX="$SAGE_LOCAL"
+ 
+ PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB
+ 
+@@ -629,9 +608,6 @@
+     LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH
+ fi
+ 
+-# See trac 7186 -- this is needed if ecl is moved
+-ECLDIR="$SAGE_LOCAL/lib/ecl/" && export ECLDIR
+-
+ # Handle parallel building/testing/...
+ # See Trac Ticket #12016
+ # First, figure out the right values for SAGE_NUM_THREADS (default

Copied: sagemath/repos/community-staging-x86_64/fes02.patch (from rev 233756, sagemath/trunk/fes02.patch)
===================================================================
--- community-staging-x86_64/fes02.patch	                        (rev 0)
+++ community-staging-x86_64/fes02.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,57 @@
+From b1f5e3ecc789db674fe17552812f2d0e2ab84be0 Mon Sep 17 00:00:00 2001
+From: Charles Bouillaguet <charles.bouillaguet at lifl.fr>
+Date: Thu, 19 Sep 2013 10:31:11 +0200
+Subject: updating the libFES binding to match a change in the interface
+
+---
+ src/sage/libs/fes.pyx | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/src/sage/libs/fes.pyx b/src/sage/libs/fes.pyx
+index 40b9c23..d188cf0 100644
+--- a/src/sage/libs/fes.pyx
++++ b/src/sage/libs/fes.pyx
+@@ -1,17 +1,19 @@
+ """
+-Binding for the FES library.
++Binding for the libFES library.
+ 
+ Finding solutions of systems of boolean equations by exhaustive
+ search, via the fes library. This is usually (much) faster than
+ computing a Groebner basis, except in special cases where the latter
+ is particularly easy.
+ 
+-The FES library is presently only able to deal with polynomials in 64
++More information is available at [http://www.lifl.fr/~bouillag/fes].
++
++The libFES library is presently only able to deal with polynomials in 64
+ variables. Performing a full exhaustive search over 64 variables will
+ take a **long** time. The number of variables can be artificially
+ reduced to 64 by specializing some of them.
+ 
+-Note that the FES library **requires** at least of the equations to be
++Note that the libFES library **requires** at least of the equations to be
+ non-linear.
+ 
+ AUTHORS:
+@@ -71,7 +73,7 @@ from libc.stdint cimport uint64_t
+ cdef extern from "fes_interface.h":
+     ctypedef int (*solution_callback_t)(void *, uint64_t)
+ 
+-    void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose)
++    void exhaustive_search_wrapper(int n, int n_eqs, int degree, int ***coeffs, solution_callback_t callback, void* callback_state, int verbose, int T)
+ 
+ 
+ include 'sage/ext/interrupt.pxi'  #sig_on(), sig_off()
+@@ -219,7 +221,7 @@ def exhaustive_search(eqs,  max_sols=Infinity, verbose=False):
+ 
+     # ------- runs the library
+     sig_on()
+-    exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose)
++    exhaustive_search_wrapper(n, len(eqs), degree, coeffs, report_solution, <void *> internal_state, verbose, 0)
+     sig_off()
+ 
+     # ------- frees memory occupied by the dense representation of the equations
+-- 
+cgit v1.0-1-gd88e
+

Copied: sagemath/repos/community-staging-x86_64/increase-rtol.patch (from rev 233756, sagemath/trunk/increase-rtol.patch)
===================================================================
--- community-staging-x86_64/increase-rtol.patch	                        (rev 0)
+++ community-staging-x86_64/increase-rtol.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,37 @@
+diff -ru sage-7.3.orig/src/sage/coding/code_bounds.py sage-7.3/src/sage/coding/code_bounds.py
+--- sage-7.3.orig/src/sage/coding/code_bounds.py        2016-08-05 20:26:10.033204091 +0200
++++ sage-7.3/src/sage/coding/code_bounds.py     2016-08-05 20:32:27.276579565 +0200
+@@ -554,7 +554,7 @@
+     if q < 2:   # Here we check that q is actually at least 2
+         raise ValueError("The value q must be an integer greater than 1")
+ 
+-    eps  = 4.5e-16 # find_root has about this as the default xtol
++    eps  = 4.5e-15 # find_root has about this as the default xtol
+     ymax = 1 - 1/q
+     if x <= eps:
+         return 0
+diff -ru sage-7.3.orig/src/sage/numerical/optimize.py sage-7.3/src/sage/numerical/optimize.py
+--- sage-7.3.orig/src/sage/numerical/optimize.py        2016-08-05 20:26:10.816536625 +0200
++++ sage-7.3/src/sage/numerical/optimize.py     2016-08-05 20:32:21.449907130 +0200
+@@ -15,7 +15,7 @@
+ from sage.rings.real_double import RDF
+ 
+ 
+-def find_root(f, a, b, xtol=10e-13, rtol=4.5e-16, maxiter=100, full_output=False):
++def find_root(f, a, b, xtol=10e-13, rtol=4.5e-15, maxiter=100, full_output=False):
+     """
+     Numerically find a root of ``f`` on the closed interval `[a,b]`
+     (or `[b,a]`) if possible, where ``f`` is a function in the one variable.
+diff -ru sage-7.3.orig/src/sage/symbolic/expression.pyx sage-7.3/src/sage/symbolic/expression.pyx
+--- sage-7.3.orig/src/sage/symbolic/expression.pyx      2016-08-05 20:26:11.333202767 +0200
++++ sage-7.3/src/sage/symbolic/expression.pyx   2016-08-05 20:32:14.236566826 +0200
+@@ -10884,7 +10884,7 @@
+             ret = ret[0]
+         return ret
+ 
+-    def find_root(self, a, b, var=None, xtol=10e-13, rtol=4.5e-16, maxiter=100, full_output=False):
++    def find_root(self, a, b, var=None, xtol=10e-13, rtol=4.5e-15, maxiter=100, full_output=False):
+         """
+         Numerically find a root of self on the closed interval [a,b] (or
+         [b,a]) if possible, where self is a function in the one variable.
+

Copied: sagemath/repos/community-staging-x86_64/jupyter-path.patch (from rev 233756, sagemath/trunk/jupyter-path.patch)
===================================================================
--- community-staging-x86_64/jupyter-path.patch	                        (rev 0)
+++ community-staging-x86_64/jupyter-path.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,22 @@
+--- src/sage/repl/ipython_kernel/install.py.orig	2015-10-23 19:23:39.728456590 +0000
++++ src/sage/repl/ipython_kernel/install.py	2015-10-23 19:24:00.965018978 +0000
+@@ -13,8 +13,7 @@
+     SAGE_ROOT, SAGE_DOC, SAGE_LOCAL, SAGE_EXTCODE,
+     SAGE_VERSION
+ )
+-from jupyter_core.paths import ENV_JUPYTER_PATH
+-JUPYTER_PATH = ENV_JUPYTER_PATH[0]
++JUPYTER_PATH = os.environ.get('JUPYTER_PATH') 
+ 
+ class SageKernelSpec(object):
+
+@@ -208,7 +208,7 @@
+             sage: spec._symlink_resources()    # not tested
+         """
+         path = os.path.join(SAGE_EXTCODE, 'notebook-ipython')
+-        for filename in os.listdir(path):
++        for filename in os.listdir('ext/notebook-ipython'):
+             self.symlink(
+                 os.path.join(path, filename),
+                 os.path.join(self.kernel_dir, filename)
+

Copied: sagemath/repos/community-staging-x86_64/latte-count.patch (from rev 233756, sagemath/trunk/latte-count.patch)
===================================================================
--- community-staging-x86_64/latte-count.patch	                        (rev 0)
+++ community-staging-x86_64/latte-count.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,84 @@
+diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py
+index 50d99f99e4..3a3a8cb214 100644
+--- a/src/sage/geometry/polyhedron/base.py
++++ b/src/sage/geometry/polyhedron/base.py
+@@ -4629,7 +4629,7 @@ class Polyhedron_base(Element):
+             ...
+             RuntimeError: LattE integrale program failed (exit code 1):
+             ...
+-            Invocation: count '--redundancy-check=none' --cdd /dev/stdin
++            Invocation: latte-count '--redundancy-check=none' --cdd /dev/stdin
+             ...
+             Parse error in CDD-style input file /dev/stdin
+             sage: Q.integral_points_count(verbose=True) # optional - latte_int
+diff --git a/src/sage/geometry/polyhedron/base_ZZ.py b/src/sage/geometry/polyhedron/base_ZZ.py
+index 268af9db0d..70d41dfa30 100644
+--- a/src/sage/geometry/polyhedron/base_ZZ.py
++++ b/src/sage/geometry/polyhedron/base_ZZ.py
+@@ -228,7 +228,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(maxdet=5, verbose=True)  # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd '--maxdet=5' /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd '--maxdet=5' /dev/stdin
+             ...
+             sage: p    # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -236,7 +236,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(dual=True, verbose=True)  # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --dual /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --dual /dev/stdin
+             ...
+             sage: p   # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -244,7 +244,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(irrational_primal=True, verbose=True)   # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-primal /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-primal /dev/stdin
+             ...
+             sage: p   # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -252,7 +252,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             sage: p = P.ehrhart_polynomial(irrational_all_primal=True, verbose=True)  # optional - latte_int
+             This is LattE integrale ...
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-all-primal /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd --irrational-all-primal /dev/stdin
+             ...
+             sage: p   # optional - latte_int
+             1/2*t^2 + 3/2*t + 1
+@@ -264,7 +264,7 @@ class Polyhedron_ZZ(Polyhedron_base):
+             ...
+             RuntimeError: LattE integrale program failed (exit code 1):
+             ...
+-            Invocation: count --ehrhart-polynomial '--redundancy-check=none' --cdd '--bim-bam-boum=19' /dev/stdin
++            Invocation: latte-count --ehrhart-polynomial '--redundancy-check=none' --cdd '--bim-bam-boum=19' /dev/stdin
+             Unknown command/option --bim-bam-boum=19
+         """
+         if self.is_empty():
+diff --git a/src/sage/interfaces/latte.py b/src/sage/interfaces/latte.py
+index 066cedd401..302b39910d 100644
+--- a/src/sage/interfaces/latte.py
++++ b/src/sage/interfaces/latte.py
+@@ -86,7 +86,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False,
+         sage: n = count(cddin, cdd=True, verbose=True, raw_output=True)  # optional - latte_int
+         This is LattE integrale ...
+         ...
+-        Invocation: count '--redundancy-check=none' --cdd /dev/stdin
++        Invocation: latte-count '--redundancy-check=none' --cdd /dev/stdin
+         ...
+         Total Unimodular Cones: ...
+         Maximum number of simplicial cones in memory at once: ...
+@@ -106,7 +106,7 @@ def count(arg, ehrhart_polynomial=False, multivariate_generating_function=False,
+     from sage.misc.misc import SAGE_TMP
+     from sage.rings.integer import Integer
+ 
+-    args = ['count']
++    args = ['latte-count']
+     if ehrhart_polynomial and multivariate_generating_function:
+         raise ValueError
+     if ehrhart_polynomial:

Copied: sagemath/repos/community-staging-x86_64/package.patch (from rev 233756, sagemath/trunk/package.patch)
===================================================================
--- community-staging-x86_64/package.patch	                        (rev 0)
+++ community-staging-x86_64/package.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,38 @@
+--- src/sage/misc/package.py.orig	2014-11-23 15:58:13.000000000 +0100
++++ src/sage/misc/package.py	2015-01-22 20:32:25.651383902 +0100
+@@ -343,7 +343,7 @@
+         sage: for pkg in list_packages('pip', local=True):
+         ....:     assert not is_package_installed(pkg)
+     """
+-    return any(p.split('-')[0] == package for p in installed_packages(exclude_pip))
++    return True
+ 
+ def package_versions(package_type, local=False):
+     r"""
+--- src/sage_setup/optional_extension.py.orig  2016-10-19 18:35:10.092577510 +0000
++++ src/sage_setup/optional_extension.py       2016-10-19 18:38:13.514765366 +0000
+@@ -21,8 +21,6 @@
+ from distutils.extension import Extension
+ from sage.misc.package import is_package_installed, list_packages
+ 
+-all_packages = list_packages(local=True)
+-
+ 
+ class CythonizeExtension(Extension):
+     """
+@@ -76,14 +74,7 @@
+         condition = kwds.pop("condition")
+     except KeyError:
+         pkg = kwds.pop("package")
+-        try:
+-            pkginfo = all_packages[pkg]
+-        except KeyError:
+-            # Might be an installed old-style package
+-            condition = is_package_installed(pkg)
+-        else:
+-            condition = (pkginfo["installed_version"] == pkginfo["remote_version"])
+-
++        condition = True
+     if condition:
+         return Extension(*args, **kwds)
+     else:

Copied: sagemath/repos/community-staging-x86_64/r-no-readline.patch (from rev 233756, sagemath/trunk/r-no-readline.patch)
===================================================================
--- community-staging-x86_64/r-no-readline.patch	                        (rev 0)
+++ community-staging-x86_64/r-no-readline.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,11 @@
+--- a/src/sage/interfaces/r.py
++++ b/src/sage/interfaces/r.py
+@@ -331,7 +331,7 @@
+                   prompt = '> ', #default, later comes the change
+ 
+                   # This is the command that starts up your program
+-                  command = "R --vanilla --quiet",
++                  command = "R --no-readline --vanilla --quiet",
+ 
+                   server=server,
+                   server_tmpdir=server_tmpdir,

Copied: sagemath/repos/community-staging-x86_64/sagemath-planarity3.patch (from rev 233756, sagemath/trunk/sagemath-planarity3.patch)
===================================================================
--- community-staging-x86_64/sagemath-planarity3.patch	                        (rev 0)
+++ community-staging-x86_64/sagemath-planarity3.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,113 @@
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: https://trac.sagemath.org/ticket/21774
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage/graphs/planarity.pyx
++++ b/sage/src/sage/graphs/planarity.pyx
+@@ -3,13 +3,19 @@
+ """
+ 
+ cdef extern from "planarity/graph.h":
+-    ctypedef struct graphNode:
+-        int v
++    ctypedef struct vertexRec:
+         int link[2]
+-    ctypedef graphNode * graphNodeP
++        int index
++    ctypedef vertexRec * vertexRecP
++
++    ctypedef struct edgeRec:
++        int link[2]
++        int neighbor
++    ctypedef edgeRec * edgeRecP
+ 
+     ctypedef struct BM_graph:
+-        graphNodeP G
++        vertexRecP V
++        edgeRecP E
+         int N
+     ctypedef BM_graph * graphP
+ 
+@@ -93,15 +99,16 @@
+             g._pos = { u: [0,0], v: [0,1] }
+         return (True, None) if kuratowski else True
+ 
+-    # create to and from mappings to relabel vertices to the set {0,...,n-1}
++    # create to and from mappings to relabel vertices to the set {1,...,n}
++    # (planarity 3 uses 1-based array indexing, with 0 representing NIL)
+     cdef int i
+     listto = g.vertices()
+     ffrom = {}
+     for vvv in listto:
+-        ffrom[vvv] = listto.index(vvv)
++        ffrom[vvv] = listto.index(vvv) + 1
+     to = {}
+     for i from 0 <= i < len(listto):
+-        to[i] = listto[i]
++        to[i + 1] = listto[i]
+     g.relabel(ffrom)
+ 
+     cdef graphP theGraph
+@@ -125,7 +132,7 @@
+     status = gp_Embed(theGraph, EMBEDFLAGS_PLANAR)
+     gp_SortVertices(theGraph)
+ 
+-    # use to and from mappings to relabel vertices back from the set {0,...,n-1}
++    # use to and from mappings to relabel vertices back from the set {1,...,n}
+     g.relabel(to)
+ 
+     if status == NOTOK:
+@@ -134,12 +141,12 @@
+         # Kuratowski subgraph isolator
+         g_dict = {}
+         from sage.graphs.graph import Graph
+-        for i from 0 <= i < theGraph.N:
++        for i from 0 < i <= theGraph.N:
+             linked_list = []
+-            j = theGraph.G[i].link[1]
+-            while j >= theGraph.N:
+-                linked_list.append(to[theGraph.G[j].v])
+-                j = theGraph.G[j].link[1]
++            j = theGraph.V[i].link[1]
++            while j:
++                linked_list.append(to[theGraph.E[j].neighbor])
++                j = theGraph.E[j].link[1]
+             if len(linked_list) > 0:
+                 g_dict[to[i]] = linked_list
+         G = Graph(g_dict)
+@@ -153,12 +160,12 @@
+             if set_embedding:
+                 emb_dict = {}
+                 #for i in range(theGraph.N):
+-                for i from 0 <= i < theGraph.N:
++                for i from 0 < i <= theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[1]
+-                    while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[1]
++                    j = theGraph.V[i].link[1]
++                    while j:
++                        linked_list.append(to[theGraph.E[j].neighbor])
++                        j = theGraph.E[j].link[1]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+             if set_pos:
+@@ -174,12 +181,12 @@
+ 
+                 emb_dict = {}
+                 #for i in range(theGraph.N):
+-                for i from 0 <= i < theGraph.N:
++                for i from 0 < i <= theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[0]
+-                    while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[0]
++                    j = theGraph.V[i].link[0]
++                    while j:
++                        linked_list.append(to[theGraph.E[j].neighbor])
++                        j = theGraph.E[j].link[0]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+         gp_Free(&theGraph)

Copied: sagemath/repos/community-staging-x86_64/sagemath-pynac-0.7.6.patch (from rev 233756, sagemath/trunk/sagemath-pynac-0.7.6.patch)
===================================================================
--- community-staging-x86_64/sagemath-pynac-0.7.6.patch	                        (rev 0)
+++ community-staging-x86_64/sagemath-pynac-0.7.6.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,44 @@
+diff --git a/src/sage/libs/pynac/pynac.pxd b/src/sage/libs/pynac/pynac.pxd
+index 15e8ac2..568dbd6 100644
+--- a/src/sage/libs/pynac/pynac.pxd
++++ b/src/sage/libs/pynac/pynac.pxd
+@@ -319,7 +319,7 @@ cdef extern from "sage/libs/pynac/wrap.h":
+ 
+ 
+     GEx g_abs "GiNaC::abs" (GEx x)                      except + # absolute value
+-    GEx g_step "GiNaC::step" (GEx x)                    except + # step function
++    GEx g_step "GiNaC::unit_step" (GEx x)               except + # step function
+     GEx g_csgn "GiNaC::csgn" (GEx x)                    except + # complex sign
+     GEx g_conjugate "GiNaC::conjugate_function" (GEx x) except + # complex conjugation
+     GEx g_real_part "GiNaC::real_part_function" (GEx x) except + # real part
+diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
+index 01319b5..735d6fa 100644
+--- a/src/sage/symbolic/expression.pyx
++++ b/src/sage/symbolic/expression.pyx
+@@ -7018,7 +7018,7 @@ cdef class Expression(CommutativeRingElement):
+     def step(self, hold=False):
+         """
+         Return the value of the Heaviside step function, which is 0 for
+-        negative x, 1/2 for 0, and 1 for positive x.
++        negative x, 1 for 0, and 1 for positive x.
+ 
+         EXAMPLES::
+ 
+@@ -7026,7 +7026,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: SR(1.5).step()
+             1
+             sage: SR(0).step()
+-            1/2
++            1
+             sage: SR(-1/2).step()
+             0
+             sage: SR(float(-1)).step()
+@@ -7038,7 +7038,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: SR(2).step()
+             1
+             sage: SR(2).step(hold=True)
+-            step(2)
++            unit_step(2)
+ 
+         """
+         return new_Expression_from_GEx(self._parent,

Copied: sagemath/repos/community-staging-x86_64/sagemath-python3-notebook.patch (from rev 233756, sagemath/trunk/sagemath-python3-notebook.patch)
===================================================================
--- community-staging-x86_64/sagemath-python3-notebook.patch	                        (rev 0)
+++ community-staging-x86_64/sagemath-python3-notebook.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,27 @@
+diff --git a/src/bin/sage-notebook b/src/bin/sage-notebook
+index 74192da240..0ede281aad 100755
+--- a/src/bin/sage-notebook
++++ b/src/bin/sage-notebook
+@@ -96,8 +96,7 @@ class NotebookJupyter(object):
+         if not have_prerequisites():
+             print(self.PREREQUISITE_ERROR)
+             raise SystemExit(1)
+-        from notebook.notebookapp import main
+-        main(argv)
++        os.execvp('jupyter-notebook', ['jupyter-notebook'] + argv)
+ 
+ 
+ class SageNBExport(NotebookJupyter):
+diff --git a/src/sage/repl/ipython_kernel/install.py b/src/sage/repl/ipython_kernel/install.py
+index 3912b8cdf5..bd40cdadda 100644
+--- a/src/sage/repl/ipython_kernel/install.py
++++ b/src/sage/repl/ipython_kernel/install.py
+@@ -281,7 +281,6 @@ def have_prerequisites(debug=True):
+         True
+     """
+     try:
+-        from notebook.notebookapp import NotebookApp
+         return True
+     except ImportError:
+         if debug:
+

Copied: sagemath/repos/community-staging-x86_64/sagemath-singular-4.1.0.p2.patch (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p2.patch)
===================================================================
--- community-staging-x86_64/sagemath-singular-4.1.0.p2.patch	                        (rev 0)
+++ community-staging-x86_64/sagemath-singular-4.1.0.p2.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,777 @@
+diff --git a/src/doc/de/tutorial/interfaces.rst b/src/doc/de/tutorial/interfaces.rst
+index edc59c5..83a8a8b 100644
+--- a/src/doc/de/tutorial/interfaces.rst
++++ b/src/doc/de/tutorial/interfaces.rst
+@@ -198,7 +198,7 @@ Sages Singular-Schnittstelle (ohne die ``....:``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst
+index f7e663d..a312548 100644
+--- a/src/doc/en/constructions/algebraic_geometry.rst
++++ b/src/doc/en/constructions/algebraic_geometry.rst
+@@ -164,7 +164,7 @@ Other methods
+        sage: klein1 = f.Adj_div(); print(klein1)
+        [1]:
+           [1]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 2
+        //        block   1 : ordering lp
+        //                  : names    x y
+@@ -187,13 +187,13 @@ Other methods
+        sage: print(klein1)
+        [1]:
+           [1]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 2
+        //        block   1 : ordering lp
+        //                  : names    x y
+        //        block   2 : ordering C
+           [2]:
+-             //   characteristic : 2
++             //   coefficients: ZZ/2
+        //   number of vars : 3
+        //        block   1 : ordering lp
+        //                  : names    x y z
+@@ -210,7 +210,7 @@ Other methods
+        [5]:
+           [1]:
+              [1]:
+-                //   characteristic : 2
++                //   coefficients: ZZ/2
+        //   number of vars : 3
+        //        block   1 : ordering ls
+        //                  : names    x y t
+@@ -325,7 +325,7 @@ Singular itself to help an understanding of how the wrapper works.
+        sage: X = Curve(f); pts = X.rational_points()
+        sage: D = X.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ])
+        sage: X.riemann_roch_basis(D)
+-       [(-2*x + y)/(x + y), (-x + z)/(x + y)]
++       [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)]
+ 
+ -  Using Singular's ``BrillNoether`` command (for details see the section
+    Brill-Noether in the Singular online documentation
+diff --git a/src/doc/en/constructions/rings.rst b/src/doc/en/constructions/rings.rst
+index 58abf8a..076184e 100644
+--- a/src/doc/en/constructions/rings.rst
++++ b/src/doc/en/constructions/rings.rst
+@@ -57,7 +57,7 @@ Here's an example using the Singular interface:
+     sage: I = singular.ideal(['a+b+c+d', 'ab+ad+bc+cd', 'abc+abd+acd+bcd', 'abcd-1'])
+     sage: R
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 97
++    //   coefficients: ZZ/97
+     //   number of vars : 4
+     //        block   1 : ordering lp
+     //                  : names    a b c d
+diff --git a/src/doc/en/developer/coding_in_other.rst b/src/doc/en/developer/coding_in_other.rst
+index 640c8ac..b1728ea 100644
+--- a/src/doc/en/developer/coding_in_other.rst
++++ b/src/doc/en/developer/coding_in_other.rst
+@@ -402,7 +402,7 @@ interface to Singular::
+     sage: singular.LIB("brnoeth.lib")
+     sage: singular.ring(5,'(x,y)','lp')
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 5
++        //   coefficients: ZZ/5
+         //   number of vars : 2
+         //        block   1 : ordering lp
+         //                  : names    x y
+diff --git a/src/doc/en/tutorial/interfaces.rst b/src/doc/en/tutorial/interfaces.rst
+index 5a27631..ca7ae7a 100644
+--- a/src/doc/en/tutorial/interfaces.rst
++++ b/src/doc/en/tutorial/interfaces.rst
+@@ -197,7 +197,7 @@ Singular (do not type the ``....:``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/fr/tutorial/interfaces.rst b/src/doc/fr/tutorial/interfaces.rst
+index 75f36a4..8109a67 100644
+--- a/src/doc/fr/tutorial/interfaces.rst
++++ b/src/doc/fr/tutorial/interfaces.rst
+@@ -199,7 +199,7 @@ fournie par Sage (n'entrez pas les ``....:``) :
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/ja/tutorial/interfaces.rst b/src/doc/ja/tutorial/interfaces.rst
+index 560032a..6438103 100644
+--- a/src/doc/ja/tutorial/interfaces.rst
++++ b/src/doc/ja/tutorial/interfaces.rst
+@@ -173,7 +173,7 @@ Singularは,グレブナー基底,多変数多項式のgcd,平面曲線の
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/doc/pt/tutorial/interfaces.rst b/src/doc/pt/tutorial/interfaces.rst
+index 5f611f8..4539bf6 100644
+--- a/src/doc/pt/tutorial/interfaces.rst
++++ b/src/doc/pt/tutorial/interfaces.rst
+@@ -197,7 +197,7 @@ digite ``...``):
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y 
+diff --git a/src/doc/ru/tutorial/interfaces.rst b/src/doc/ru/tutorial/interfaces.rst
+index 234731a..bc2983c 100644
+--- a/src/doc/ru/tutorial/interfaces.rst
++++ b/src/doc/ru/tutorial/interfaces.rst
+@@ -191,7 +191,7 @@ Singular предоставляет массивную и продуманную
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py
+index cd8b9db..cccc344 100644
+--- a/src/sage/categories/pushout.py
++++ b/src/sage/categories/pushout.py
+@@ -3202,7 +3202,7 @@ class BlackBoxConstructionFunctor(ConstructionFunctor):
+         Gap
+         sage: FS(QQ['t'])
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 0
++        //   coefficients: QQ
+         //   number of vars : 1
+         //        block   1 : ordering lp
+         //                  : names    t
+diff --git a/src/sage/interfaces/expect.py b/src/sage/interfaces/expect.py
+index 6a44b29..9a9ed5e 100644
+--- a/src/sage/interfaces/expect.py
++++ b/src/sage/interfaces/expect.py
+@@ -1216,7 +1216,7 @@ If this all works, you can then make calls like:
+             sage: R.<x> = QQ[]; f = x^3 + x + 1;  g = x^3 - x - 1; r = f.resultant(g); gap(ZZ); singular(R)
+             Integers
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/interfaces/interface.py b/src/sage/interfaces/interface.py
+index e4cfe51..2865c70 100644
+--- a/src/sage/interfaces/interface.py
++++ b/src/sage/interfaces/interface.py
+@@ -735,7 +735,7 @@ class InterfaceElement(Element):
+             sage: S = singular.ring(0, ('x'))
+             sage: loads(dumps(S))
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py
+index 2af7bc1..43745a2 100644
+--- a/src/sage/interfaces/singular.py
++++ b/src/sage/interfaces/singular.py
+@@ -65,7 +65,7 @@ factorization::
+     sage: R1 = singular.ring(0, '(x,y)', 'dp')
+     sage: R1
+     polynomial ring, over a field, global ordering
+-    //   characteristic : 0
++    //   coefficients: QQ
+     //   number of vars : 2
+     //        block   1 : ordering dp
+     //                  : names    x y
+@@ -243,7 +243,7 @@ Groebner basis for some ideal, using Singular through Sage.
+     sage: singular.lib('poly.lib')
+     sage: singular.ring(32003, '(a,b,c,d,e,f)', 'lp')
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 32003
++            //   coefficients: ZZ/32003
+             //   number of vars : 6
+             //        block   1 : ordering lp
+             //                        : names    a b c d e f
+@@ -1000,7 +1000,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: R = singular.ring(0, '(x,y,z)', 'dp')
+             sage: R
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1080,7 +1080,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: S = singular.ring('real', '(a,b)', 'lp')
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a b
+@@ -1088,7 +1088,7 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: singular.set_ring(R)
+             sage: singular.current_ring()
+             polynomial ring, over a field, local ordering
+-            //   characteristic : 7
++            //   coefficients: ZZ/7
+             //   number of vars : 2
+             //        block   1 : ordering ds
+             //                  : names    a b
+@@ -1130,14 +1130,14 @@ class Singular(ExtraTabCompletion, Expect):
+             sage: r = PolynomialRing(GF(127),3,'xyz', order='invlex')
+             sage: r._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 3
+             //        block   1 : ordering rp
+             //                  : names    x y z
+             //        block   2 : ordering C
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 3
+             //        block   1 : ordering rp
+             //                  : names    x y z
+@@ -1360,7 +1360,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: cpQ.set_ring()
+             sage: cpQ
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1911,7 +1911,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+ 
+             sage: singular('basering')
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 3
+             //        block   1 : ordering lp
+             //                  : names    x y z
+@@ -1996,7 +1996,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: S = singular.ring('real', '(a,b)', 'lp')
+             sage: singular.current_ring()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a b
+@@ -2004,7 +2004,7 @@ class SingularElement(ExtraTabCompletion, ExpectElement):
+             sage: R.set_ring()
+             sage: singular.current_ring()
+             polynomial ring, over a field, local ordering
+-            //   characteristic : 7
++            //   coefficients: ZZ/7
+             //   number of vars : 2
+             //        block   1 : ordering ds
+             //                  : names    a b
+@@ -2260,7 +2260,7 @@ def reduce_load():
+ 
+         sage: loads(dumps(singular.ring()))
+         polynomial ring, over a field, global ordering
+-        //   characteristic : 0
++        //   coefficients: QQ
+         //   number of vars : 1
+         //        block   1 : ordering lp
+         //                  : names    x
+diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
+index 4afc0cc..2dec5d8 100644
+--- a/src/sage/libs/singular/decl.pxd
++++ b/src/sage/libs/singular/decl.pxd
+@@ -484,8 +484,8 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     ring *rDefault(int char , int nvars, char **names)
+     ring *rDefault(const n_Procs_s* cf, int nvars, char **names)
+-    ring *rDefault(int ch             , int nvars, char **names,int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
+-    ring *rDefault(const n_Procs_s* cf, int nvars, char **names,int ord_size, int *ord, int *block0, int *block1, int **wvhdl)
++    ring *rDefault(int ch             , int nvars, char **names,int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl)
++    ring *rDefault(const n_Procs_s* cf, int nvars, char **names,int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl)
+ 
+ 
+ 
+diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
+index 2813a6f..0f3b76f 100644
+--- a/src/sage/libs/singular/function.pyx
++++ b/src/sage/libs/singular/function.pyx
+@@ -282,7 +282,7 @@ cdef class RingWrap:
+             sage: l = ringlist(P)
+             sage: ring = singular_function("ring")
+             sage: ring(l, ring=P)._output()
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+diff --git a/src/sage/libs/singular/ring.pyx b/src/sage/libs/singular/ring.pyx
+index 4a6e167..f221132 100644
+--- a/src/sage/libs/singular/ring.pyx
++++ b/src/sage/libs/singular/ring.pyx
+@@ -21,7 +21,7 @@ from sage.libs.gmp.mpz cimport mpz_init_set_ui, mpz_init_set
+ from sage.libs.singular.decl cimport number, poly, ring, currRing
+ from sage.libs.singular.decl cimport rChangeCurrRing, rCopy0, rComplete, rDelete, idInit
+ from sage.libs.singular.decl cimport omAlloc0, omStrDup, omAlloc, omAlloc0Bin,  sip_sring_bin, rnumber_bin
+-from sage.libs.singular.decl cimport ringorder_dp, ringorder_Dp, ringorder_lp, ringorder_rp, ringorder_ds, ringorder_Ds, ringorder_ls, ringorder_M, ringorder_C, ringorder_wp, ringorder_Wp, ringorder_ws, ringorder_Ws, ringorder_a
++from sage.libs.singular.decl cimport ringorder_dp, ringorder_Dp, ringorder_lp, ringorder_rp, ringorder_ds, ringorder_Ds, ringorder_ls, ringorder_M, ringorder_C, ringorder_wp, ringorder_Wp, ringorder_ws, ringorder_Ws, ringorder_a, rRingOrder_t
+ from sage.libs.singular.decl cimport p_Copy, prCopyR
+ from sage.libs.singular.decl cimport n_unknown,  n_Zp,  n_Q,   n_R,   n_GF,  n_long_R,  n_algExt,n_transExt,n_long_C,   n_Z,   n_Zn,  n_Znm,  n_Z2m,  n_CF
+ from sage.libs.singular.decl cimport n_coeffType, cfInitCharProc
+@@ -165,7 +165,7 @@ cdef ring *singular_ring_new(base_ring, n, names, term_order) except NULL:
+     ##         q    q : GF(q=p^n)       *names         TRUE              (todo)
+ 
+     _wvhdl  = <int **>omAlloc0((nblcks + 2) * sizeof(int *))
+-    _order  = <int *>omAlloc0((nblcks + 2) * sizeof(int))
++    _order  = <rRingOrder_t *>omAlloc0((nblcks + 2) * sizeof(int))
+     _block0 = <int *>omAlloc0((nblcks + 2) * sizeof(int))
+     _block1 = <int *>omAlloc0((nblcks + 2) * sizeof(int))
+ 
+diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py
+index eeafd87..c79ff28 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_element.py
++++ b/src/sage/rings/polynomial/multi_polynomial_element.py
+@@ -1994,7 +1994,7 @@ def degree_lowest_rational_function(r,x):
+     ::
+ 
+         sage: r = f/g; r
+-        (-2*b*c^2 - 1)/(2*a*b^3*c^6 + a*c)
++        (-b*c^2 + 2)/(a*b^3*c^6 - 2*a*c)
+         sage: degree_lowest_rational_function(r,a)
+         (-1, 3)
+         sage: degree_lowest_rational_function(r,b)
+diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+index 06ffc67..21f60c0 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+@@ -190,7 +190,7 @@ when the system has no solutions over the rationals.
+     The Groebner basis modulo any product of the prime factors is also non-trivial::
+ 
+         sage: I.change_ring(P.change_ring( IntegerModRing(2*7) )).groebner_basis()
+-        [x + 3*y + 11*z, y^2 + 3*y, y*z + 11*y + 4, 2*y + 6, z^2 + 3, 2*z + 10]
++        [x + 9*y + 13*z, y^2 + 3*y, y*z + 7*y + 6, 2*y + 6, z^2 + 3, 2*z + 10]
+ 
+     Modulo any other prime the Groebner basis is trivial so there are
+     no other solutions. For example::
+@@ -3646,11 +3646,13 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \
+             sage: P.<a,b,c> = PolynomialRing(Zmod(1000),3)
+             sage: I = P * (a + 2*b + 2*c - 1, a^2 - a + 2*b^2 + 2*c^2, 2*a*b + 2*b*c - b)
+             sage: I.groebner_basis()
+-            [b*c^2 + 992*b*c + 712*c^2 + 332*b + 96*c,
+-             2*c^3 + 214*b*c + 862*c^2 + 762*b + 268*c,
++            [b*c^2 + 732*b*c + 808*b,
++             2*c^3 + 884*b*c + 666*c^2 + 320*b,
+              b^2 + 438*b*c + 281*b,
+              5*b*c + 156*c^2 + 112*b + 948*c,
+-             50*c^2 + 600*b + 650*c, a + 2*b + 2*c + 999, 125*b]
++             50*c^2 + 600*b + 650*c,
++             a + 2*b + 2*c + 999,
++             125*b]
+ 
+         ::
+ 
+diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+index 947eeb2..220e4d3 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+@@ -594,7 +594,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+ 
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1182,7 +1182,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = QQ[]
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1198,9 +1198,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = PolynomialRing(k,3)
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 3
+-            //   1 parameter    : a
+-            //   minpoly        : (a^3-a+1)
++            //   coefficients: ZZ/3[a]/(a^3-a+1)
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1216,7 +1214,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x> = QQ[]
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1256,7 +1254,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x,y,z> = QQ[]
+             sage: P._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 3
+             //        block   1 : ordering dp
+             //                  : names    x y z
+@@ -1271,9 +1269,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R.<x,y> = PolynomialRing(NumberField(w^2+1,'s'))
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   1 parameter    : s
+-            //   minpoly        : (s^2+1)
++            //   coefficients: QQ[s]/(s^2+1)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1282,9 +1278,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(2**8,'a'),10,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
+-            //   1 parameter    : a
+-            //   minpoly        : (a^8+a^4+a^3+a^2+1)
++            //   coefficients: ZZ/2[a]/(a^8+a^4+a^3+a^2+1)
+             //   number of vars : 10
+             //        block   1 : ordering rp
+             //                  : names    x0 x1 x2 x3 x4 x5 x6 x7 x8 x9
+@@ -1293,7 +1287,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(127),2,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 2
+             //        block   1 : ordering rp
+             //                  : names    x0 x1
+@@ -1302,7 +1296,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,2,'x', order='invlex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering rp
+             //                  : names    x0 x1
+@@ -1311,7 +1305,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,2,'x', order='degneglex')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering a
+             //                  : names    x0 x1
+@@ -1323,7 +1317,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(QQ,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1332,7 +1326,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = PolynomialRing(GF(127),'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -1341,7 +1335,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = ZZ['x,y']
+             sage: singular(R)
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1350,7 +1344,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : Z/2^10
++            //   coefficients: Z/2^10
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1359,7 +1353,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(15)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : ZZ/15
++            //   coefficients: ZZ/bigint(15)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -1370,7 +1364,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: P.<x> = QQ[]
+             sage: P._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+diff --git a/src/sage/rings/polynomial/pbori.pyx b/src/sage/rings/polynomial/pbori.pyx
+index 23c346e..812f3b9 100644
+--- a/src/sage/rings/polynomial/pbori.pyx
++++ b/src/sage/rings/polynomial/pbori.pyx
+@@ -1410,7 +1410,7 @@ cdef class BooleanPolynomialRing(MPolynomialRing_generic):
+             sage: B.<x,y> = BooleanPolynomialRing(2)
+             sage: B._singular_() # indirect doctest
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
++            //   coefficients: ZZ/2
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    x y
+diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring.py b/src/sage/rings/polynomial/polynomial_quotient_ring.py
+index d5db40b..28fa62b 100644
+--- a/src/sage/rings/polynomial/polynomial_quotient_ring.py
++++ b/src/sage/rings/polynomial/polynomial_quotient_ring.py
+@@ -612,7 +612,7 @@ class PolynomialQuotientRing_generic(CommutativeRing):
+             sage: Q = P.quo([(x^2+1)])
+             sage: singular(Q)        # indirect doctest
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    xbar
+diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
+index 3f0d1d0..1230a5e 100644
+--- a/src/sage/rings/polynomial/polynomial_singular_interface.py
++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
+@@ -81,9 +81,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x,y> = PolynomialRing(CC,'x',2)
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (complex:15 digits, additional 0 digits)
+-            //   1 parameter    : I
+-            //   minpoly        : (I^2+1)
++            //   coefficients: float[I](complex:15 digits, additional 0 digits)/(I^2+1)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -91,7 +89,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x,y> = PolynomialRing(RealField(100),'x',2)
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0 (real)
++            //   coefficients: float
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -101,9 +99,7 @@ class PolynomialRing_singular_repr:
+             sage: R.<x> = PolynomialRing(NumberField(w^2+1,'s'))
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   1 parameter    : s
+-            //   minpoly        : (s^2+1)
++            //   coefficients: QQ[s]/(s^2+1)
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -112,7 +108,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(GF(127),1,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -121,7 +117,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(QQ,1,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -130,7 +126,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(QQ,'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -139,7 +135,7 @@ class PolynomialRing_singular_repr:
+             sage: R = PolynomialRing(GF(127),'x')
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    x
+@@ -148,9 +144,7 @@ class PolynomialRing_singular_repr:
+             sage: R = Frac(ZZ['a,b'])['x,y']
+             sage: singular(R)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
+-            //   2 parameter    : a b
+-            //   minpoly        : 0
++            //   coefficients: QQ(a, b)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -160,7 +154,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : Z/2^10
++            //   coefficients: Z/2^10
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -169,7 +163,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(15)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coeff. ring is : ZZ/15
++            //   coefficients: ZZ/bigint(15)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -178,7 +172,7 @@ class PolynomialRing_singular_repr:
+             sage: R = ZZ['x,y']
+             sage: singular(R)
+             polynomial ring, over a domain, global ordering
+-            //   coeff. ring is : ZZ
++            //   coefficients: ZZ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -190,9 +184,7 @@ class PolynomialRing_singular_repr:
+             sage: S = K['y']
+             sage: singular(S)
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 5
+-            //   1 parameter    : x
+-            //   minpoly        : 0
++            //   coefficients: ZZ/5(x)
+             //   number of vars : 2
+             //        block   1 : ordering lp
+             //                  : names    a y
+@@ -234,7 +226,7 @@ class PolynomialRing_singular_repr:
+ 
+             sage: PolynomialRing(QQ,'u_ba')._singular_init_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 1
+             //        block   1 : ordering lp
+             //                  : names    u_ba
+diff --git a/src/sage/rings/polynomial/term_order.py b/src/sage/rings/polynomial/term_order.py
+index 213a36c..c169f33 100644
+--- a/src/sage/rings/polynomial/term_order.py
++++ b/src/sage/rings/polynomial/term_order.py
+@@ -1756,7 +1756,7 @@ class TermOrder(SageObject):
+             '(lp(3),Dp(5),lp(2))'
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 127
++            //   coefficients: ZZ/127
+             //   number of vars : 10
+             //        block   1 : ordering lp
+             //                  : names    x0 x1 x2
+@@ -1784,7 +1784,7 @@ class TermOrder(SageObject):
+             '(a(1:2),ls(2),a(1:2),ls(2))'
+             sage: P._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 4
+             //        block   1 : ordering a
+             //                  : names    x0 x1
+diff --git a/src/sage/rings/quotient_ring.py b/src/sage/rings/quotient_ring.py
+index a670513..d78fb70 100644
+--- a/src/sage/rings/quotient_ring.py
++++ b/src/sage/rings/quotient_ring.py
+@@ -1174,7 +1174,7 @@ class QuotientRing_nc(ring.Ring, sage.structure.parent_gens.ParentWithGens):
+             sage: S = R.quotient_ring(x^2+y^2)
+             sage: S._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 0
++            //   coefficients: QQ
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+diff --git a/src/sage/rings/quotient_ring_element.py b/src/sage/rings/quotient_ring_element.py
+index e6565a7..d5bd037 100644
+--- a/src/sage/rings/quotient_ring_element.py
++++ b/src/sage/rings/quotient_ring_element.py
+@@ -786,7 +786,7 @@ class QuotientRingElement(RingElement):
+             sage: Q = P.quo(I)
+             sage: Q._singular_()
+             polynomial ring, over a field, global ordering
+-            //   characteristic : 2
++            //   coefficients: ZZ/2
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+diff --git a/src/sage/schemes/affine/affine_morphism.py b/src/sage/schemes/affine/affine_morphism.py
+index d061b40..611b274 100644
+--- a/src/sage/schemes/affine/affine_morphism.py
++++ b/src/sage/schemes/affine/affine_morphism.py
+@@ -670,7 +670,7 @@ class SchemeMorphism_polynomial_affine_space(SchemeMorphism_polynomial):
+             sage: H = Hom(A,A)
+             sage: F = H([1/2*x^2 + sqrt(3)])
+             sage: F.dynatomic_polynomial([1,1])
+-            (2.00000000000000*x^4 + 5.85640646055102*x^2 + 24.0000000000000)/(x^2 + (-2.00000000000000)*x + 3.46410161513775)
++            (0.125000000000000*x^4 + 0.366025403784439*x^2 + 1.50000000000000)/(0.500000000000000*x^2 - x + 1.73205080756888)
+         """
+         if self.domain() != self.codomain():
+             raise TypeError("must have same domain and codomain to iterate")
+diff --git a/src/sage/schemes/curves/projective_curve.py b/src/sage/schemes/curves/projective_curve.py
+index e2de777..0e88d70 100644
+--- a/src/sage/schemes/curves/projective_curve.py
++++ b/src/sage/schemes/curves/projective_curve.py
+@@ -1830,7 +1830,7 @@ class ProjectivePlaneCurve_prime_finite_field(ProjectivePlaneCurve_finite_field)
+             sage: C = Curve(f); pts = C.rational_points()
+             sage: D = C.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ])
+             sage: C.riemann_roch_basis(D)
+-            [(-2*x + y)/(x + y), (-x + z)/(x + y)]
++            [(-x - 2*y)/(-2*x - 2*y), (-x + z)/(x + y)]
+ 
+ 
+         .. NOTE::

Copied: sagemath/repos/community-staging-x86_64/sagemath-singular-4.1.0.p3.patch (from rev 233756, sagemath/trunk/sagemath-singular-4.1.0.p3.patch)
===================================================================
--- community-staging-x86_64/sagemath-singular-4.1.0.p3.patch	                        (rev 0)
+++ community-staging-x86_64/sagemath-singular-4.1.0.p3.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,118 @@
+diff --git a/src/sage/libs/singular/decl.pxd b/src/sage/libs/singular/decl.pxd
+index 2dec5d8..676544a 100644
+--- a/src/sage/libs/singular/decl.pxd
++++ b/src/sage/libs/singular/decl.pxd
+@@ -534,6 +534,9 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     int rRing_has_Comp(ring *r)
+ 
++    int rHasGlobalOrdering(ring *r)
++    int rHasLocalOrMixedOrdering(ring *r)
++
+     # return new empty monomial
+ 
+     poly *p_Init(ring *r)
+@@ -598,7 +601,7 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     # homogenizes p by multiplying certain powers of the varnum-th variable
+ 
+-    poly *pHomogen (poly *p, int varnum)
++    poly *p_Homogen (poly *p, int varnum, ring *r)
+ 
+     # return whether a polynomial is homogenous
+ 
+@@ -710,7 +713,7 @@ cdef extern from "singular/Singular/libsingular.h":
+ 
+     # inverse of poly, if possible
+ 
+-    poly *pInvers(int n, poly *, intvec *)
++    poly *p_Series(int n, poly *, poly *, intvec *, ring *r)
+ 
+     # gcd of f and g
+ 
+@@ -766,6 +769,10 @@ cdef extern from "singular/Singular/libsingular.h":
+     # Copy this number
+     number *n_Copy(number *n, ring* r)
+ 
++    # Invert this number
++    int n_IsUnit(number *n, const n_Procs_s *cf)
++    number *n_Invers(number *n, const n_Procs_s *cf)
++
+     # rational number from int
+ 
+     number *nlInit(int)
+diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+index ffc6787..656acc9 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
++++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+@@ -186,12 +186,13 @@ from sage.libs.singular.decl cimport n_unknown,  n_Zp,  n_Q,   n_R,   n_GF,  n_l
+ # singular functions
+ from sage.libs.singular.decl cimport (
+     errorreported,
++    n_IsUnit, n_Invers,
+     p_ISet, rChangeCurrRing, p_Copy, p_Init, p_SetCoeff, p_Setm, p_SetExp, p_Add_q,
+     p_NSet, p_GetCoeff, p_Delete, p_GetExp, pNext, rRingVar, omAlloc0, omStrDup,
+     omFree, pDivide, p_SetCoeff0, n_Init, p_DivisibleBy, pLcm, p_LmDivisibleBy,
+     pDivide, p_IsConstant, p_ExpVectorEqual, p_String, p_LmInit, n_Copy,
+-    p_IsUnit, pInvers, p_Head, idInit, fast_map_common_subexp, id_Delete,
+-    p_IsHomogeneous, pHomogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
++    p_IsUnit, p_Series, p_Head, idInit, fast_map_common_subexp, id_Delete,
++    p_IsHomogeneous, p_Homogen, p_Totaldegree,pLDeg1_Totaldegree, singclap_pdivide, singclap_factorize,
+     idLift, IDELEMS, On, Off, SW_USE_CHINREM_GCD, SW_USE_EZGCD,
+     p_LmIsConstant, pTakeOutComp1, singclap_gcd, pp_Mult_qq, p_GetMaxExp,
+     pLength, kNF, p_Neg, p_Minus_mm_Mult_qq, p_Plus_mm_Mult_qq,
+@@ -1353,7 +1354,7 @@ cdef class MPolynomialRing_libsingular(MPolynomialRing_generic):
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coefficients: Z/2^10
++            //   coefficients: ZZ/(2^10)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y
+@@ -3112,11 +3113,11 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
+         cdef ring *_ring = self._parent_ring
+         if(_ring != currRing): rChangeCurrRing(_ring)
+ 
+-        if not p_IsUnit(self._poly, _ring):
++        if not (p_IsUnit(self._poly,_ring)):
+             raise ArithmeticError("Element is not a unit.")
+ 
+         sig_on()
+-        cdef MPolynomial_libsingular r = new_MP(self._parent, pInvers(0, self._poly, NULL))
++        cdef MPolynomial_libsingular r = new_MP(self._parent, p_NSet(n_Invers(p_GetCoeff(self._poly, _ring),_ring.cf),_ring))
+         sig_off()
+         return r
+ 
+@@ -3171,14 +3172,17 @@ cdef class MPolynomial_libsingular(sage.rings.polynomial.multi_polynomial.MPolyn
+ 
+         SEE: ``self.homogenize``
+         """
++        cdef ring *_ring = self._parent_ring
+         cdef MPolynomialRing_libsingular parent = self._parent
+         cdef MPolynomial_libsingular f
+ 
+         if self.is_homogeneous():
+             return self
+ 
++        if(_ring != currRing): rChangeCurrRing(_ring)
++
+         if var < parent._ring.N:
+-            return new_MP(parent, pHomogen(p_Copy(self._poly, self._parent_ring), var+1))
++            return new_MP(parent, p_Homogen(self._poly, var+1, _ring))
+         else:
+             raise TypeError("var must be < self.parent().ngens()")
+ 
+diff --git a/src/sage/rings/polynomial/polynomial_singular_interface.py b/src/sage/rings/polynomial/polynomial_singular_interface.py
+index 1230a5e..1eb2566 100644
+--- a/src/sage/rings/polynomial/polynomial_singular_interface.py
++++ b/src/sage/rings/polynomial/polynomial_singular_interface.py
+@@ -154,7 +154,7 @@ class PolynomialRing_singular_repr:
+             sage: R = IntegerModRing(1024)['x,y']
+             sage: singular(R)
+             polynomial ring, over a ring (with zero-divisors), global ordering
+-            //   coefficients: Z/2^10
++            //   coefficients: ZZ/(2^10)
+             //   number of vars : 2
+             //        block   1 : ordering dp
+             //                  : names    x y

Copied: sagemath/repos/community-staging-x86_64/skip-check.patch (from rev 233756, sagemath/trunk/skip-check.patch)
===================================================================
--- community-staging-x86_64/skip-check.patch	                        (rev 0)
+++ community-staging-x86_64/skip-check.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,22 @@
+--- src/bin/sage.orig	2014-12-18 09:47:27.354829070 +0100
++++ src/bin/sage	2014-12-18 09:48:00.041563401 +0100
+@@ -352,18 +352,6 @@
+ 
+ # Prepare for running Sage, either interactively or non-interactively.
+ sage_setup() {
+-    # Check that we're not in a source tarball which hasn't been built yet (#13561).
+-    if [ ! -d "$SAGE_LOCAL/lib/python/site-packages/sage" ]; then
+-        echo >&2 '************************************************************************'
+-        echo >&2 'It seems that you are attempting to run Sage from an unpacked source'
+-        echo >&2 'tarball, but you have not compiled it yet (or maybe the build has not'
+-        echo >&2 'finished). You should run `make` in the Sage root directory first.'
+-        echo >&2 'If you did not intend to build Sage from source, you should download'
+-        echo >&2 'a binary tarball instead. Read README.txt for more information.'
+-        echo >&2 '************************************************************************'
+-        exit 1
+-    fi
+-
+     # Display the startup banner (unless SAGE_BANNER is explictly "no")
+     if [ "$SAGE_BANNER" != "no" ]; then
+         # can be 'bare', or 'yes', or unspecified
+

Copied: sagemath/repos/community-staging-x86_64/test-optional.patch (from rev 233756, sagemath/trunk/test-optional.patch)
===================================================================
--- community-staging-x86_64/test-optional.patch	                        (rev 0)
+++ community-staging-x86_64/test-optional.patch	2017-06-03 13:58:52 UTC (rev 233757)
@@ -0,0 +1,25 @@
+--- src/sage/doctest/control.py.orig       2016-10-20 19:39:53.714618246 +0200
++++ src/sage/doctest/control.py    2016-10-20 19:40:15.158049920 +0200
+@@ -307,22 +307,6 @@
+             if "all" in options.optional:
+                 # Special case to run all optional tests
+                 options.optional = True
+-            else:
+-                # We replace the 'optional' tag by all optional
+-                # packages for which the installed version matches the
+-                # latest available version (this implies in particular
+-                # that the package is actually installed).
+-                if 'optional' in options.optional:
+-                    options.optional.discard('optional')
+-                    from sage.misc.package import list_packages
+-                    for pkg in list_packages('optional', local=True).values():
+-                        if pkg['installed_version'] == pkg['remote_version']:
+-                            options.optional.add(pkg['name'])
+-
+-                # Check that all tags are valid
+-                for o in options.optional:
+-                    if not optionaltag_regex.search(o):
+-                        raise ValueError('invalid optional tag {!r}'.format(o))
+ 
+         self.options = options
+         self.files = args



More information about the arch-commits mailing list