summaryrefslogtreecommitdiffstats
path: root/academic/mathics/mathics-create-database
diff options
context:
space:
mode:
author David Melik2015-07-14 19:50:34 +0200
committer Robby Workman2015-07-16 17:57:22 +0200
commit111f4c18e6c2fcc2ef7bc90c19d46c5a801810b3 (patch)
treea8a3091839d98f2d13cfdd9bc9f8a45893b6fa8a /academic/mathics/mathics-create-database
parent0cddda1267c2110c10c0d1f5e60f6a3c0357ae79 (diff)
downloadslackbuilds-111f4c18e6c2fcc2ef7bc90c19d46c5a801810b3.tar.gz
academic/mathics: Added (computer algebra system).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'academic/mathics/mathics-create-database')
-rw-r--r--academic/mathics/mathics-create-database19
1 files changed, 19 insertions, 0 deletions
diff --git a/academic/mathics/mathics-create-database b/academic/mathics/mathics-create-database
new file mode 100644
index 0000000000..62f39a9b01
--- /dev/null
+++ b/academic/mathics/mathics-create-database
@@ -0,0 +1,19 @@
+# created by Urchlay
+
+#!/bin/sh
+
+if [ -z "$HOME" ]; then
+ echo "$0: \$HOME not set in the environment, aborting" 1>&2
+ exit 1
+fi
+
+DBDIR="$HOME/.local/var/mathics/"
+
+# In case of multiple installs, SCRIPT prefers /usr/lib64 to /usr/lib,
+# and higher-numbered python versions to lower-numbered. But this is
+# just paranoia, there shouldn't be multiple mathics installations.
+SCRIPT=$( /bin/ls -d /usr/lib*/python2.*/site-packages/mathics/manage.py | tac | head -1 )
+
+echo "Initializing mathics SQLite databases in $DBDIR"
+mkdir -p $DBDIR
+exec python $SCRIPT syncdb --noinput