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

Comparing App-Staticperl/staticperl.sh (file contents):
Revision 1.9 by root, Tue Dec 7 20:03:15 2010 UTC vs.
Revision 1.13 by root, Fri Dec 10 10:44:20 2010 UTC

59[ -r "$STATICPERL/rc" ] && . "$STATICPERL/rc" 59[ -r "$STATICPERL/rc" ] && . "$STATICPERL/rc"
60 60
61############################################################################# 61#############################################################################
62# support 62# support
63 63
64unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
65export LC_ALL=C # just to be on the safe side
66
64# set version in a way that Makefile.PL can extract 67# set version in a way that Makefile.PL can extract
65VERSION=VERSION; eval \ 68VERSION=VERSION; eval \
66$VERSION=0.1 69$VERSION=0.9
67 70
68BZ2=bz2 71BZ2=bz2
69BZIP2=bzip2 72BZIP2=bzip2
70 73
71fatal() { 74fatal() {
147 verblock <<EOF 150 verblock <<EOF
148unpacking perl 151unpacking perl
149EOF 152EOF
150 153
151 mkdir -p unpack 154 mkdir -p unpack
152 $BZIP2 -d <perl-$PERL_VERSION.tar.bz2 | tar xC unpack \ 155 $BZIP2 -d <perl-$PERL_VERSION.tar.bz2 | tar xfC - unpack \
153 || fatal "perl-$PERL_VERSION.tar.bz2: error during unpacking" 156 || fatal "perl-$PERL_VERSION.tar.bz2: error during unpacking"
154 chmod -R u+w unpack/perl-$PERL_VERSION 157 chmod -R u+w unpack/perl-$PERL_VERSION
155 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION 158 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION
156 rmdir -p unpack 159 rmdir -p unpack
157 fi 160 fi
262 265
263 rcd "$PERL_PREFIX" 266 rcd "$PERL_PREFIX"
264 267
265 # create a "make install" replacement for CPAN 268 # create a "make install" replacement for CPAN
266 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF 269 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF
267make install UNINST=1 270make || exit
271
268if find blib/arch/auto -type f | grep -q -v .exists; then 272if find blib/arch/auto -type f | grep -q -v .exists; then
269 echo Probably an XS module, rebuilding perl 273 echo Probably an XS module, rebuilding perl
270 make perl 274 if make perl; then
271 rm -f "$PERL_PREFIX"/bin/perl 275 mv perl "$PERL_PREFIX"/bin/perl
272 make -f Makefile.aperl inst_perl
273 make -f Makefile.aperl map_clean 276 make -f Makefile.aperl map_clean
277 else
278 make -f Makefile.aperl map_clean
279 exit 1
280 fi
274fi 281fi
282
283make install UNINST=1
275EOF 284EOF
276 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install 285 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install
277 286
278 # trick CPAN into avoiding ~/.cpan completely 287 # trick CPAN into avoiding ~/.cpan completely
279 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" 288 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
294 ' || fatal "error while initialising CPAN" 303 ' || fatal "error while initialising CPAN"
295 304
296 touch "$PERL_PREFIX/staticstamp.install" 305 touch "$PERL_PREFIX/staticstamp.install"
297 fi 306 fi
298 307
299 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall"; then 308 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then
300 NOCHECK_INSTALL=+ 309 NOCHECK_INSTALL=+
301 instcpan $STATICPERL_MODULES 310 instcpan $STATICPERL_MODULES
302 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES 311 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES
303 312
304 postinstall || fatal "postinstall hook failed" 313 postinstall || fatal "postinstall hook failed"
385} 394}
386 395
387bundle() { 396bundle() {
388 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create" 397 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create"
389 chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE" 398 chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE"
399 CACHE="$STATICPERL/cache"
400 mkdir -p "$CACHE"
390 "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" "$@" 401 "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@"
391} 402}
392 403
393if [ $# -gt 0 ]; then 404if [ $# -gt 0 ]; then
394 while [ $# -gt 0 ]; do 405 while [ $# -gt 0 ]; do
395 mkdir -p "$STATICPERL" || fatal "$STATICPERL: cannot create" 406 mkdir -p "$STATICPERL" || fatal "$STATICPERL: cannot create"
424 mkperl ) 435 mkperl )
425 ( install ) 436 ( install )
426 bundle --perl "$@" 437 bundle --perl "$@"
427 exit 438 exit
428 ;; 439 ;;
440 mkapp )
441 ( install )
442 bundle --app "$@"
443 exit
444 ;;
429 help ) 445 help )
430 podusage 2 446 podusage 2
431 ;; 447 ;;
432 * ) 448 * )
433 exec 1>&2 449 exec 1>&2

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines