Annotation of OpenXM/src/asir-port/asir-port.sh, Revision 1.17
1.16 takayama 1: #!/bin/bash
1.17 ! takayama 2: # $OpenXM: OpenXM/src/asir-port/asir-port.sh,v 1.16 2007/11/18 01:56:25 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.1 takayama 9: os=`uname -s`
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.1 takayama 44: read -e -p "(y/n/v)" ans
45: if [ $ans = "y" ]; then
46: return
47: fi
48: if [ $ans = "n" ]; then
1.10 takayama 49: echo "Aborting the installation of asir." ; \
1.1 takayama 50: exit
51: fi
52: if [ $ans = "v" ]; then
53: more $OpenXM_HOME/Copyright/Copyright.asir ; \
54: _agree ; \
55: return
56: fi
57: _agree
58: }
1.3 takayama 59:
1.7 takayama 60: _check_install_error() {
61: if [ ! -f $HOME/.asir-tmp/$asirnamegunzip ]; then
62: echo "Installation of Risa/Asir from the network seems to be failed."; \
63: echo "Please check if your computer is connected to the internet "; \
1.15 takayama 64: echo " and you can download files from www.math.kobe-u.ac.jp "; \
65: echo " by http."; \
1.7 takayama 66: sleep 60 ; \
67: fi
68: }
1.1 takayama 69:
1.2 takayama 70: if [ ! -f $HOME/.asir-tmp/$asirnamegunzip ]; then
1.1 takayama 71: _agree ; \
1.2 takayama 72: echo -n "Downloading the binary of asir (1.5M) $asir ... " ; \
1.1 takayama 73: oxfetch.sh $asir $HOME/.asir-tmp ; \
1.2 takayama 74: echo "Done." ; \
75: gunzip $HOME/.asir-tmp/$asirname ; \
76: chmod +x $HOME/.asir-tmp/$asirnamegunzip ; \
77: rm -f $HOME/.asir-tmp/asir ; \
78: ln -s $HOME/.asir-tmp/$asirnamegunzip $HOME/.asir-tmp/asir ; \
79: fi
80: if [ ! -f $HOME/.asir-tmp/$asirlibname ]; then
81: echo -n "Downloading the asir library $asirlib... " ; \
82: oxfetch.sh $asirlib $HOME/.asir-tmp ; \
83: echo "Done." ; \
84: (cd $HOME/.asir-tmp ; tar xzf $asirlibname) ; \
1.4 takayama 85: fi
86: if [ ! -f $HOME/.asir-tmp/$otname ]; then
87: echo -n "Downloading $ot plugin... " ; \
88: oxfetch.sh $ot $HOME/.asir-tmp ; \
89: echo "Done." ; \
1.5 takayama 90: if [ -f $HOME/.TeXmacs/progs/my-init-texmacs.scm ]; then \
91: echo "Warning .TeXmacs/progs/my-init-texmacs.scm exists"; \
1.17 ! takayama 92: echo "Copy .TeXmacs and .feprc from ~/.asir-tmp/$otname by hand."; \
! 93: else (cd $HOME ; tar xzf $HOME/.asir-tmp/$otname ; cp -i .feprc.sample .feprc) ; \
1.5 takayama 94: fi
1.1 takayama 95: fi
96:
1.7 takayama 97: _check_install_error
1.1 takayama 98:
1.2 takayama 99: $OpenXM_HOME/bin/fep $OpenXM_HOME/bin/asir $*
1.1 takayama 100:
101:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>