[sagemath] 01/01: We have lift-off baby!

Ximin Luo infinity0 at debian.org
Mon Oct 17 00:14:17 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagemath.

commit 7fe93b589b03789ebb2c8fdaecce4259ffca5239
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Oct 17 02:06:55 2016 +0200

    We have lift-off baby!
    
    - Build in debian/build instead of debian/tmp, since dh_prep nukes debian/tmp
    - Don't clean docs when DEB_BUILD_OPTIONS contains nodoc
    - Have sage-env set SAGE_ROOT/SAGE_LOCAL automatically if called via PATH
---
 debian/README.Debian                      |  2 +-
 debian/control.in                         | 70 ++++++++++++++++++++++++++++---
 debian/copyright                          |  8 +++-
 debian/patches/debian-install-paths.patch | 44 ++++++++++++++++++-
 debian/rules                              | 45 +++++++++++++++++---
 debian/sagemath-common.install            |  2 +
 debian/sagemath-deps-common.install       |  4 ++
 debian/sagemath-deps.install              |  2 +
 debian/sagemath-doc-LANG.install.in       |  6 +--
 debian/sagemath.install                   |  3 ++
 10 files changed, 168 insertions(+), 18 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
index ba359be..eaf3bf0 100644
--- a/debian/README.Debian
+++ b/debian/README.Debian
@@ -33,7 +33,7 @@ of the logging output, there will be a summary of all the failures.
 After a successful build, you can run individual tests as follows. First, make
 sure you're in the top-level package directory, where debian/ is. Then:
  
- $ export SAGE_LOCAL=$PWD/debian/tmp/usr
+ $ export SAGE_LOCAL=$PWD/debian/build/usr
  $ export PYTHONPATH=$SAGE_LOCAL/lib/python2.7/dist-packages
  $ cd sage
  sage$ ./sage -t --long src/sage/geometry/riemannian_manifolds/parametrized_surface3d.py
diff --git a/debian/control.in b/debian/control.in
index 54f4b89..c920e01 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -1,3 +1,4 @@
+## DO NOT EDIT debian/control directly, edit debian/control.in instead
 Source: sagemath
 Section: math
 Priority: optional
@@ -178,10 +179,67 @@ Build-Depends:
  tachyon,
  zlib1g-dev,
 
-Package: sagemath-empty
+Package: sagemath
+Architecture: any
+Description: Sage: Open Source Mathematical Software
+ SageMath is a free open-source mathematics software system licensed under the
+ GPL. It builds on top of many existing open-source packages: NumPy, SciPy,
+ matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined
+ power through a common, Python-based language or directly via interfaces or
+ wrappers.
+ .
+ Mission: Creating a viable free open source alternative to Magma, Maple,
+ Mathematica and Matlab.
+ .
+ This package contains the main Sage installation.
+Depends: ${misc:Depends}, ${shlibs:Depends}, sagemath-common, sagemath-deps
+# TODO: missing a *lot* of python and other dependencies here
+
+Package: sagemath-common
+Architecture: all
+Description: Sage: Open Source Mathematical Software
+ SageMath is a free open-source mathematics software system licensed under the
+ GPL. It builds on top of many existing open-source packages: NumPy, SciPy,
+ matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined
+ power through a common, Python-based language or directly via interfaces or
+ wrappers.
+ .
+ Mission: Creating a viable free open source alternative to Magma, Maple,
+ Mathematica and Matlab.
+ .
+ This package contains the architecture-independent files of Sage.
+Depends: ${misc:Depends}, ${shlibs:Depends}
+
+Package: sagemath-deps
+Architecture: any
+Description: Sage: Open Source Mathematical Software
+ SageMath is a free open-source mathematics software system licensed under the
+ GPL. It builds on top of many existing open-source packages: NumPy, SciPy,
+ matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined
+ power through a common, Python-based language or directly via interfaces or
+ wrappers.
+ .
+ Mission: Creating a viable free open source alternative to Magma, Maple,
+ Mathematica and Matlab.
+ .
+ This package contains the external dependencies of Sage and will eventually
+ be deleted when we upload it to Debian officially, being replaced with
+ dependencies to other Debian packages.
+Depends: ${misc:Depends}, ${shlibs:Depends}, sagemath-deps-common
+
+Package: sagemath-deps-common
 Architecture: all
-Description: Empty package with the runtime dependencies of sage
- This meta-package depends on all dependencies of sage
- that are currently in Debian testing.
-Depends:
- ${misc:Depends}
+Description: Sage: Open Source Mathematical Software
+ SageMath is a free open-source mathematics software system licensed under the
+ GPL. It builds on top of many existing open-source packages: NumPy, SciPy,
+ matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined
+ power through a common, Python-based language or directly via interfaces or
+ wrappers.
+ .
+ Mission: Creating a viable free open source alternative to Magma, Maple,
+ Mathematica and Matlab.
+ .
+ This package contains the architecture-independent external dependencies of
+ Sage and will eventually be deleted when we upload it to Debian officially,
+ being replaced with dependencies to other Debian packages.
+Depends: ${misc:Depends}, ${shlibs:Depends}
diff --git a/debian/copyright b/debian/copyright
index bfc5e5b..e7df81f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,9 +1,15 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: SageMath
+Source: https://www.sagemath.org/
 
 Files: *
 Copyright: Copyright (C) 2013 Felix Salfelder, Tobias Hansen
 License: GPL-2+
 
+Files: *
+Copyright: 2013-2016 Debian SageMath Maintainers <debian-science-sagemath at lists.alioth.debian.org>
+License: GPL-2+
+
 License: GPL-2+
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 2 as
diff --git a/debian/patches/debian-install-paths.patch b/debian/patches/debian-install-paths.patch
index 380c2ef..3c35076 100644
--- a/debian/patches/debian-install-paths.patch
+++ b/debian/patches/debian-install-paths.patch
@@ -14,10 +14,50 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
  
  sage: sage/libs/pari/auto_gen.pxi sage/ext/interpreters/__init__.py
 -	python -u setup.py install
-+	python -u setup.py install --root ../../debian/tmp --install-layout deb -O2
++	python -u setup.py install --root ../../debian/build --install-layout deb -O2
  
  clean:
  	@echo "Deleting Sage library build artifacts..."
+--- a/sage/src/bin/sage-env
++++ b/sage/src/bin/sage-env
+@@ -109,6 +109,10 @@
+     echo "$out"
+ }
+ 
++if [ "$(which "$(basename "$0")")" = "$0" ]; then
++    SAGE_LOCAL="${SAGE_LOCAL:-$(dirname $(dirname "$0"))}"
++    SAGE_ROOT="$SAGE_LOCAL"
++fi
+ 
+ # New value for SAGE_ROOT: either SAGE_ROOT (if given)
+ # or a guessed value based on pwd.
+@@ -128,17 +132,6 @@
+ # 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:"
+@@ -364,7 +357,7 @@
+     export SAGE_STARTUP_FILE
+ fi
+ 
+-IPYTHONDIR=`find "$SAGE_SPKG_INST" -name "ipython*"`
++IPYTHONDIR=`find "$SAGE_SPKG_INST" -name "ipython*" 2>/dev/null`
+ if [ -n "$IPYTHONDIR" ]; then
+     export IPYTHONDIR="$DOT_SAGE/${IPYTHONDIR##*/}"
+ fi
 --- a/sage/src/sage_setup/clean.py
 +++ b/sage/src/sage_setup/clean.py
 @@ -85,7 +85,7 @@
@@ -138,7 +178,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
          echo >&2 'tarball, but you have not compiled it yet (or maybe the build has not'
 --- a/sage/src/sage_setup/find.py
 +++ b/sage/src/sage_setup/find.py
-@@ -150,19 +150,18 @@ def installed_files_by_module(site_packages, modules=('sage',)):
+@@ -150,19 +150,18 @@
  
      EXAMPLES::
  
diff --git a/debian/rules b/debian/rules
index ab600af..d1c0a67 100755
--- a/debian/rules
+++ b/debian/rules
@@ -20,11 +20,12 @@ endif
 ifneq (,$(filter pkg.sagemath.ccache,$(DEB_BUILD_PROFILES)))
 export PATH := /usr/lib/ccache:$(PATH)
 export CCACHE_DIR := $(PWD)/debian/ccache
+export CCACHE_BASEDIR := $(PWD)/debian/build
 $(shell mkdir -p "$(CCACHE_DIR)")
 endif
 
-export SAGE_LOCAL = $(shell pwd)/debian/tmp/usr
-export PYTHONPATH = $(shell pwd)/debian/tmp/usr/lib/python2.7/dist-packages
+export SAGE_LOCAL = $(shell pwd)/debian/build/usr
+export PYTHONPATH = $(shell pwd)/debian/build/usr/lib/python2.7/dist-packages
 
 LANGS = $(shell cd sage/src/doc && find . -mindepth 1 -maxdepth 1 -type d | grep -v common | cut -b3-)
 DOCS_INSTALL = $(LANGS:%=debian/sagemath-doc-%.install)
@@ -33,6 +34,8 @@ DOCS_CONTROL = $(LANGS:%=debian/sagemath-doc-%.control)
 %:
 	dh $@ --parallel
 
+build: gencontrol
+
 gencontrol: $(DOCS_INSTALL) debian/control
 
 debian/control: debian/control.in $(DOCS_CONTROL)
@@ -50,10 +53,42 @@ override_dh_auto_build: prune
 override_dh_auto_test: ptestlong
 
 override_dh_auto_install:
-
-# upstream "clean" only cleans the sagelib build and not e.g. spkg builds
+	rm -rf debian/build/usr/var/tmp/sage/build
+# We built .pyo to make the docbuild/tests go faster, but as per Debian policy
+# we don't distribute them.
+	find debian/build '(' -name '*.pyc' -o -name '*.pyo' ')' -delete
+	mkdir -p debian/tmp
+	mv debian/build/* debian/tmp
+	rmdir debian/build
+
+# If we see "nodoc", don't clean the docs. This allows us to rebuild just the
+# non-docs without wiping away the docs we previously built, to save time.
 override_dh_auto_clean:
+ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
+	$(MAKE) --directory=sage -k clean sagelib-clean misc-clean || true
+else
 	$(MAKE) --directory=sage distclean
+endif
+
+override_dh_install:
+	dh_install --list-missing
+
+override_dh_shlibdeps:
+	dh_shlibdeps -l debian/tmp/usr/lib
+
+# If we see "nodoc", don't clean the docs. This allows us to rebuild just the
+# non-docs without wiping away the docs we previously built, to save time.
+override_dh_clean:
+ifneq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
+# Don't delete my precious docs debhelper! They took a whole fucking hour to build!
+	if [ -d debian/tmp/usr/share/doc ]; then \
+		mkdir -p debian/build/usr/share; \
+		mv -t debian/build/usr/share/ debian/tmp/usr/share/doc; \
+	fi
+	dh_clean
+else
+	dh_clean
+endif
 
 get-orig-source:
 	cd sage && git archive --prefix=sagemath_$(DEB_VERSION_UPSTREAM)/sage/ \
@@ -84,7 +119,7 @@ endif
 # its build directory. At least that's my (infinity0) impression; I didn't
 # investigate this in too much detail yet.
 clean-docbuild:
-	rm -rf debian/tmp/usr/share/doc/sage
+	rm -rf debian/build/usr/share/doc/sage
 
 reset: gencontrol clean clean-docbuild
 	QUILT_PATCHES=debian/patches quilt pop -af || true
diff --git a/debian/sagemath-common.install b/debian/sagemath-common.install
new file mode 100644
index 0000000..74c5f4f
--- /dev/null
+++ b/debian/sagemath-common.install
@@ -0,0 +1,2 @@
+usr/share/sage/ext
+usr/share/jupyter/*
diff --git a/debian/sagemath-deps-common.install b/debian/sagemath-deps-common.install
new file mode 100644
index 0000000..a205e23
--- /dev/null
+++ b/debian/sagemath-deps-common.install
@@ -0,0 +1,4 @@
+usr/bin/jmol
+usr/share/jsmol/*
+usr/share/jmol/*
+usr/include/planarity/*
diff --git a/debian/sagemath-deps.install b/debian/sagemath-deps.install
new file mode 100644
index 0000000..6024d5c
--- /dev/null
+++ b/debian/sagemath-deps.install
@@ -0,0 +1,2 @@
+usr/bin/planarity
+usr/lib/libplanarity.*
diff --git a/debian/sagemath-doc-LANG.install.in b/debian/sagemath-doc-LANG.install.in
index cc93d0f..4503be9 100644
--- a/debian/sagemath-doc-LANG.install.in
+++ b/debian/sagemath-doc-LANG.install.in
@@ -1,3 +1,3 @@
-debian/tmp/usr/share/doc/sage/doctrees/LANG    /usr/share/doc/sage/doctrees/
-debian/tmp/usr/share/doc/sage/html/LANG        /usr/share/doc/sage/html/
-debian/tmp/usr/share/doc/sage/inventory/LANG   /usr/share/doc/sage/inventory/
+usr/share/doc/sage/doctrees/LANG
+usr/share/doc/sage/html/LANG
+usr/share/doc/sage/inventory/LANG
diff --git a/debian/sagemath.install b/debian/sagemath.install
new file mode 100644
index 0000000..4c0a206
--- /dev/null
+++ b/debian/sagemath.install
@@ -0,0 +1,3 @@
+usr/bin/sage*
+usr/lib/python2.7/dist-packages/sage*
+# TODO: a lot of this could be moved to sagemath-common

-- 
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