-
Notifications
You must be signed in to change notification settings - Fork 0
/
InstallTxl
executable file
·95 lines (82 loc) · 1.76 KB
/
InstallTxl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
# FreeTXL Unix Installation Script, January 2001
# Copyright 2001-2008 Queen's University at Kingston
# Converted to /bin/sh April 2008
echo ""
echo "Installing TXL 10.6 on your system."
sleep 1
# Default locations
DEFAULT=true
TXLBIN=/usr/local/bin
TXLLIB=/usr/local/lib/txl
TXLMAN=/usr/local/man/man1
# Localization
if [ -x /usr/bin/sed ]
then
SED=/usr/bin/sed
else
SED=/bin/sed
fi
unset noclobber
# Check what kind of installation we have here
if [ "$USER" != "root" ]
then
echo ""
echo "Warning - you are not running as root, so you can install TXL for yourself only."
echo "If you intend to install TXL for all users on this machine,"
echo "you will have to run this install script as root, for example using 'sudo ./InstallTxl'."
echo ""
echo "Do you want to continue to install TXL for yourself only? (y/n) :"
read YESNO
if [ "$YESNO" = "y" ]
then
echo ""
echo "Installing TXL for $USER only."
DEFAULT=false
TXLBIN=$HOME/bin
TXLLIB=$HOME/txl/lib
TXLMAN=$HOME/txl/man/man1
else
exit 99
fi
fi
sleep 1
# Install TXL commands
echo ""
echo "Installing TXL commands into $TXLBIN"
/bin/mkdir -p $TXLBIN
/bin/cp ./bin/* $TXLBIN
if [ "$DEFAULT" != "true" ]
then
for i in $TXLBIN/txlc $TXLBIN/txlp
do
$SED "s;/usr/local/lib/txl;$TXLLIB;" < $i > $i.temp
/bin/mv $i.temp $i
chmod 0755 $i
done
fi
sleep 1
# Install TXL library
echo ""
echo "Installing TXL library into $TXLLIB"
/bin/mkdir -p $TXLLIB
/bin/cp ./lib/* $TXLLIB
sleep 1
# Install TXL manual entries
echo ""
echo "Installing TXL manual entries into $TXLMAN"
/bin/mkdir -p $TXLMAN
/bin/cp ./man/man1/* $TXLMAN
sleep 1
# Test TXL
echo ""
echo "Testing TXL"
echo ""
sleep 1
cd ./test
$TXLBIN/txl Ultimate.Question
echo ""
echo "Done."
echo ""
# ---
# Rev 1.4.08