summaryrefslogtreecommitdiff
path: root/community/sage-mathematics/sage-mathematics.install
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/sage-mathematics/sage-mathematics.install
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/sage-mathematics/sage-mathematics.install')
-rw-r--r--community/sage-mathematics/sage-mathematics.install47
1 files changed, 47 insertions, 0 deletions
diff --git a/community/sage-mathematics/sage-mathematics.install b/community/sage-mathematics/sage-mathematics.install
new file mode 100644
index 000000000..f5c16308e
--- /dev/null
+++ b/community/sage-mathematics/sage-mathematics.install
@@ -0,0 +1,47 @@
+post_install() {
+ cd /opt/sage
+
+ # set HOME because when sage updates its sage_root (after being moved) it will write files to ~/.sage with root ownership
+ # the files it writes to ~/.sage can be safely ignored
+ HOME=/tmp ./sage -c
+
+ # Update LaTeX db to point to SageTeX
+ if [ -f /usr/bin/texhash ]; then
+ /usr/bin/texhash /usr/share/texmf
+ else
+ echo 'Warning: could not find /usr/bin/texhash'
+ echo 'SageTeX has been installed but you need to run:'
+ echo '# texhash /usr/share/texmf'
+ echo 'So that LaTeX will be able to find it.'
+ fi
+
+echo '
+ ___
+/ (_) o |
+\__ _ _ __ |
+/ / |/ | | / \_| | |
+\___/ | |_/|/\__/ \_/|/o
+ /| /|
+ \| \|
+ ___ __ _ __ _ ___
+/ __|/ _` |/ _` |/ _ \
+\__ \ (_| | (_| | __/
+|___/\__,_|\__, |\___|
+ |___/
+'
+
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+post_remove() {
+ # Update LaTeX db to remove SageTeX entries
+ if [ -f /usr/bin/texhash ]; then
+ /usr/bin/texhash /usr/share/texmf
+ fi
+
+ # clean up left overs
+ rm -rf /opt/sage
+}