/
install.sh
executable file
·112 lines (105 loc) · 3.05 KB
/
install.sh
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
git=`which git`
apc=`php -m | grep apc`
if [ "$git" == "" ]; then
echo "Git not found, exiting..";
exit;
else
version=`$git --version`
echo "Found $version"
fi
if [ "$apc" == "" ]; then
echo "------------------------------------------------------------------------------------------"
echo "APC PHP module is not installed."
echo "Performance will be better if it's installed.. I'm just sayin.."
echo "------------------------------------------------------------------------------------------"
fi
if [ -d /tmp/yuidev ]; then
echo "Found a tmp directory called /tmp/yuidev"
echo "Do you want me to remove it? [y/N]"
read output
if [ "$output" != "y" ]; then
echo "Exiting.."
exit
fi
fi
echo "Making tmp directories.."
mkdir -p /tmp/yuidev/base
wait
mkdir -p /tmp/yuidev/lib
wait
mkdir -p /tmp/yuidev/cache
wait
echo "Fetching sources.. This may take a few minutes, so grab a drink.."
cd /tmp/yuidev/base/
wait
echo "------------------------------------------------------------------------------------------"
echo "Fetching YUI3 Sources. http://github.com/yui/yui3"
$git --no-pager clone git://github.com/yui/yui3.git
wait
echo "------------------------------------------------------------------------------------------"
echo "Fetching YUI2 Sources. http://github.com/yui/yui2"
$git --no-pager clone git://github.com/yui/yui2.git
wait
echo "------------------------------------------------------------------------------------------"
echo "Fetching libs.."
echo "------------------------------------------------------------------------------------------"
cd /tmp/yuidev/lib
wait
echo "YUI 2.7.0"
curl http://yuilibrary.com/downloads/yui2/yui_2.7.0b.zip -o yui2.zip
wait
unzip -q yui2.zip
wait
mkdir 2.7.0
wait
cd 2.7.0
mv ../yui/build ./
wait
cd ../
wait
rm -rRf yui
wait
rm -rRf yui2.zip
wait
echo "YUI 3.0.0b1"
curl http://yuilibrary.com/downloads/yui3/yui_3.0.0b1.zip -o yui3.zip
wait
unzip -q yui3.zip
wait
mkdir 3.0.0b1
wait
cd 3.0.0b1
mv ../yui/build ./
wait
cd ../
wait
rm -rRf yui
wait
rm -rRf yui3.zip
wait
echo "------------------------------------------------------------------------------------------"
echo "Fetching complete.."
echo ""
echo "Temporary directories need admin (sudo) privileges, asking.."
www="www"
wwwtest=`cat /etc/passwd | grep www-data`
if [ "$wwwtest" != ""]; then
www="www-data"
fi
sudo chown -R $www:$www /tmp/yuidev
sudo chmod -R +w /tmp/yuidev
echo " * If the above command errors, then I couldn't guess who owns apache."
echo " * Please change the owner (recursively) for the /tmp/yuidev folder."
echo ""
echo "Installation complete."
echo ""
echo "------------------------------------------------------------------------------------------"
echo ""
echo "Now put the index.php and test.php files under your web root, then open the test-yui3.php file."
echo "You can try test-yui3.php to load YUI 3.0.0b1"
echo "Then try test-yui3.php?version=yui3-1291 to load the yui3-1291 tag."
echo ""
echo "------------------------------------------------------------------------------------------"
echo ""
exit;