summaryrefslogtreecommitdiff
path: root/community-testing/sage-mathematics/sage-mathematics.install
diff options
context:
space:
mode:
authorNicolás Reynolds <fauno@kiwwwi.com.ar>2012-07-27 20:23:53 -0300
committerNicolás Reynolds <fauno@kiwwwi.com.ar>2012-07-27 20:23:53 -0300
commit3a3f329b736af639fdd3c9621816bad627b96903 (patch)
treea0935f38e21136a3b7eeb93d0ec5c449c12de5b0 /community-testing/sage-mathematics/sage-mathematics.install
parent4d788e769855cbef2539d7cf7049dc2b4d9ac2e0 (diff)
parent2c30604c9ff749660a4b8507eec99e679cf19508 (diff)
Merge branch 'master' of ssh://vparabola/home/parabola/abslibre-pre-mips64el
Conflicts: community-staging/kdenlive/PKGBUILD community-staging/openscenegraph/PKGBUILD community-staging/schroot/PKGBUILD community-staging/wt/PKGBUILD community-testing/cdfs/PKGBUILD community-testing/pingus/PKGBUILD community-testing/tagpy/PKGBUILD community-testing/vhba-module/PKGBUILD community-testing/vhba-module/vhba-module.install community/surf/PKGBUILD community/unpaper/PKGBUILD core/flex/PKGBUILD core/gcc/PKGBUILD extra/boost/PKGBUILD extra/cups/PKGBUILD extra/gnutls/PKGBUILD extra/gtk2/PKGBUILD extra/llvm/PKGBUILD extra/mesa/PKGBUILD extra/qt/PKGBUILD kde-unstable/akonadi/PKGBUILD kde-unstable/kdeplasma-addons/PKGBUILD libre/virtualbox-libre/PKGBUILD multilib/gcc-multilib/PKGBUILD multilib/lib32-libpng/PKGBUILD testing/bind/PKGBUILD testing/dnsutils/PKGBUILD testing/iptables/PKGBUILD testing/nouveau-dri/PKGBUILD
Diffstat (limited to 'community-testing/sage-mathematics/sage-mathematics.install')
-rw-r--r--community-testing/sage-mathematics/sage-mathematics.install56
1 files changed, 56 insertions, 0 deletions
diff --git a/community-testing/sage-mathematics/sage-mathematics.install b/community-testing/sage-mathematics/sage-mathematics.install
new file mode 100644
index 000000000..6caa5299e
--- /dev/null
+++ b/community-testing/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
+}