… | |
… | |
2 | |
2 | |
3 | ############################################################################# |
3 | ############################################################################# |
4 | # configuration to fill in (or to replace in your .staticperlrc) |
4 | # configuration to fill in (or to replace in your .staticperlrc) |
5 | |
5 | |
6 | STATICPERL=~/.staticperl |
6 | STATICPERL=~/.staticperl |
7 | CPAN=http://mirror.netcologne.de/cpan # which mirror to use |
7 | CPAN=https://mirror.netcologne.de/cpan # which mirror to use |
|
|
8 | BACKPAN=https://backpan.perl.org/ |
8 | EMAIL="read the documentation <rtfm@example.org>" |
9 | EMAIL="read the documentation <rtfm@example.org>" |
9 | DLCACHE= |
10 | DLCACHE= |
10 | |
11 | |
11 | # perl build variables |
12 | # perl build variables |
12 | MAKE=make |
13 | MAKE=make |
… | |
… | |
49 | |
50 | |
50 | # which extra modules you might want to install |
51 | # which extra modules you might want to install |
51 | EXTRA_MODULES="" |
52 | EXTRA_MODULES="" |
52 | |
53 | |
53 | # overridable functions |
54 | # overridable functions |
54 | preconfigure() { : ; } |
55 | preconfigure() { : ; } |
55 | patchconfig() { : ; } |
56 | patchconfig() { : ; } |
56 | postconfigure() { : ; } |
57 | postconfigure() { : ; } |
57 | postbuild() { : ; } |
58 | postbuild() { : ; } |
|
|
59 | postcpanconfig() { : ; } |
58 | postinstall() { : ; } |
60 | postinstall() { : ; } |
59 | |
61 | |
60 | # now source user config, if any |
62 | # now source user config, if any |
61 | if [ "$STATICPERLRC" ]; then |
63 | if [ "$STATICPERLRC" ]; then |
62 | . "$STATICPERLRC" |
64 | . "$STATICPERLRC" |
63 | else |
65 | else |
… | |
… | |
76 | export LDFLAGS="$PERL_LDFLAGS" |
78 | export LDFLAGS="$PERL_LDFLAGS" |
77 | unset LIBS |
79 | unset LIBS |
78 | |
80 | |
79 | PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed |
81 | PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed |
80 | |
82 | |
81 | unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG |
83 | unset PERL PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO PERLIO_DEBUG PERL_MB_OPT |
82 | unset PERL_MB_OPT |
|
|
83 | LC_ALL=C; export LC_ALL # just to be on the safe side |
84 | LC_ALL=C; export LC_ALL # just to be on the safe side |
84 | |
85 | |
85 | # prepend PATH - not required by staticperl itself, but might make |
86 | # prepend PATH - not required by staticperl itself, but might make |
86 | # life easier when working in e.g. "staticperl cpan / look" |
87 | # life easier when working in e.g. "staticperl cpan / look" |
87 | PATH="$PERL_PREFIX/perl/bin:$PATH" |
88 | PATH="$PERL_PREFIX/perl/bin:$PATH" |
88 | |
89 | |
89 | # set version in a way that Makefile.PL can extract |
90 | # set version in a way that Makefile.PL can extract |
90 | VERSION=VERSION; eval \ |
91 | VERSION=VERSION; eval \ |
91 | $VERSION="1.45" |
92 | $VERSION="1.46" |
92 | |
93 | |
93 | fatal() { |
94 | fatal() { |
94 | printf -- "\nFATAL: %s\n\n" "$*" >&2 |
95 | printf -- "\nFATAL: %s\n\n" "$*" >&2 |
95 | exit 1 |
96 | exit 1 |
96 | } |
97 | } |
… | |
… | |
171 | chmod -R u+w unpack |
172 | chmod -R u+w unpack |
172 | mv unpack perl |
173 | mv unpack perl |
173 | return |
174 | return |
174 | ;; |
175 | ;; |
175 | * ) |
176 | * ) |
176 | PERLURL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.bz2" |
177 | PERLURL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.gz" |
177 | PERLTAR=perl-$PERL_VERSION.tar.bz2 |
178 | PERLTAR=perl-$PERL_VERSION.tar.gz |
178 | ;; |
179 | ;; |
179 | esac |
180 | esac |
180 | |
181 | |
181 | if ! [ -e "$PERLTAR" ]; then |
182 | if ! [ -e "$PERLTAR" ]; then |
182 | verblock <<EOF |
183 | verblock <<EOF |
… | |
… | |
437 | |
438 | |
438 | # help to trick CPAN into avoiding ~/.cpan completely |
439 | # help to trick CPAN into avoiding ~/.cpan completely |
439 | echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" |
440 | echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" |
440 | |
441 | |
441 | # we call cpan with -MCPAN::MyConfig in this script, which |
442 | # we call cpan with -MCPAN::MyConfig in this script, which |
442 | # is strictly unnecssary as we have to patch CPAN anyway, |
443 | # is strictly unnecessary as we have to patch CPAN anyway, |
443 | # so consider it "for good measure". |
444 | # so consider it "for good measure". |
444 | "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e ' |
445 | "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e ' |
445 | CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); |
446 | CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); |
|
|
447 | CPAN::Shell->o (conf => urllist => push => "'"$BACKPAN"'"); |
|
|
448 | CPAN::Shell->o (conf => pushy_https => "0"); |
446 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
449 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
447 | CPAN::Shell->o (conf => q<init>); |
450 | CPAN::Shell->o (conf => q<init>); |
448 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
451 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
449 | CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); |
452 | CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); |
450 | CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs"); |
453 | CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs"); |
… | |
… | |
453 | CPAN::Shell->o (conf => q<makepl_arg>, "MAP_TARGET=perl"); |
456 | CPAN::Shell->o (conf => q<makepl_arg>, "MAP_TARGET=perl"); |
454 | CPAN::Shell->o (conf => q<make>, "'"$PERL_PREFIX"'/bin/SP-make-make"); |
457 | CPAN::Shell->o (conf => q<make>, "'"$PERL_PREFIX"'/bin/SP-make-make"); |
455 | CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/SP-make-install-make"); |
458 | CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/SP-make-install-make"); |
456 | CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); |
459 | CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); |
457 | CPAN::Shell->o (conf => q<build_requires_install_policy>, q<yes>); |
460 | CPAN::Shell->o (conf => q<build_requires_install_policy>, q<yes>); |
|
|
461 | CPAN::Shell->o (conf => q<recommends_policy>, q<0>); |
|
|
462 | CPAN::Shell->o (conf => q<suggests_policy>, q<0>); |
458 | CPAN::Shell->o (conf => q<prefer_installer>, "EUMM"); |
463 | CPAN::Shell->o (conf => q<prefer_installer>, q<EUMM>); |
459 | CPAN::Shell->o (conf => q<commit>); |
464 | CPAN::Shell->o (conf => q<commit>); |
460 | ' || fatal "error while initialising CPAN" |
465 | ' || fatal "error while initialising CPAN" |
|
|
466 | |
|
|
467 | postcpanconfig |
461 | |
468 | |
462 | : > "$PERL_PREFIX/staticstamp.install" |
469 | : > "$PERL_PREFIX/staticstamp.install" |
463 | fi |
470 | fi |
464 | |
471 | |
465 | _postinstall |
472 | _postinstall |