Merging Sage-5.12.rc0 and sage-git fixes

In addition to the newest rc0, this merges
* the "make download" target
* updated ".gitignore" for various temporary files,
* updated dev scripts
Merge important bugfix for dev scripts
Initial commit for GMP 5.1.3.
Explicit conversion in farey.cpp as recent GMP do not do it automatically.
Merge branch 'develop' of trac.sagemath.org:sage into develop

* 'develop' of trac.sagemath.org:sage: (1220 commits)
  Updated Sage version to 6.2.beta2
  fix doctest error
  Limit the GAP command line history
  integrate better with Integer.is_prime
  Combine ECM-GMP with Baillie-PSW for prime factorization
  Cleaned up documentation and formatting.
  add doctesr
  Trac 15262: fix combine function
  trac #15810: The graph data structures may have a ._directed but no .directed
  ignore randomness in assertion
  trac #15810: Immutable directed graphs should know that they are directed
  Trac 15166: regression test
  Fix representation of RIF elements with large exponent
  docbuilding: suppress warnings during latex build
  workaround for the utf8 code points in the Sage banner
  Trac 15798: fix mwrank doctest for Solaris
  do not abbreviate 3.99999... to 3.99 with # abs tol 1e-2
  Updated Sage version to 6.2.beta1
  Use posix locale for regex
  Let ncurses build again on Solaris.
  ...
allow Singular to build with recent versions of Xcode
trac #15951 correct one raise statement towards python3
Trac #13174: sagedoc.help() didn't discriminate cachedfuncs from funcs
use pydoc.pager on _sage_doc_unformatted instead
add definition
Only accepts fields as input for change_ring
Trac #15979: Toric varieties can be tricked into accepting base rings that are not fields

There are a couple of odd things right now:

This does not work:
{{{
sage: R = PolynomialRing(QQ, 2, 'a')
sage: P2 = toric_varieties.P2(base_ring=R)
...
TypeError: need a field to construct a Fano toric variety!
 Got Multivariate Polynomial Ring in a0, a1 over Rational Field
}}}
However, this does:
{{{
sage: R = PolynomialRing(QQ, 2, 'a')
sage: P2 = toric_varieties.P2(base_ring=QQ)
sage: P2 = P2.change_ring(R)
sage: P2.base_ring()
Multivariate Polynomial Ring in a0, a1 over Rational Field
}}}

The same problem also occurs for ToricVariety instead of
CPRFanoToricVariety.
Allowing general rings leads to some annoying behavior such as
{{{
sage: P2.base_ring()
Multivariate Polynomial Ring in a0, a1 over Rational Field
sage: P2.dimension()
4
}}}
Here the dimension of the spectrum of the base ring is added. Because of
that, integration in toric varieties does not work (although this can be
fixed, of course).

In any case, if one requires toric varieties to be defined over fields,
it should at least be consistent.

Best,
Jan

PS: It's also a bit annoying that ToricVariety and CPRFanoToricVariety
allow for the keyword base_field, but the catalog only allows base_ring.
Should that be adjusted?

URL: http://trac.sagemath.org/15979
Reported by: jkeitel
Ticket author(s): Jan Keitel
Reviewer(s): Volker Braun
Trac #15937: Singular won't compile with latest Xcode (5.1, build 5B130a)

Singular fails with the most recent version of Xcode (downloaded 12
March 2014), with the error
{{{
ld: symbol dyld_stub_binding_helper not found, normally in
crt1.o/dylib1.o/bundle1.o for architecture x86_64
fatal error: libtool: internal link edit command failed
}}}
One fix is to remove the line
{{{
export MACOSX_DEPLOYMENT_TARGET=10.4
}}}
from `spkg-install`, and use the value of `MACOSX_DEPLOYMENT_TARGET`
from `sage-env`. This needs testing on a variety of OS X machines.

URL: http://trac.sagemath.org/15937
Reported by: jhpalmieri
Ticket author(s): John Palmieri
Reviewer(s): François Bissey, Karl-Dieter Crisman, Volker Braun
Trac #13174: Wrong documentation for methods @cached_method

Calling help on a cached method returns the help for cached_method, not
for the actual method being cached :
{{{
sage:chi=DirichletGroup(6).0
sage:help(chi.conductor)
Help on CachedMethodCallerNoArgs in module sage.modular.dirichlet:

conductor(...)
    File: sage/misc/cachefunc.pyx (starting at line 1259)

    Utility class that is used by :class:`CachedMethod` to bind a
    cached method to an instance, in the case of a method that does
    not accept any arguments except ``self``.

    NOTE:

    The return value ``None`` would not be cached. So, if you have
    a method that does not accept arguments and may return ``None``
    after a lengthy computation, then ``@cached_method`` should not
    be used.

    EXAMPLE::

        sage: P.<a,b,c,d> = QQ[]
        sage: I = P*[a,b]
        sage: I.gens
        Cached version of <function gens at 0x...>
        sage: type(I.gens)
        <type 'sage.misc.cachefunc.CachedMethodCallerNoArgs'>
        sage: I.gens is I.gens
        True
        sage: I.gens() is I.gens()
        True

    AUTHOR:

    - Simon King (2011-04)

}}}

This is with 5.1.beta6 on an x86_64 box ; and I think it's a pretty big
bug since introspection is an important feature of sage.

URL: http://trac.sagemath.org/13174
Reported by: Snark
Ticket author(s): Ralf Stephan
Reviewer(s): Marc Mezzarobba
Trac #12661: Include GMP 5.1.3 as an optional package

Let's package GMP 5.1.3.

Upstream tarball at:
* https://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2

URL: http://trac.sagemath.org/12661
Reported by: SimonKing
Ticket author(s): Simon King, Jean-Pierre Flori
Reviewer(s): François Bissey
Trac #15951: Fix last string exception for python3

{{{sage/algebras/quatalg/quaternion_algebra.py}}}

has in line 988 the (hopefully) last string exception (I found no
other):

{{{raise "base field must be rational numbers or number field"}}}.

These have been deprecated since long.
They not accepted be Python 3.

URL: http://trac.sagemath.org/15951
Reported by: wluebbe
Ticket author(s): Wilfried Luebbe
Reviewer(s): Frédéric Chapoton