[sagemath-database-elliptic-curves] 02/03: Updated to upstream 0.8

Julien Puydt julien.puydt at laposte.net
Tue Jun 23 16:55:03 UTC 2015


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

jpuydt-guest pushed a commit to branch master
in repository sagemath-database-elliptic-curves.

commit bfd68b02e5d7d6adb4473df57e4ef553e7e73827
Author: Julien Puydt <julien.puydt at laposte.net>
Date:   Sun Feb 22 09:33:40 2015 +0100

    Updated to upstream 0.8
---
 debian/README.source |  7 -----
 debian/changelog     |  6 ++++
 debian/control       |  2 +-
 debian/copyright     | 12 +++----
 debian/rules         |  5 +--
 debian/spkg-install  | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 102 insertions(+), 18 deletions(-)

diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index 75adfd1..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,7 +0,0 @@
-README.source
-
-The +dfsg.orig.tar.bz2 upstream source tarball is obtained by:
-- renaming the .spkg to .tar.bz2 (the debian/watch file does this)
-- unpacking, removing all mercurial files (.hg*)
-- renaming the directory with an appended +dfsg
-- repacking with a +dfsg version
diff --git a/debian/changelog b/debian/changelog
index 27679a1..a57e7d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+sagemath-database-elliptic-curves (0.8-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Julien Puydt <julien.puydt at laposte.net>  Sun, 22 Feb 2015 08:53:59 +0100
+
 sagemath-database-elliptic-curves (0.7+dfsg-1) unstable; urgency=low
 
   * Initial release. (Closes: #703297)
diff --git a/debian/control b/debian/control
index 13526eb..1606ce3 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.
 Uploaders: Julien Puydt <julien.puydt at laposte.net>
 Section: math
 Priority: optional
-Standards-Version: 3.9.4
+Standards-Version: 3.9.6
 Homepage: http://www.sagemath.org/packages/standard/
 Build-Depends: debhelper (>= 9), python (>= 2.7)
 Vcs-Git: git://anonscm.debian.org/debian-science/packages/sagemath-database-elliptic-curves.git
diff --git a/debian/copyright b/debian/copyright
index 1dbd7a2..c646f6f 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -3,20 +3,20 @@ Upstream-Name: elliptic_curves
 Upstream-Contact: R. Andrew Ohana <andrew.ohana at gmail.com>
 Source: http://www.sagemath.org/packages/standard/
 
-Files: src/common/allcurves.00000-09999
+Files: common/allcurves.00000-09999
 Copyright: 2011-2013, J. E. Cremona, University of Warwick, U.K.
 License: GPL-2+
 
-Files: src/ellcurves/rank[3-8]
+Files: ellcurves/*
 Copyright: 2011-2013, W. A. Stein, University of Washington, U.S.A.
 License: GPL-2+
 
-Files: spkg-install
-Copyright: 2011-2013, R. A. Ohana <andrew.ohana at gmail.com>
+Files: debian/*
+Copyright: 2013-2015, Julien Puydt <julien.puydt at laposte.net>
 License: GPL-2+
 
-Files: debian/*
-Copyright: 2013, Julien Puydt <julien.puydt at laposte.net>
+Files: debian/spkg-install
+Copyright: 2011-2015, R. A. Ohana <andrew.ohana at gmail.com>
 License: GPL-2+
 
 License: GPL-2+
diff --git a/debian/rules b/debian/rules
index e6cf738..dc972e4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,10 +4,7 @@
 	dh $@
 
 override_dh_auto_build:
-	 SAGE_SHARE=./build python spkg-install
+	 SAGE_SHARE=./build python debian/spkg-install
 
 override_dh_auto_clean:
 	rm -rf build
-
-override_dh_installchangelogs:
-	dh_installchangelogs SPKG.txt
diff --git a/debian/spkg-install b/debian/spkg-install
new file mode 100755
index 0000000..134f121
--- /dev/null
+++ b/debian/spkg-install
@@ -0,0 +1,88 @@
+#!/usr/bin/env python
+
+import os
+common_curves = os.path.join(os.getcwd(), 'common')
+
+def install_cremona():
+    from sqlite3 import connect
+
+    if 'SAGE_SHARE' not in os.environ:
+        raise RuntimeError("SAGE_SHARE undefined, maybe run `sage -sh`?")
+
+    cremona_root = os.path.join(os.environ['SAGE_SHARE'], 'cremona')
+    if not os.path.exists(cremona_root):
+        os.makedirs(cremona_root)
+
+    target = os.path.join(cremona_root, 'cremona_mini.db')
+
+    if os.path.exists(target):
+        os.remove(target)
+
+    con = connect(target)
+
+    con.execute('CREATE TABLE t_class(rank INTEGER, class TEXT PRIMARY KEY,'
+            ' conductor INTEGER)')
+    con.execute('CREATE TABLE t_curve(curve TEXT PRIMARY KEY, class TEXT, tors'
+            ' INTEGER, eqn TEXT UNIQUE)')
+    con.execute('CREATE INDEX i_t_class_conductor ON t_class(conductor)')
+    con.execute('CREATE INDEX i_t_curve_class ON t_curve(class)')
+
+    class_data = []
+    curve_data = []
+
+    for line in open(os.path.join(common_curves, 'allcurves.00000-09999')):
+        N, iso, num, eqn, r, tors = line.split()
+        cls = N + iso
+        cur = cls + num
+        if num == "1":
+            class_data.append((N, cls, r))
+        curve_data.append((cur, cls, eqn, tors))
+
+    con.executemany('INSERT INTO t_class(conductor,class,rank) VALUES'
+            ' (?,?,?)', class_data)
+    con.executemany('INSERT INTO t_curve(curve,class,eqn,tors) VALUES'
+            ' (?,?,?,?)', curve_data)
+
+    con.commit()
+
+def install_ellcurves():
+    import shutil, tempfile
+
+    if 'SAGE_SHARE' not in os.environ:
+        raise RuntimeError("SAGE_SHARE undefined, maybe run `sage -sh`?")
+
+    target = os.path.join(os.environ['SAGE_SHARE'], 'ellcurves')
+    if os.path.exists(target):
+        try:
+            shutil.rmtree(target)
+        except OSError:
+            os.remove(target)
+
+    shutil.move(os.path.join(os.getcwd(), 'ellcurves'), target)
+    rank = {}
+    for line in open(os.path.join(common_curves, 'allcurves.00000-09999')):
+        r = line.split()[4]
+        if r not in rank:
+            rank[r] = open(tempfile.mkstemp()[1], 'w')
+        rank[r].write(line)
+
+    for r, f in rank.items():
+        f.close()
+        endpath = os.path.join(target, 'rank' + r)
+        if os.path.exists(endpath):
+            old = tempfile.mkstemp()[1]
+            shutil.move(endpath, old)
+            shutil.move(f.name, endpath)
+            f = open(endpath, 'a')
+            tmp = open(old, 'r')
+            f.write(tmp.read())
+            tmp.close()
+            f.close()
+            os.remove(old)
+        else:
+            shutil.move(f.name, endpath)
+        os.chmod(endpath, 0o644)
+
+if __name__ == '__main__':
+    install_cremona()
+    install_ellcurves()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath-database-elliptic-curves.git



More information about the debian-science-commits mailing list