summaryrefslogtreecommitdiff
path: root/community/sage-mathematics/sage-mathematics.install
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-07-02 21:45:22 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-07-02 21:45:22 -0300
commit1f31420f313381bbb03fdc934348f5606134191c (patch)
tree217f5f6da0acef84ca46e3308eff01a57ae6baaa /community/sage-mathematics/sage-mathematics.install
parent0ca20230bdd33f8e07d2da28bec74c5e685650e9 (diff)
parent20bf19bd85f0a70a575491c17aa7354c1a8fd97d (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: multilib-testing/gcc-multilib/PKGBUILD multilib/lib32-libdrm/PKGBUILD staging/mpd/PKGBUILD testing/gcc/PKGBUILD
Diffstat (limited to 'community/sage-mathematics/sage-mathematics.install')
-rw-r--r--community/sage-mathematics/sage-mathematics.install56
1 files changed, 56 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..6caa5299e
--- /dev/null
+++ b/community/sage-mathematics/sage-mathematics.install
@@ -0,0 +1,56 @@
+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
+
+ # add sagemath user for the daemon
+ useradd -r -c 'Sage daemon' -d /opt/sage -s /bin/false sagemath
+
+ # 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
+ /| /|
+ \| \|
+ ________________________________
+< sage-mathematics, I mean, MOO! >
+ --------------------------------
+ \ ^__^
+ \ (oo)\_______
+ (__)\ )\/\
+ ||----w |
+ || ||
+'
+
+}
+
+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
+
+ # remove the sagemath daemon user
+ userdel sagemath
+
+ # clean up left overs
+ rm -rf /opt/sage
+}