… | |
… | |
71 | unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG |
71 | unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG |
72 | LC_ALL=C; export LC_ALL # just to be on the safe side |
72 | LC_ALL=C; export LC_ALL # just to be on the safe side |
73 | |
73 | |
74 | # set version in a way that Makefile.PL can extract |
74 | # set version in a way that Makefile.PL can extract |
75 | VERSION=VERSION; eval \ |
75 | VERSION=VERSION; eval \ |
76 | $VERSION="1.11" |
76 | $VERSION="1.2" |
77 | |
77 | |
78 | BZ2=bz2 |
78 | BZ2=bz2 |
79 | BZIP2=bzip2 |
79 | BZIP2=bzip2 |
80 | |
80 | |
81 | fatal() { |
81 | fatal() { |
… | |
… | |
315 | |
315 | |
316 | # create a "make install" replacement for CPAN |
316 | # create a "make install" replacement for CPAN |
317 | cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF |
317 | cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF |
318 | "$MAKE" || exit |
318 | "$MAKE" || exit |
319 | |
319 | |
|
|
320 | # patch CPAN::HandleConfig.pm |
|
|
321 | HCPM="$PERL_PREFIX"/lib/CPAN/HandleConfig.pm |
|
|
322 | case "\$(head -n1 "\$HCPM")" in |
|
|
323 | *CPAN::MyConfig* ) |
|
|
324 | ;; |
|
|
325 | * ) |
|
|
326 | echo "patching \$HCPM for a safer tomorrow" |
|
|
327 | { |
|
|
328 | echo "use CPAN::MyConfig;" |
|
|
329 | cat "\$HCPM" |
|
|
330 | } >"\$HCPM~" |
|
|
331 | rm -f "\$HCPM" |
|
|
332 | mv "\$HCPM~" "\$HCPM" |
|
|
333 | ;; |
|
|
334 | esac |
|
|
335 | |
320 | if find blib/arch/auto -type f | grep -q -v .exists; then |
336 | if find blib/arch/auto -type f | grep -q -v .exists; then |
321 | echo Probably an XS module, rebuilding perl |
337 | echo Probably an XS module, rebuilding perl |
322 | if "$MAKE" perl; then |
338 | if "$MAKE" perl; then |
323 | mv perl "$PERL_PREFIX"/bin/perl~ \ |
339 | mv perl "$PERL_PREFIX"/bin/perl~ \ |
324 | && rm -f "$PERL_PREFIX"/bin/perl \ |
340 | && rm -f "$PERL_PREFIX"/bin/perl \ |
… | |
… | |
335 | chmod 755 "$PERL_PREFIX"/bin/cpan-make-install |
351 | chmod 755 "$PERL_PREFIX"/bin/cpan-make-install |
336 | |
352 | |
337 | # trick CPAN into avoiding ~/.cpan completely |
353 | # trick CPAN into avoiding ~/.cpan completely |
338 | echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" |
354 | echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" |
339 | |
355 | |
|
|
356 | # we call cpan with -MCPAN::MyConfig in this script, but |
|
|
357 | # every make install will patch CPAN::HandleConfig.pm to |
|
|
358 | # protect the user. |
|
|
359 | |
340 | "$PERL_PREFIX"/bin/perl -MCPAN -e ' |
360 | "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e ' |
341 | CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); |
361 | CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); |
342 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
362 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
343 | CPAN::Shell->o (conf => q<init>); |
363 | CPAN::Shell->o (conf => q<init>); |
344 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
364 | CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); |
345 | CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); |
365 | CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); |
… | |
… | |
347 | CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile"); |
367 | CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile"); |
348 | CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources"); |
368 | CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources"); |
349 | CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/cpan-make-install"); |
369 | CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/cpan-make-install"); |
350 | CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); |
370 | CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); |
351 | CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>); |
371 | CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>); |
|
|
372 | CPAN::Shell->o (conf => q<prefer_installer>, "EUMM"); |
352 | CPAN::Shell->o (conf => q<commit>); |
373 | CPAN::Shell->o (conf => q<commit>); |
353 | ' || fatal "error while initialising CPAN" |
374 | ' || fatal "error while initialising CPAN" |
354 | |
375 | |
355 | touch "$PERL_PREFIX/staticstamp.install" |
376 | touch "$PERL_PREFIX/staticstamp.install" |
356 | fi |
377 | fi |
… | |
… | |
376 | installing modules from CPAN |
397 | installing modules from CPAN |
377 | $@ |
398 | $@ |
378 | EOF |
399 | EOF |
379 | |
400 | |
380 | for mod in "$@"; do |
401 | for mod in "$@"; do |
381 | "$PERL_PREFIX"/bin/perl -MCPAN -e 'notest install => "'"$mod"'"' \ |
402 | "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e 'notest install => "'"$mod"'"' \ |
382 | || fatal "$mod: unable to install from CPAN" |
403 | || fatal "$mod: unable to install from CPAN" |
383 | done |
404 | done |
384 | rm -rf "$STATICPERL/build" |
405 | rm -rf "$STATICPERL/build" |
385 | } |
406 | } |
386 | |
407 | |