Annotation of OpenXM/src/asir-port/asir-port.sh, Revision 1.20
1.16 takayama 1: #!/bin/bash
1.20 ! takayama 2: # $OpenXM: OpenXM/src/asir-port/asir-port.sh,v 1.19 2010/07/19 09:41:53 takayama Exp $
1.2 takayama 3: # Downloading Risa/Asir for FLL-free systems.
1.1 takayama 4: # Risa/Asir is installed under $HOME/.asir-tmp/$asirname
5: # Symbolic link to $asirname from $OpenXM_HOME/bin/asir must exist
1.2 takayama 6: # in the distribution of FLL-free distribution.
1.1 takayama 7: # Starting script of Risa/Asir may call this shell script.
1.10 takayama 8: version=`cat $OpenXM_HOME/lib/version.txt`
1.19 takayama 9: os=`dpkg --print-architecture`
1.10 takayama 10: md=`cat $OpenXM_HOME/lib/asir/distinfo-asir.md5`
1.11 takayama 11: libmd=`cat $OpenXM_HOME/lib/asir/distinfo-asirlib.md5`
1.1 takayama 12: # For testing
1.14 takayama 13: #asir="http://www.math.kobe-u.ac.jp/pub/asir/gzip.exe"
1.2 takayama 14: #asirname="gzip.exe"
1.14 takayama 15: #asirlib="http://www.math.kobe-u.ac.jp/pub/asir/tar.exe"
1.2 takayama 16: #asirlibname="tar.exe"
1.1 takayama 17: #
1.14 takayama 18: asir="http://www.math.kobe-u.ac.jp/pub/OpenXM/head/knoppix/asir-$os-$version.gz"
1.10 takayama 19: asirnamegunzip="asir-$os-$version"
20: asirname="asir-$os-$version.gz"
1.14 takayama 21: asirlib="http://www.math.kobe-u.ac.jp/pub/OpenXM/head/knoppix/asirlib-$os-$version.tar.gz"
1.10 takayama 22: asirlibname="asirlib-$os-$version.tar.gz"
1.14 takayama 23: ot="http://www.math.kobe-u.ac.jp/pub/OpenXM/head/knoppix/ox-texmacs-$os-$version.tar.gz"
1.13 takayama 24: otname="ox-texmacs-$os-$version.tar.gz"
1.2 takayama 25:
26: if [ $# = 1 ]; then
27: if [ $1 = "--install" ]; then
1.12 takayama 28: rm -rf $HOME/.asir-tmp ;
29: rm -f /usr/local/OpenXM/bin/asir ;
1.2 takayama 30: fi
1.12 takayama 31: fi
32:
33: if [ -f /usr/local/OpenXM/bin/asir ]; then
34: $OpenXM_HOME/bin/fep $OpenXM_HOME/bin/asir $* ; exit ;
1.2 takayama 35: fi
1.1 takayama 36:
37: _agree() {
38: echo "------------------------------------------------------------------"
39: echo "Risa/Asir is distributed with no warranty for non-commercial use."
1.2 takayama 40: echo "OpenXM subcomponents are distributed with no warranty under BSD license or GPL."
41: echo "Do you agree with the licenses under $OpenXM_HOME/Copyright?"
1.1 takayama 42: echo "------------------------------------------------------------------"
1.2 takayama 43: echo "y: agree, n: do not agree, v: read the detail of the asir license."
1.20 ! takayama 44: if [ -f "/tmp/i-agree-with-asir-license" ]; then
! 45: ans="y"
! 46: else
! 47: read -p "(y/n/v)" ans
! 48: fi
1.1 takayama 49: if [ $ans = "y" ]; then
50: return
51: fi
52: if [ $ans = "n" ]; then
1.10 takayama 53: echo "Aborting the installation of asir." ; \
1.1 takayama 54: exit
55: fi
56: if [ $ans = "v" ]; then
57: more $OpenXM_HOME/Copyright/Copyright.asir ; \
58: _agree ; \
59: return
60: fi
61: _agree
62: }
1.3 takayama 63:
1.7 takayama 64: _check_install_error() {
65: if [ ! -f $HOME/.asir-tmp/$asirnamegunzip ]; then
66: echo "Installation of Risa/Asir from the network seems to be failed."; \
67: echo "Please check if your computer is connected to the internet "; \
1.15 takayama 68: echo " and you can download files from www.math.kobe-u.ac.jp "; \
69: echo " by http."; \
1.7 takayama 70: sleep 60 ; \
71: fi
72: }
1.1 takayama 73:
1.2 takayama 74: if [ ! -f $HOME/.asir-tmp/$asirnamegunzip ]; then
1.1 takayama 75: _agree ; \
1.2 takayama 76: echo -n "Downloading the binary of asir (1.5M) $asir ... " ; \
1.1 takayama 77: oxfetch.sh $asir $HOME/.asir-tmp ; \
1.2 takayama 78: echo "Done." ; \
79: gunzip $HOME/.asir-tmp/$asirname ; \
80: chmod +x $HOME/.asir-tmp/$asirnamegunzip ; \
81: rm -f $HOME/.asir-tmp/asir ; \
82: ln -s $HOME/.asir-tmp/$asirnamegunzip $HOME/.asir-tmp/asir ; \
83: fi
84: if [ ! -f $HOME/.asir-tmp/$asirlibname ]; then
85: echo -n "Downloading the asir library $asirlib... " ; \
86: oxfetch.sh $asirlib $HOME/.asir-tmp ; \
87: echo "Done." ; \
88: (cd $HOME/.asir-tmp ; tar xzf $asirlibname) ; \
1.4 takayama 89: fi
90: if [ ! -f $HOME/.asir-tmp/$otname ]; then
91: echo -n "Downloading $ot plugin... " ; \
92: oxfetch.sh $ot $HOME/.asir-tmp ; \
93: echo "Done." ; \
1.5 takayama 94: if [ -f $HOME/.TeXmacs/progs/my-init-texmacs.scm ]; then \
95: echo "Warning .TeXmacs/progs/my-init-texmacs.scm exists"; \
1.17 takayama 96: echo "Copy .TeXmacs and .feprc from ~/.asir-tmp/$otname by hand."; \
97: else (cd $HOME ; tar xzf $HOME/.asir-tmp/$otname ; cp -i .feprc.sample .feprc) ; \
1.5 takayama 98: fi
1.1 takayama 99: fi
100:
1.7 takayama 101: _check_install_error
1.1 takayama 102:
1.2 takayama 103: $OpenXM_HOME/bin/fep $OpenXM_HOME/bin/asir $*
1.1 takayama 104:
105:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>