forked from gugod/App-perlbrew
-
Notifications
You must be signed in to change notification settings - Fork 0
/
perlbrew-install
executable file
·51 lines (41 loc) · 1.15 KB
/
perlbrew-install
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
#!/bin/sh
PERLBREWURL=https://raw.github.com/gugod/App-perlbrew/master/perlbrew
PATCHPERLURL=https://raw.github.com/gist/962406/fb2db5087040540240c12691a5171c26cafcdf1d/patchperl
if [ -z "$TMPDIR" ]; then
if [ -d "/tmp" ]; then
TMPDIR="/tmp"
else
TMPDIR="."
fi
fi
cd $TMPDIR
echo
if type curl >/dev/null 2>&1; then
echo "## Download the latest perlbrew"
curl -k -Lo perlbrew $PERLBREWURL >/dev/null 2>&1
echo "## Download the packed patchperl"
curl -k -Lo patchperl $PATCHPERLURL >/dev/null 2>&1
elif type wget >/dev/null 2>&1; then
echo "## Download the latest perlbrew"
wget --no-check-certificate -O perlbrew $PERLBREWURL >/dev/null 2>&1
echo "## Download the packed patchperl"
wget --no-check-certificate -O patchperl $PATCHPERLURL >/dev/null 2>&1
else
echo "Need wget or curl to use $0"
exit 1
fi
echo
echo "## Installing perlbrew"
chmod +x perlbrew
./perlbrew install
echo "## Installing patchperl"
if [ "X${PERLBREW_ROOT}" = "X" ]; then
PERLBREW_ROOT="${HOME}/perl5/perlbrew"
fi
mkdir -p "$PERLBREW_ROOT"
chmod +x patchperl
cp patchperl "${PERLBREW_ROOT}/bin"
echo
echo "## Done."
rm ./perlbrew
rm ./patchperl