--- App-Staticperl/staticperl.sh 2010/12/07 10:40:39 1.6 +++ App-Staticperl/staticperl.sh 2010/12/07 20:03:15 1.9 @@ -48,6 +48,7 @@ EXTRA_MODULES="" # overridable functions +preconfigure() { : ; } postconfigure() { : ; } postbuild() { : ; } postinstall() { : ; } @@ -115,10 +116,7 @@ # download/configure/compile/install perl clean() { - cd "$STATICPERL/src/perl-$PERL_VERSION" 2>/dev/null || return - - rm -f staticstamp.configure - make distclean >/dev/null 2>&1 + rm -rf "$STATICPERL/src/perl-$PERL_VERSION" } fetch() { @@ -151,8 +149,9 @@ EOF mkdir -p unpack - $BZIP2 -d /dev/null 2>&1 + # I hate them grep -q -- -fstack-protector Configure && \ sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure + preconfigure + # trace configure \ sh Configure -Duselargefiles \ -Uuse64bitint \ @@ -247,23 +248,22 @@ } install() { - [ -e "$PERL_PREFIX/staticstamp.install" ] && return - - build + if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then + build - verblock <"$PERL_PREFIX"/bin/cpan-make-install <"$PERL_PREFIX"/bin/cpan-make-install <"$PERL_PREFIX/lib/CPAN/MyConfig.pm" - # trick CPAN into avoiding ~/.cpan completely - echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" + "$PERL_PREFIX"/bin/perl -MCPAN -e ' + CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); + CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan"); + CPAN::Shell->o (conf => q); + CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan"); + CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan/build"); + CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan/prefs"); + CPAN::Shell->o (conf => q , "'"$STATICPERL"'/cpan/histfile"); + CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan/sources"); + CPAN::Shell->o (conf => q, "'"$PERL_PREFIX"'/bin/cpan-make-install"); + CPAN::Shell->o (conf => q, q); + CPAN::Shell->o (conf => q, q); + CPAN::Shell->o (conf => q); + ' || fatal "error while initialising CPAN" - "$PERL_PREFIX"/bin/perl -MCPAN -e ' - CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); - CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan"); - CPAN::Shell->o (conf => q); - CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan"); - CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan/build"); - CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan/prefs"); - CPAN::Shell->o (conf => q , "'"$STATICPERL"'/cpan/histfile"); - CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan/sources"); - CPAN::Shell->o (conf => q, "'"$PERL_PREFIX"'/bin/cpan-make-install"); - CPAN::Shell->o (conf => q, q); - CPAN::Shell->o (conf => q, q); - CPAN::Shell->o (conf => q); - ' || fatal "error while initialising CPAN" - - NOCHECK_INSTALL=+ - instcpan $STATICPERL_MODULES - [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES + touch "$PERL_PREFIX/staticstamp.install" + fi + + if ! [ -e "$PERL_PREFIX/staticstamp.postinstall"; then + NOCHECK_INSTALL=+ + instcpan $STATICPERL_MODULES + [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES - postinstall || fatal "postinstall hook failed" + postinstall || fatal "postinstall hook failed" - touch "$PERL_PREFIX/staticstamp.install" + touch "$PERL_PREFIX/staticstamp.postinstall" + fi } #############################################################################