[sagemath] 01/02: Use /usr/share/sagemath instead of /usr/share/sage as SAGE_SHARE directory.
Tobias Hansen
thansen at moszumanska.debian.org
Tue Dec 20 16:48:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch _wip_sagemath_paths
in repository sagemath.
commit 8316a911d804f1faf82dda58ae6212a20e2582d4
Author: Tobias Hansen <thansen at debian.org>
Date: Mon Dec 19 20:09:20 2016 +0000
Use /usr/share/sagemath instead of /usr/share/sage as SAGE_SHARE directory.
---
debian/adhoc/sage-env | 12 +--
debian/patches/d0-paths-sharedata.patch | 167 --------------------------------
debian/patches/d1-sage-cli.patch | 2 +-
debian/patches/d1-sage-env.patch | 31 ++++++
debian/patches/d1-scripts-dir.patch | 10 +-
debian/patches/series | 1 -
debian/sagemath-common.install | 6 +-
7 files changed, 46 insertions(+), 183 deletions(-)
diff --git a/debian/adhoc/sage-env b/debian/adhoc/sage-env
index 0cd6942..a057653 100644
--- a/debian/adhoc/sage-env
+++ b/debian/adhoc/sage-env
@@ -1,7 +1,7 @@
#!/bin/bash
if [[ -z ${SAGE_ROOT} ]]; then
- export SAGE_ROOT="/usr/share/sage"
+ export SAGE_ROOT="/usr/share/sagemath"
fi
if [[ -z ${SAGE_LOCAL} ]]; then
@@ -9,11 +9,11 @@ if [[ -z ${SAGE_LOCAL} ]]; then
fi
if [[ -z ${SAGE_DATA} ]]; then
- export SAGE_DATA="/usr/share/sage"
+ export SAGE_DATA="/usr/share/sagemath"
fi
if [[ -z ${SAGE_SHARE} ]]; then
- export SAGE_SHARE="/usr/share/sage"
+ export SAGE_SHARE="/usr/share/sagemath"
fi
if [[ -z ${SAGE_DOC} ]]; then
@@ -27,15 +27,15 @@ if [[ -z ${SAGE_DOC_SRC} ]]; then
fi
if [[ -z ${SAGE_EXTCODE} ]]; then
- export SAGE_EXTCODE="/usr/share/sage/ext"
+ export SAGE_EXTCODE="/usr/share/sagemath/ext"
fi
if [[ -z ${SAGE_SPKG_INST} ]]; then
- export SAGE_SPKG_INST="/usr/share/sage/installed"
+ export SAGE_SPKG_INST="/usr/share/sagemath/installed"
fi
if [[ -z ${SAGE_SCRIPTS_DIR} ]]; then
- export SAGE_SCRIPTS_DIR="/usr/share/sage/bin"
+ export SAGE_SCRIPTS_DIR="/usr/share/sagemath/bin"
fi
if [[ -z ${DOT_SAGE} ]]; then
diff --git a/debian/patches/d0-paths-sharedata.patch b/debian/patches/d0-paths-sharedata.patch
deleted file mode 100644
index 1732ff5..0000000
--- a/debian/patches/d0-paths-sharedata.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-Description: Hard-code paths to system shared data
- This could be made generic and forwarded upstream. For example, add another
- SAGE_SHARE_DATA directory, which for upstream would be the same as SAGE_SHARE
- and for us would be /usr/share/sagemeth.
-Author: Ximin Luo <infinity0 at debian.org>
-Forwarded: TODO
---- a/sage/src/sage/combinat/designs/latin_squares.py
-+++ b/sage/src/sage/combinat/designs/latin_squares.py
-@@ -544,8 +544,7 @@
- return
-
- if compare:
-- from sage.env import SAGE_SHARE
-- handbook_file = open(SAGE_SHARE+"/combinatorial_designs/MOLS_table.txt",'r')
-+ handbook_file = open("/usr/share/sagemath/combinatorial_designs/MOLS_table.txt",'r')
- hb = [int(_) for _ in handbook_file.readlines()[9].split(',')]
- handbook_file.close()
-
---- a/sage/src/sage/databases/conway.py
-+++ b/sage/src/sage/databases/conway.py
-@@ -22,9 +22,8 @@
- from six import itervalues
-
- import collections, os
--from sage.env import SAGE_SHARE
-
--_CONWAYDATA = os.path.join(SAGE_SHARE, 'conway_polynomials',
-+_CONWAYDATA = os.path.join('/usr/share/sagemath/conway_polynomials',
- 'conway_polynomials.sobj')
- _conwaydict = None
-
---- a/sage/src/sage/databases/cremona.py
-+++ b/sage/src/sage/databases/cremona.py
-@@ -54,12 +54,13 @@
- import sage.schemes.elliptic_curves.constructor as elliptic
- from .sql_db import SQLDatabase, verify_column
- from sage.misc.package import is_package_installed
--from sage.env import SAGE_SHARE
- from sage.misc.all import walltime
-
- import re
- import string
-
-+SAGE_SHARE = '/usr/share/sagemath/'
-+
- _cremonaSkeleton = {
- 't_class': {
- 'conductor': {'sql':'INTEGER', 'index':True},
-@@ -1663,8 +1664,7 @@
- Traceback (most recent call last):
- ...
- ValueError: Desired database (='should not exist') does not exist
-- sage: from sage.env import SAGE_SHARE
-- sage: os.path.isfile(os.path.join(SAGE_SHARE,'cremona','should_not_exist.db'))
-+ sage: os.path.isfile(os.path.join('/usr/share/sagemath/cremona','should_not_exist.db'))
- False
- """
- global _db
---- a/sage/src/sage/schemes/elliptic_curves/ec_database.py
-+++ b/sage/src/sage/schemes/elliptic_curves/ec_database.py
-@@ -117,8 +117,7 @@
- ((1, -1, 0, -106384, 13075804), 249649566346838)
-
- """
-- from sage.env import SAGE_SHARE
-- db = os.path.join(SAGE_SHARE,'ellcurves')
-+ db = '/usr/share/sagemath/ellcurves'
- data = os.path.join(db,'rank%s'%rank)
- if not os.path.exists(data):
- return []
---- a/sage/src/sage/graphs/isgci.py
-+++ b/sage/src/sage/graphs/isgci.py
-@@ -376,7 +376,8 @@
- from sage.structure.sage_object import SageObject
- from sage.structure.unique_representation import CachedRepresentation, UniqueRepresentation
- from sage.misc.unknown import Unknown
--from sage.env import SAGE_SHARE
-+
-+SAGE_SHARE = '/usr/share/sagemath/'
-
- #*****************************************************************************
- # Copyright (C) 2011 Nathann Cohen <nathann.cohen at gmail.com>
-@@ -835,8 +836,7 @@
-
- EXAMPLE::
-
-- sage: from sage.env import SAGE_SHARE
-- sage: graph_classes._parse_db(os.path.join(SAGE_SHARE,'graphs'))
-+ sage: graph_classes._parse_db('/usr/share/sagemath/graphs')
- """
- import xml.etree.cElementTree as ET
- import os.path
---- a/sage/src/sage/graphs/strongly_regular_db.pyx
-+++ b/sage/src/sage/graphs/strongly_regular_db.pyx
-@@ -3120,8 +3120,7 @@
- return
- import json
-
-- from sage.env import SAGE_SHARE
-- with open(SAGE_SHARE+"/graphs/brouwer_srg_database.json",'r') as datafile:
-+ with open("/usr/share/sagemath/graphs/brouwer_srg_database.json",'r') as datafile:
- _brouwer_database = {(v,k,l,mu):{'status':status,'comments':comments}
- for (v,k,l,mu,status,comments) in json.load(datafile)}
-
---- a/sage/src/sage/geometry/lattice_polytope.py
-+++ b/sage/src/sage/geometry/lattice_polytope.py
-@@ -112,7 +112,6 @@
- from sage.matrix.constructor import matrix
- from sage.matrix.matrix import is_Matrix
- from sage.misc.all import cached_method, tmp_filename
--from sage.env import SAGE_SHARE
- from sage.modules.all import vector, span
- from sage.misc.superseded import deprecated_function_alias, deprecation
- from sage.plot.plot3d.index_face_set import IndexFaceSet
-@@ -136,7 +135,7 @@
- from functools import reduce
-
-
--data_location = os.path.join(SAGE_SHARE,'reflexive_polytopes')
-+data_location = '/usr/share/sagemath/reflexive_polytopes'
-
-
- class SetOfAllLatticePolytopesClass(Set_generic):
---- a/sage/src/sage/geometry/polyhedron/palp_database.py
-+++ b/sage/src/sage/geometry/polyhedron/palp_database.py
-@@ -107,8 +107,7 @@
- self._data_basename = data_basename
- else:
- import os
-- from sage.env import SAGE_SHARE
-- self._data_basename = os.path.join(SAGE_SHARE, 'reflexive_polytopes',
-+ self._data_basename = os.path.join('/usr/share/sagemath/reflexive_polytopes',
- 'Full'+str(dim)+'d', 'zzdb')
- info = self._data_basename + '.info'
- if not os.path.exists(info):
---- a/sage/src/sage/databases/sql_db.py
-+++ b/sage/src/sage/databases/sql_db.py
-@@ -242,7 +242,6 @@
- skeleton = {}
- cur = database.__connection__.cursor()
- exe = cur.execute("SELECT name FROM sqlite_master WHERE TYPE='table'")
-- from sage.env import SAGE_SHARE
- for table in exe.fetchall():
- skeleton[table[0]] = {}
- exe1 = cur.execute("PRAGMA table_info(%s)"%table[0])
-@@ -257,7 +256,7 @@
- for col in exe2.fetchall():
- if col[1].find('sqlite') == -1:
- if database.__dblocation__ == \
-- os.path.join(SAGE_SHARE,'graphs','graphs.db'):
-+ os.path.join('/usr/share/sagemath/graphs','graphs.db'):
- name = col[1]
- else:
- name = col[1][len(table[0])+3:]
---- a/sage/src/sage/graphs/graph_database.py
-+++ b/sage/src/sage/graphs/graph_database.py
-@@ -54,9 +54,8 @@
- from sage.rings.integer import Integer
- from sqlite3 import dbapi2 as sqlite # if anyone would like to explain why dbapi2...
- from sage.databases.sql_db import SQLDatabase, SQLQuery
--from sage.env import SAGE_SHARE
- from sage.graphs.graph import Graph
--dblocation = os.path.join(SAGE_SHARE,'graphs','graphs.db')
-+dblocation = os.path.join('/usr/share/sagemath/graphs','graphs.db')
-
- def degseq_to_data(degree_sequence):
- """
diff --git a/debian/patches/d1-sage-cli.patch b/debian/patches/d1-sage-cli.patch
index 0f22a80..a88e171 100644
--- a/debian/patches/d1-sage-cli.patch
+++ b/debian/patches/d1-sage-cli.patch
@@ -250,7 +250,7 @@ Forwarded: not-needed
- echo >&2 '************************************************************************'
- exit 1
+ if [ "$SAGE_BANNER" != "no" ]; then
-+ cat "/usr/share/sage/bin/sage-banner"
++ cat "/usr/share/sagemath/bin/sage-banner"
fi
- # Display the startup banner (unless SAGE_BANNER is explictly "no")
diff --git a/debian/patches/d1-sage-env.patch b/debian/patches/d1-sage-env.patch
index 4d3294c..5d4215d 100644
--- a/debian/patches/d1-sage-env.patch
+++ b/debian/patches/d1-sage-env.patch
@@ -7,6 +7,15 @@ Author: Tobias Hansen <thansen at debian.org>, Ximin Luo <infinity0 at debian.org>
--- a/sage/src/bin/sage-env
+++ b/sage/src/bin/sage-env
+@@ -264,7 +264,7 @@
+ # depending on SAGE_ROOT and SAGE_LOCAL which are already defined.
+ export SAGE_ETC="$SAGE_LOCAL/etc"
+ export SAGE_SHARE="$SAGE_LOCAL/share"
+-export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
++export SAGE_EXTCODE="$SAGE_SHARE/sagemath/ext"
+ export SAGE_SPKG_INST="$SAGE_ROOT/local/var/lib/sage/installed"
+ export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
+ export SAGE_SRC="$SAGE_ROOT/src"
@@ -325,12 +325,12 @@
fi
@@ -55,3 +64,25 @@ Author: Tobias Hansen <thansen at debian.org>, Ximin Luo <infinity0 at debian.org>
# Handle parallel building/testing/...
# See Trac Ticket #12016
# First, figure out the right values for SAGE_NUM_THREADS (default
+--- a/sage/build/make/install
++++ b/sage/build/make/install
+@@ -11,7 +11,7 @@
+ fi
+ export SAGE_SRC="$SAGE_ROOT/src"
+ export SAGE_SHARE="$SAGE_LOCAL/share"
+-export SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
++export SAGE_EXTCODE="$SAGE_SHARE/sagemath/ext"
+ export SAGE_LOGS="$SAGE_ROOT/logs/pkgs"
+ export SAGE_SPKG_INST="$SAGE_ROOT/local/var/lib/sage/installed"
+ export SAGE_VERSION=`cat $SAGE_ROOT/VERSION.txt | sed 's+.*\ \(.*\),.*+\1+'`
+--- a/sage/configure.ac
++++ b/sage/configure.ac
+@@ -85,7 +85,7 @@
+ fi
+ SAGE_SRC="$SAGE_ROOT/src"
+ SAGE_SHARE="$SAGE_LOCAL/share"
+-SAGE_EXTCODE="$SAGE_SHARE/sage/ext"
++SAGE_EXTCODE="$SAGE_SHARE/sagemath/ext"
+ SAGE_SPKG_INST="$SAGE_ROOT/local/var/lib/sage/installed"
+
+ #---------------------------------------------------------
diff --git a/debian/patches/d1-scripts-dir.patch b/debian/patches/d1-scripts-dir.patch
index ce79be6..fa125ec 100644
--- a/debian/patches/d1-scripts-dir.patch
+++ b/debian/patches/d1-scripts-dir.patch
@@ -1,4 +1,4 @@
-Description: Find scripts when installed to /usr/share/sage/bin.
+Description: Find scripts when installed to /usr/share/sagemath/bin.
Most of these scripts are intended to be used via the sage script,
so we install only sage to /usr/bin.
Author: Tobias Hansen <thansen at debian.org>
@@ -11,7 +11,7 @@ Author: Tobias Hansen <thansen at debian.org>
#####################################################################
-. "$0-env" >&2
+if [ "\"$0\"" = "\"/usr/bin/sage\"" ]; then
-+ . "/usr/share/sage/bin/sage-env" >&2
++ . "/usr/share/sagemath/bin/sage-env" >&2
+else
+ . "$0-env" >&2
+fi
@@ -67,8 +67,8 @@ Author: Tobias Hansen <thansen at debian.org>
SAGE_SCRIPTS_DIR="$SAGE_LOCAL/bin"
elif [ -f "$SAGE_ROOT/src/bin/sage-env" ]; then
SAGE_SCRIPTS_DIR="$SAGE_ROOT/src/bin"
-+ elif [ -f "/usr/share/sage/bin/sage-env" ]; then
-+ SAGE_SCRIPTS_DIR="/usr/share/sage/bin"
++ elif [ -f "/usr/share/sagemath/bin/sage-env" ]; then
++ SAGE_SCRIPTS_DIR="/usr/share/sagemath/bin"
else
echo >&2 "Error: You must set the SAGE_SCRIPTS_DIR environment variable to run this"
return 1
@@ -137,7 +137,7 @@ Author: Tobias Hansen <thansen at debian.org>
if not os.path.exists(STARTUP):
- raise RuntimeError('You must get the file local/bin/sage-maxima.lisp')
-+ STARTUP = '/usr/share/sage/bin/sage-maxima.lisp'
++ STARTUP = '/usr/share/sagemath/bin/sage-maxima.lisp'
+ if not os.path.exists(STARTUP):
+ raise RuntimeError('You must get the file local/bin/sage-maxima.lisp')
diff --git a/debian/patches/series b/debian/patches/series
index e7d93bc..0393206 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -42,7 +42,6 @@ d0-pari-stackwarn.patch
d0-rubiks.patch
d0-singular.patch
d0-disable-jsmol.patch
-d0-paths-sharedata.patch
d0-paths.patch
# Patch Sage to behave as a Debian package
diff --git a/debian/sagemath-common.install b/debian/sagemath-common.install
index 953f1e5..fd397c6 100644
--- a/debian/sagemath-common.install
+++ b/debian/sagemath-common.install
@@ -1,8 +1,8 @@
usr/bin/sage
-debian/tmp/usr/bin/sage-* usr/share/sage/bin
-usr/share/sage/ext
+debian/tmp/usr/bin/sage-* usr/share/sagemath/bin
+usr/share/sagemath/ext
usr/lib/python2.7/dist-packages/sage*
-sage/local/var/lib/sage/installed usr/share/sage
+sage/local/var/lib/sage/installed usr/share/sagemath
# next 3 entries are part of a temporary hack around upstream #21732
# the other part of the hack is debian/patches/dt-work-around-doc-common-conf.patch
sage/src/sage/misc/__init__.py usr/lib/python2.7/dist-packages/sage/misc/docs
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git
More information about the debian-science-commits
mailing list