[arch-commits] Commit in sage-data-conway_polynomials/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Tue Jul 7 13:49:10 UTC 2020
Date: Tuesday, July 7, 2020 @ 13:49:10
Author: felixonmars
Revision: 658607
archrelease: copy trunk to community-staging-any
Added:
sage-data-conway_polynomials/repos/community-staging-any/
sage-data-conway_polynomials/repos/community-staging-any/PKGBUILD
(from rev 658605, sage-data-conway_polynomials/trunk/PKGBUILD)
sage-data-conway_polynomials/repos/community-staging-any/spkg-install
(from rev 658605, sage-data-conway_polynomials/trunk/spkg-install)
--------------+
PKGBUILD | 22 ++++++++++++++++++++++
spkg-install | 20 ++++++++++++++++++++
2 files changed, 42 insertions(+)
Copied: sage-data-conway_polynomials/repos/community-staging-any/PKGBUILD (from rev 658605, sage-data-conway_polynomials/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD (rev 0)
+++ community-staging-any/PKGBUILD 2020-07-07 13:49:10 UTC (rev 658607)
@@ -0,0 +1,22 @@
+# Maintainer: Antonio Rojas <arojas at archlinux.org>
+
+_dbname=conway_polynomials
+pkgname=sage-data-$_dbname
+pkgver=0.5
+pkgrel=4
+pkgdesc="A small database of Conway polynomials"
+arch=(any)
+url="https://www.sagemath.org"
+license=(GPL)
+depends=()
+makedepends=(python2-six)
+source=("https://mirrors.mit.edu/sage/spkg/upstream/conway_polynomials/$_dbname-$pkgver.tar.bz2" 'spkg-install')
+sha256sums=('d8f2788a85b1c2482cc4abe1a35d3da777445e21ec49b031d36b899e3c0deb17'
+ '02a93174df87f7afe55a7720571e04df3471bd7dad197017b16bc83396b32254')
+
+package() {
+ export SAGE_SHARE="$pkgdir"/usr/share
+ export PYTHONPATH=$PWD
+ ln -s conway_polynomials-$pkgver src
+ python2 spkg-install
+}
Copied: sage-data-conway_polynomials/repos/community-staging-any/spkg-install (from rev 658605, sage-data-conway_polynomials/trunk/spkg-install)
===================================================================
--- community-staging-any/spkg-install (rev 0)
+++ community-staging-any/spkg-install 2020-07-07 13:49:10 UTC (rev 658607)
@@ -0,0 +1,20 @@
+import os
+from six.moves import cPickle as pickle
+
+SAGE_SHARE = os.getenv('SAGE_SHARE')
+install_root = os.path.join(SAGE_SHARE, 'conway_polynomials')
+
+def create_db():
+ db = {}
+ from src import conway_polynomials
+ for p, n, v in conway_polynomials:
+ if not p in db:
+ db[p] = {}
+ db[p][n] = v
+ if not os.path.exists(install_root):
+ os.makedirs(install_root)
+ with open(os.path.join(install_root, 'conway_polynomials.p'), 'wb') as f:
+ pickle.dump(db, f)
+
+if __name__ == '__main__':
+ create_db()
More information about the arch-commits
mailing list