--- App-Staticperl/staticperl.sh 2010/12/08 22:27:35 1.11 +++ App-Staticperl/staticperl.sh 2010/12/10 20:29:17 1.14 @@ -4,13 +4,11 @@ # configuration to fill in STATICPERL=~/.staticperl -CPAN=http://mirror.netcologne.de/cpan/ # which mirror to use +CPAN=http://mirror.netcologne.de/cpan # which mirror to use EMAIL="read the documentation " -MKBUNDLE="$STATICPERL/mkbundle" # perl build variables -PERL_PREFIX="$STATICPERL/perl" # where the perl gets installed PERL_VERSION=5.12.2 # 5.8.9 is also a good choice PERL_CONFIGURE="" # additional Configure arguments PERL_CPPFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG -USITELIB_EXP -USITEARCHEXP -UARCHLIB_EXP" @@ -54,13 +52,23 @@ postinstall() { : ; } # now source user config, if any -[ -r /etc/staticperlrc ] && . /etc/staticperlrc -[ -r ~/.staticperlrc ] && . ~/.staticperlrc -[ -r "$STATICPERL/rc" ] && . "$STATICPERL/rc" +if [ "$STATICPERLRC" ]; then + . "$STATICPERLRC" +else + [ -r /etc/staticperlrc ] && . /etc/staticperlrc + [ -r ~/.staticperlrc ] && . ~/.staticperlrc + [ -r "$STATICPERL/rc" ] && . "$STATICPERL/rc" +fi ############################################################################# # support +MKBUNDLE="${MKBUNDLE:=$STATICPERL/mkbundle}" +PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed + +unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG +export LC_ALL=C # just to be on the safe side + # set version in a way that Makefile.PL can extract VERSION=VERSION; eval \ $VERSION=0.9 @@ -106,7 +114,7 @@ distclean() { verblock <"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create" chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE" - "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" "$@" + CACHE="$STATICPERL/cache" + mkdir -p "$CACHE" + "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@" } if [ $# -gt 0 ]; then @@ -403,10 +417,10 @@ command="${1#--}"; shift case "$command" in + version ) + echo "staticperl version $VERSION" + ;; fetch | configure | build | install | clean | distclean) - verblock <