forked from tkLayout/tkLayout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·67 lines (55 loc) · 1.97 KB
/
install.sh
File metadata and controls
executable file
·67 lines (55 loc) · 1.97 KB
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
#!/bin/bash
myDir=`dirname $0`
TKG_MAIN=$myDir/bin/tklayout
TKG_SETUP_BIN=$myDir/bin/setup
if [ ! -f $TKG_MAIN ] ; then
echo I cannot find the main program binary $TKG_MAIN
echo Did you run \'make\'?
exit -1
fi
if [ ! -f $TKG_SETUP_BIN ]; then
echo I cannot find the setup program binary $TKG_SETUP_BIN
echo Did you run \'make\'?
exit -1
fi
# Set current folder as standard directory for the setup script
export TKLAYOUTDIRECTORY=`realpath -s $myDir`
# Create/read the configuration file
if $TKG_SETUP_BIN; then
# Get the variables from the program
eval "`$TKG_SETUP_BIN --dirNames`"
# Get the rest of the configuration from the config file itself
source $TKG_CONFIGFILE
mkdir -p $TKG_BINDIRECTORY
if [ ! -d $TKG_BINDIRECTORY ] ; then
echo I cannot find the target directory $TKG_BINDIRECTORY
exit -1
fi
echo "Installing main program -> $TKG_BINDIRECTORY"
cp -f $TKG_MAIN $TKG_BINDIRECTORY \
&& echo "+ Main program installed/updated" \
|| echo "- Failed copying the main program $TKG_MAIN to $TKG_BINDIRECTORY"
# Copying the directory with .css and all that jazz
mkdir -p $TKG_LAYOUTDIRECTORY
if [ ! -d $TKG_LAYOUTDIRECTORY ] ; then
echo I cannot find the target directory $TKG_LAYOUTDIRECTORY
exit -1
fi
cp -R $TKG_SOURCE_STYLE $TKG_LAYOUTDIRECTORY
# Copying the xml and the config files to the standard directory
mkdir -p $TKG_STANDARDDIRECTORY
if [ ! -d $TKG_STANDARDDIRECTORY ] ; then
echo I cannot find the target directory $TKG_STANDARDDIRECTORY
exit -1
fi
cp -R --parents $myDir/xml $TKG_STANDARDDIRECTORY/
cp -R --parents $myDir/config $TKG_STANDARDDIRECTORY/
if ! $TKG_SETUP_BIN --checkDir ; then
echo "- Problem during installation"
exit -1
else
echo "+ Installation successful"
fi
else
echo "- The setup program could not read/create the configuration file $HOME/.tkgeometryrc properly"
fi