Annotation of OpenXM/src/asir-port/asir-install.sh, Revision 1.18
1.14 takayama 1: #!/bin/bash
1.18 ! takayama 2: # $OpenXM: OpenXM/src/asir-port/asir-install.sh,v 1.17 2010/07/19 09:41:53 takayama Exp $
1.6 takayama 3: # Downloading Risa/Asir for FLL-free systems
4: # under $HOME/.asir-tmp and installs asir to $OpenXM_HOME/bin
1.5 takayama 5: #
6: # In the Debian package, /usr/local/OpenXM/bin/asir is the symbolic link to
7: # /home/knoppix/.asir-tmp/asir.
8: # So, on non-knoppix system, execute
1.6 takayama 9: # (export OpenXM_HOME=/usr/local/OpenXM; openxm asir-install.sh)
10: # as the root in the bash to install the asir under /usr/local/OpenXM/bin.
11: # /root/.asir-tmp will be a work-directory in this case.
1.5 takayama 12: #
1.8 takayama 13: version=`cat $OpenXM_HOME/lib/version.txt`
1.17 takayama 14: os=`dpkg --print-architecture`
1.8 takayama 15: md=`cat $OpenXM_HOME/lib/asir/distinfo-asir.md5`
1.9 takayama 16: libmd=`cat $OpenXM_HOME/lib/asir/distinfo-asirlib.md5`
1.1 takayama 17: # For testing
1.12 takayama 18: #asir="http://www.math.kobe-u.ac.jp/pub/asir/gzip.exe"
1.1 takayama 19: #asirname="gzip.exe"
1.12 takayama 20: #asirlib="http://www.math.kobe-u.ac.jp/pub/asir/tar.exe"
1.1 takayama 21: #asirlibname="tar.exe"
22: #
1.12 takayama 23: asir="http://www.math.kobe-u.ac.jp/pub/OpenXM/head/knoppix/asir-$os-$version.gz"
1.8 takayama 24: asirnamegunzip="asir-$os-$version"
25: asirname="asir-$os-$version.gz"
1.12 takayama 26: asirlib="http://www.math.kobe-u.ac.jp/pub/OpenXM/head/knoppix/asirlib-$os-$version.tar.gz"
1.8 takayama 27: asirlibname="asirlib-$os-$version.tar.gz"
1.12 takayama 28: ot="http://www.math.kobe-u.ac.jp/pub/OpenXM/head/knoppix/ox-texmacs-$os-$version.tar.gz"
1.11 takayama 29: otname="ox-texmacs-$os-$version.tar.gz"
1.1 takayama 30:
1.3 takayama 31: ASIR_LIB_FILES="alph bfct bgk const cyclic defs.h dmul fctrdata fctrtest \
1.1 takayama 32: fff gr ifplot katsura mat nf num primdec \
1.3 takayama 33: ratint robot solve sp sturm xm"
34:
1.1 takayama 35:
36: if [ $# = 1 ]; then
37: if [ $1 = "--force" ]; then
38: rm -rf $HOME/.asir-tmp
39: fi
40: fi
41:
42: _agree() {
43: echo "------------------------------------------------------------------"
44: echo "This script install Risa/Asir under $OpenXM_HOME"
45: echo "Risa/Asir is distributed with no warranty for non-commercial use."
46: echo "OpenXM subcomponents are distributed with no warranty under BSD license or GPL."
47: echo "Do you agree with the licenses under $OpenXM_HOME/Copyright?"
48: echo "------------------------------------------------------------------"
49: echo "y: agree, n: do not agree, v: read the detail of the asir license."
1.18 ! takayama 50: if [ -f "/tmp/i-agree-with-asir-license" ]; then
! 51: ans="y"
! 52: else
! 53: read -p "(y/n/v)" ans
! 54: fi
1.1 takayama 55: if [ $ans = "y" ]; then
56: return
57: fi
58: if [ $ans = "n" ]; then
1.10 takayama 59: echo "Aborting the installation of asir." ; \
1.1 takayama 60: exit
61: fi
62: if [ $ans = "v" ]; then
63: more $OpenXM_HOME/Copyright/Copyright.asir ; \
64: _agree ; \
65: return
66: fi
67: _agree
68: }
69:
1.3 takayama 70: _check_install_error() {
71: if [ ! -f $HOME/.asir-tmp/$asirnamegunzip ]; then
72: echo "Installation of Risa/Asir from the network seems to be failed."; \
73: echo "Please check if your computer is connected to the internet "; \
1.13 takayama 74: echo " and you can download files from www.math.kobe-u.ac.jp "; \
75: echo " by http."; \
1.3 takayama 76: sleep 60 ; \
77: exit ; \
78: fi
79: }
1.1 takayama 80:
81: if [ ! -f $HOME/.asir-tmp/$asirnamegunzip ]; then
82: _agree ; \
83: echo -n "Downloading the binary of asir (1.5M) $asir ... " ; \
84: oxfetch.sh $asir $HOME/.asir-tmp ; \
85: echo "Done." ; \
86: gunzip $HOME/.asir-tmp/$asirname ; \
87: chmod +x $HOME/.asir-tmp/$asirnamegunzip ; \
1.8 takayama 88: rm -f $OpenXM_HOME/bin/asir ; \
1.1 takayama 89: install -m 755 $HOME/.asir-tmp/$asirnamegunzip $OpenXM_HOME/bin/asir ; \
90: fi
91: if [ ! -f $HOME/.asir-tmp/$asirlibname ]; then
92: echo -n "Downloading the asir library $asirlib... " ; \
93: oxfetch.sh $asirlib $HOME/.asir-tmp ; \
94: echo "Done." ; \
95: (cd $HOME/.asir-tmp ; tar xzf $asirlibname) ; \
96: (cd $OpenXM_HOME/lib/asir ; rm -f $ASIR_LIB_FILES) ; \
97: (cd $HOME/.asir-tmp ; install -m 644 $ASIR_LIB_FILES $OpenXM_HOME/lib/asir) ; \
98: fi
99: if [ ! -f $HOME/.asir-tmp/$otname ]; then
100: echo -n "Downloading the $ot plugin... " ; \
101: oxfetch.sh $ot $HOME/.asir-tmp ; \
102: echo "Done." ; \
1.2 takayama 103: if [ -f $HOME/.TeXmacs/progs/my-init-texmacs.scm ]; then \
104: echo "Warning .TeXmacs/progs/my-init-texmacs.scm exists"; \
1.15 takayama 105: echo "Copy .TeXmacs and .feprc from ~/.asir-tmp/$otname by hand."; \
106: else (cd $HOME ; tar xzf $HOME/.asir-tmp/$otname ; cp -i .feprc.sample .feprc) ; \
1.2 takayama 107: fi
1.1 takayama 108: fi
109:
1.3 takayama 110: _check_install_error
1.1 takayama 111:
112: echo "Installation is completed."
113:
114:
115:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>