ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/App-Staticperl/staticperl.sh
(Generate patch)

Comparing cvsroot/App-Staticperl/staticperl.sh (file contents):
Revision 1.44 by root, Tue Jun 14 07:04:43 2011 UTC vs.
Revision 1.45 by root, Sun Jun 26 17:26:52 2011 UTC

1#!/bin/sh 1#!/bin/sh
2 2
3############################################################################# 3#############################################################################
4# configuration to fill in 4# configuration to fill in (or to replace in your .staticperlrc)
5 5
6STATICPERL=~/.staticperl 6STATICPERL=~/.staticperl
7CPAN=http://mirror.netcologne.de/cpan # which mirror to use 7CPAN=http://mirror.netcologne.de/cpan # which mirror to use
8EMAIL="read the documentation <rtfm@example.org>" 8EMAIL="read the documentation <rtfm@example.org>"
9DLCACHE=
9 10
10# perl build variables 11# perl build variables
11MAKE=make 12MAKE=make
12PERL_VERSION=5.12.3 # 5.8.9 is also a good choice 13PERL_VERSION=5.12.3 # 5.8.9 is also a good choice
13PERL_CC=cc 14PERL_CC=cc
147 148
148 mkdir -p src 149 mkdir -p src
149 rcd src 150 rcd src
150 151
151 if ! [ -d "perl-$PERL_VERSION" ]; then 152 if ! [ -d "perl-$PERL_VERSION" ]; then
152 if ! [ -e "perl-$PERL_VERSION.tar.$BZ2" ]; then 153 PERLTAR=perl-$PERL_VERSION.tar.$BZ2
153 154
155 if ! [ -e $PERLTAR ]; then
154 URL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.$BZ2" 156 URL="$CPAN/src/5.0/$PERLTAR"
155 157
156 verblock <<EOF 158 verblock <<EOF
157downloading perl 159downloading perl
158to manually download perl yourself, place 160to manually download perl yourself, place
159perl-$PERL_VERSION.tar.$BZ2 in $STATICPERL 161perl-$PERL_VERSION.tar.$BZ2 in $STATICPERL
160trying $URL 162trying $URL
161 163
162either curl or wget is required for automatic download. 164either curl or wget is required for automatic download.
163curl is tried first, then wget. 165curl is tried first, then wget.
164EOF
165 166
167you can configure a download cache directory via DLCACHE
168in your .staticperlrc to avoid repeated downloads.
169EOF
170
166 rm -f perl-$PERL_VERSION.tar.$BZ2~ # just to be on the safe side 171 rm -f $PERLTAR~ # just to be on the safe side
167 curl -f >perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ 172 { [ "$DLCACHE" ] && cp -l "$DLCACHE"/$PERLTAR $PERLTAR~; } \
168 || wget -O perl-$PERL_VERSION.tar.$BZ2~ "$URL" \ 173 || wget -O $PERLTAR~ "$URL" \
174 || curl -f >$PERLTAR~ "$URL" \
169 || fatal "$URL: unable to download" 175 || fatal "$URL: unable to download"
170 rm -f perl-$PERL_VERSION.tar.$BZ2 176 rm -f $PERLTAR
171 mv perl-$PERL_VERSION.tar.$BZ2~ perl-$PERL_VERSION.tar.$BZ2 177 mv $PERLTAR~ $PERLTAR
178 if [ "$DLCACHE" ]; then
179 mkdir -p "$DLCACHE"
180 cp -l $PERLTAR "$DLCACHE"/$PERLTAR~ && \
181 mv "$DLCACHE"/$PERLTAR~ "$DLCACHE"/$PERLTAR
182 fi
172 fi 183 fi
173 184
174 verblock <<EOF 185 verblock <<EOF
175unpacking perl 186unpacking perl
176EOF 187EOF
177 188
178 mkdir -p unpack 189 mkdir -p unpack
179 rm -rf unpack/perl-$PERL_VERSION 190 rm -rf unpack/perl-$PERL_VERSION
180 $BZIP2 -d <perl-$PERL_VERSION.tar.$BZ2 | ( cd unpack && tar xf - ) \ 191 $BZIP2 -d <$PERLTAR | ( cd unpack && tar xf - ) \
181 || fatal "perl-$PERL_VERSION.tar.$BZ2: error during unpacking" 192 || fatal "$PERLTAR: error during unpacking"
182 chmod -R u+w unpack/perl-$PERL_VERSION 193 chmod -R u+w unpack/perl-$PERL_VERSION
183 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION 194 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION
184 rmdir -p unpack 195 rmdir -p unpack
185 fi 196 fi
186} 197}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines