… | |
… | |
59 | [ -r "$STATICPERL/rc" ] && . "$STATICPERL/rc" |
59 | [ -r "$STATICPERL/rc" ] && . "$STATICPERL/rc" |
60 | |
60 | |
61 | ############################################################################# |
61 | ############################################################################# |
62 | # support |
62 | # support |
63 | |
63 | |
|
|
64 | unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG |
|
|
65 | export 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 |
65 | VERSION=VERSION; eval \ |
68 | VERSION=VERSION; eval \ |
66 | $VERSION=0.1 |
69 | $VERSION=0.9 |
67 | |
70 | |
68 | BZ2=bz2 |
71 | BZ2=bz2 |
69 | BZIP2=bzip2 |
72 | BZIP2=bzip2 |
70 | |
73 | |
71 | fatal() { |
74 | fatal() { |
… | |
… | |
147 | verblock <<EOF |
150 | verblock <<EOF |
148 | unpacking perl |
151 | unpacking perl |
149 | EOF |
152 | EOF |
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 |
267 | make install UNINST=1 |
270 | make || exit |
|
|
271 | |
268 | if find blib/arch/auto -type f | grep -q -v .exists; then |
272 | if 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 |
274 | fi |
281 | fi |
|
|
282 | |
|
|
283 | make install UNINST=1 |
275 | EOF |
284 | EOF |
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 | |
387 | bundle() { |
396 | bundle() { |
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 | |
393 | if [ $# -gt 0 ]; then |
404 | if [ $# -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 |