ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.sh
(Generate patch)

Comparing App-Staticperl/staticperl.sh (file contents):
Revision 1.49 by root, Sun Jul 10 01:37:56 2011 UTC vs.
Revision 1.76 by root, Fri Aug 4 03:14:33 2023 UTC

1#!/bin/sh 1#!/bin/sh
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
6# clean up the environment a bit
7unset PERL PERLLIB PERL5LIB PERL5OPT PERL_UNICODE PERLIO
5 8
6STATICPERL=~/.staticperl 9STATICPERL=~/.staticperl
7CPAN=http://mirror.netcologne.de/cpan # which mirror to use 10CPAN=http://mirror.netcologne.de/cpan # which mirror to use
8EMAIL="read the documentation <rtfm@example.org>" 11EMAIL="read the documentation <rtfm@example.org>"
9DLCACHE= 12DLCACHE=
10 13
11# perl build variables 14# perl build variables
12MAKE=make 15MAKE=make
13PERL_VERSION=5.12.4 # 5.8.9 is also a good choice 16PERL_VERSION=http://stableperl.schmorp.de/dist/latest.tar.gz # 5.12.5 and 5.8.9 are good choices for small builds
14PERL_CC=cc 17PERL_CC=cc
15PERL_CONFIGURE="" # additional Configure arguments 18PERL_CONFIGURE="" # additional Configure arguments
16PERL_CCFLAGS="-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG" 19PERL_CCFLAGS="-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG"
17PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" 20PERL_OPTIMIZE="-Os" # -Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math"
18 21
19ARCH="$(uname -m)" 22ARCH="$(uname -m)"
20 23
21case "$ARCH" in 24#case "$ARCH" in
22 i*86 | x86_64 | amd64 ) 25# i*86 | x86_64 | amd64 )
23 PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64 26# PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64
24 case "$ARCH" in 27# case "$ARCH" in
25 i*86 ) 28# i*86 )
26 PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only 29# PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only
27 ;; 30# ;;
28 esac 31# esac
29 ;; 32# ;;
30esac 33#esac
31 34
32# -Wl,--gc-sections makes it impossible to check for undefined references 35# -Wl,--gc-sections makes it impossible to check for undefined references
33# for some reason so we need to patch away the "-no" after Configure and before make :/ 36# for some reason so we need to patch away the "-no" after Configure and before make :/
34# --allow-multiple-definition exists to work around uclibc's pthread static linking bug 37# --allow-multiple-definition exists to work around uclibc's pthread static linking bug
35#PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition" 38#PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition"
43#EV_EXTRA_DEFS='-DEV_FEATURES=4+8+16+64 -DEV_USE_SELECT=0 -DEV_USE_POLL=1 -DEV_USE_EPOLL=1 -DEV_NO_LOOPS -DEV_COMPAT3=0' 46#EV_EXTRA_DEFS='-DEV_FEATURES=4+8+16+64 -DEV_USE_SELECT=0 -DEV_USE_POLL=1 -DEV_USE_EPOLL=1 -DEV_NO_LOOPS -DEV_COMPAT3=0'
44export PERL_MM_USE_DEFAULT PERL_MM_OPT 47export PERL_MM_USE_DEFAULT PERL_MM_OPT
45 48
46# which extra modules to install by default from CPAN that are 49# which extra modules to install by default from CPAN that are
47# required by mkbundle 50# required by mkbundle
48STATICPERL_MODULES="common::sense Pod::Strip PPI::XS Pod::Usage" 51STATICPERL_MODULES="ExtUtils::MakeMaker ExtUtils::CBuilder common::sense Pod::Strip PPI PPI::XS Pod::Usage"
49 52
50# which extra modules you might want to install 53# which extra modules you might want to install
51EXTRA_MODULES="" 54EXTRA_MODULES=""
52 55
53# overridable functions 56# overridable functions
54preconfigure() { : ; } 57preconfigure() { : ; }
55patchconfig() { : ; } 58patchconfig() { : ; }
56postconfigure() { : ; } 59postconfigure() { : ; }
57postbuild() { : ; } 60postbuild() { : ; }
61postcpanconfig() { : ; }
58postinstall() { : ; } 62postinstall() { : ; }
59 63
60# now source user config, if any 64# now source user config, if any
61if [ "$STATICPERLRC" ]; then 65if [ "$STATICPERLRC" ]; then
62 . "$STATICPERLRC" 66 . "$STATICPERLRC"
63else 67else
67fi 71fi
68 72
69############################################################################# 73#############################################################################
70# support 74# support
71 75
76# work around ExtUtils::CBuilder and others
77export CC="$PERL_CC"
78export CFLAGS="$PERL_CFLAGS"
79export LD="$PERL_CC"
80export LDFLAGS="$PERL_LDFLAGS"
81unset LIBS
82
72PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed 83PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed
73 84
74unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG 85unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
75unset PERL_MB_OPT 86unset PERL_MB_OPT
76LC_ALL=C; export LC_ALL # just to be on the safe side 87LC_ALL=C; export LC_ALL # just to be on the safe side
79# life easier when working in e.g. "staticperl cpan / look" 90# life easier when working in e.g. "staticperl cpan / look"
80PATH="$PERL_PREFIX/perl/bin:$PATH" 91PATH="$PERL_PREFIX/perl/bin:$PATH"
81 92
82# set version in a way that Makefile.PL can extract 93# set version in a way that Makefile.PL can extract
83VERSION=VERSION; eval \ 94VERSION=VERSION; eval \
84$VERSION="1.31" 95$VERSION="1.46"
85
86BZ2=bz2
87BZIP2=bzip2
88 96
89fatal() { 97fatal() {
90 printf -- "\nFATAL: %s\n\n" "$*" >&2 98 printf -- "\nFATAL: %s\n\n" "$*" >&2
91 exit 1 99 exit 1
92} 100}
138} 146}
139 147
140realclean() { 148realclean() {
141 rm -f "$PERL_PREFIX/staticstamp.postinstall" 149 rm -f "$PERL_PREFIX/staticstamp.postinstall"
142 rm -f "$PERL_PREFIX/staticstamp.install" 150 rm -f "$PERL_PREFIX/staticstamp.install"
143 rm -f "$STATICPERL/src/perl-"*"/staticstamp.configure" 151 rm -f "$STATICPERL/src/perl/staticstamp.configure"
144} 152}
145 153
146fetch() { 154fetch() {
155(
147 rcd "$STATICPERL" 156 rcd "$STATICPERL"
148 157
149 mkdir -p src 158 mkdir -p src
150 rcd src 159 rcd src
151 160
152 if ! [ -d "perl-$PERL_VERSION" ]; then 161 if ! [ -d "perl" ]; then
162 rm -rf unpack
163 mkdir -p unpack
164
165 case "$PERL_VERSION" in
166 *:* )
167 # url
168 PERLURL="$PERL_VERSION"
169 PERLTAR="$(basename "$PERL_VERSION")"
170 ;;
171 /* )
172 # directory
173 verbose "copying $PERL_VERSION"
174 cp -Rp "$PERL_VERSION/." unpack/.
175 chmod -R u+w unpack
176 mv unpack perl
177 return
178 ;;
179 * )
180 PERLURL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.gz"
153 PERLTAR=perl-$PERL_VERSION.tar.$BZ2 181 PERLTAR=perl-$PERL_VERSION.tar.gz
182 ;;
183 esac
154 184
155 if ! [ -e $PERLTAR ]; then 185 if ! [ -e "$PERLTAR" ]; then
156 URL="$CPAN/src/5.0/$PERLTAR"
157
158 verblock <<EOF 186 verblock <<EOF
159downloading perl 187downloading perl
188
189trying to download from $PERLURL
190
191you can configure a download cache directory via DLCACHE
192in your .staticperlrc to avoid repeated downloads.
193
160to manually download perl yourself, place 194to manually download perl yourself, place a suitable tarball in
161perl-$PERL_VERSION.tar.$BZ2 in $STATICPERL 195$DLCACHE/$PERLTAR
162trying $URL
163 196
164either curl or wget is required for automatic download. 197either curl or wget is required for automatic download.
165curl is tried first, then wget. 198curl is tried first, then wget.
166
167you can configure a download cache directory via DLCACHE
168in your .staticperlrc to avoid repeated downloads.
169EOF 199EOF
170 200
171 rm -f $PERLTAR~ # just to be on the safe side 201 rm -f $PERLTAR~ # just to be on the safe side
172 { [ "$DLCACHE" ] && cp "$DLCACHE"/$PERLTAR $PERLTAR~ >/dev/null 2>&1; } \ 202 { [ "$DLCACHE" ] && cp "$DLCACHE"/$PERLTAR $PERLTAR~ >/dev/null 2>&1; } \
173 || wget -O $PERLTAR~ "$URL" \ 203 || wget -O $PERLTAR~ "$PERLURL" \
174 || curl -f >$PERLTAR~ "$URL" \ 204 || curl -f >$PERLTAR~ "$PERLURL" \
175 || fatal "$URL: unable to download" 205 || fatal "$URL: unable to download"
176 rm -f $PERLTAR 206 rm -f $PERLTAR
177 mv $PERLTAR~ $PERLTAR 207 mv $PERLTAR~ $PERLTAR
178 if [ "$DLCACHE" ]; then 208 if [ "$DLCACHE" ]; then
179 mkdir -p "$DLCACHE" 209 mkdir -p "$DLCACHE"
180 cp $PERLTAR "$DLCACHE"/$PERLTAR~ && \ 210 cp $PERLTAR "$DLCACHE"/$PERLTAR~$$~ && \
181 mv "$DLCACHE"/$PERLTAR~ "$DLCACHE"/$PERLTAR 211 mv "$DLCACHE"/$PERLTAR~$$~ "$DLCACHE"/$PERLTAR
182 fi 212 fi
183 fi 213 fi
184 214
185 verblock <<EOF 215 verblock <<EOF
186unpacking perl 216unpacking perl
187EOF 217EOF
188 218
189 mkdir -p unpack 219 case "$PERLTAR" in
190 rm -rf unpack/perl-$PERL_VERSION 220 *.xz ) UNCOMPRESS="xz -d" ;;
221 *.lzma ) UNCOMPRESS="lzma -d" ;;
222 *.bz2 ) UNCOMPRESS="bzip2 -d" ;;
223 *.gz ) UNCOMPRESS="gzip -d" ;;
224 *.tar ) UNCOMPRESS="cat" ;;
225 * )
226 fatal "don't know hot to uncompress $PERLTAR,\nonly tar, tar.gz, tar.bz2, tar.lzma and tar.xz are supported."
227 exit 1
228 ;;
229 esac
230
191 $BZIP2 -d <$PERLTAR | ( cd unpack && tar xf - ) \ 231 <"$PERLTAR" $UNCOMPRESS -d | ( cd unpack && tar xf - ) \
192 || fatal "$PERLTAR: error during unpacking" 232 || fatal "$PERLTAR: error during unpacking"
193 chmod -R u+w unpack/perl-$PERL_VERSION 233
194 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION 234 if [ -d unpack/*/ ]; then
235 chmod -R u+w unpack/*/
236 mv unpack/*/ perl
195 rmdir -p unpack 237 rmdir -p unpack
238 else
239 fatal "unpacking $PERLTAR did not result in a single directory, don't know how to handle this"
240 fi
241
242 rm "$PERLTAR"
196 fi 243 fi
244) || exit
197} 245}
198 246
199# similar to GNU-sed -i or perl -pi 247# similar to GNU-sed -i or perl -pi
200sedreplace() { 248sedreplace() {
201 sed -e "$1" <"$2" > "$2~" || fatal "error while running sed" 249 sed -e "$1" <"$2" > "$2~" || fatal "error while running sed"
228EOF 276EOF
229 exit 1 277 exit 1
230} 278}
231 279
232configure() { 280configure() {
281(
233 fetch 282 fetch
234 283
235 rcd "$STATICPERL/src/perl-$PERL_VERSION" 284 rcd "$STATICPERL/src/perl"
236 285
237 [ -e staticstamp.configure ] && return 286 [ -e staticstamp.configure ] && return
238 287
239 verblock <<EOF 288 verblock <<EOF
240configuring $STATICPERL/src/perl-$PERL_VERSION 289configuring $STATICPERL/src/perl
241EOF 290EOF
242 291
243 rm -f "$PERL_PREFIX/staticstamp.install" 292 rm -f "$PERL_PREFIX/staticstamp.install"
244 293
245 "$MAKE" distclean >/dev/null 2>&1 294 "$MAKE" distclean >/dev/null 2>&1
287 -Demail="$EMAIL" \ 336 -Demail="$EMAIL" \
288 -Dcf_email="$EMAIL" \ 337 -Dcf_email="$EMAIL" \
289 -Dcf_by="$EMAIL" \ 338 -Dcf_by="$EMAIL" \
290 $PERL_CONFIGURE \ 339 $PERL_CONFIGURE \
291 -Duseperlio \ 340 -Duseperlio \
341 -Uversiononly \
292 -dE || configure_failure 342 -dE || configure_failure
293 343
294 sedreplace ' 344 sedreplace '
295 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g 345 s/-Wl,--no-gc-sections/-Wl,--gc-sections/g
296 s/ *-fno-stack-protector */ /g 346 s/ *-fno-stack-protector */ /g
301 sh Configure -S || fatal "Configure -S failed" 351 sh Configure -S || fatal "Configure -S failed"
302 352
303 postconfigure || fatal "postconfigure hook failed" 353 postconfigure || fatal "postconfigure hook failed"
304 354
305 : > staticstamp.configure 355 : > staticstamp.configure
356) || exit
306} 357}
307 358
308write_shellscript() { 359write_shellscript() {
309 { 360 {
310 echo "#!/bin/sh" 361 echo "#!/bin/sh"
315 } >"$PERL_PREFIX/bin/$1" 366 } >"$PERL_PREFIX/bin/$1"
316 chmod 755 "$PERL_PREFIX/bin/$1" 367 chmod 755 "$PERL_PREFIX/bin/$1"
317} 368}
318 369
319build() { 370build() {
371(
320 configure 372 configure
321 373
322 rcd "$STATICPERL/src/perl-$PERL_VERSION" 374 rcd "$STATICPERL/src/perl"
323 375
324 verblock <<EOF 376 verblock <<EOF
325building $STATICPERL/src/perl-$PERL_VERSION 377building $STATICPERL/src/perl
326EOF 378EOF
327 379
328 rm -f "$PERL_PREFIX/staticstamp.install" 380 rm -f "$PERL_PREFIX/staticstamp.install"
329 381
330 "$MAKE" || fatal "make: error while building perl" 382 "$MAKE" || fatal "make: error while building perl"
331 383
332 postbuild || fatal "postbuild hook failed" 384 postbuild || fatal "postbuild hook failed"
385) || exit
333} 386}
334 387
335_postinstall() { 388_postinstall() {
336 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then 389 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then
337 NOCHECK_INSTALL=+ 390 NOCHECK_INSTALL=+
338 instcpan $STATICPERL_MODULES 391 instcpan $STATICPERL_MODULES
339 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES 392 [ "$EXTRA_MODULES" ] && instcpan $EXTRA_MODULES
340 393
341 postinstall || fatal "postinstall hook failed" 394 postinstall || fatal "postinstall hook failed"
342 395
343 : > "$PERL_PREFIX/staticstamp.postinstall" 396 : > "$PERL_PREFIX/staticstamp.postinstall"
344 fi 397 fi
345} 398}
346 399
347install() { 400install() {
401(
348 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then 402 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
349 build 403 build
350 404
351 verblock <<EOF 405 verblock <<EOF
352installing $STATICPERL/src/perl-$PERL_VERSION 406installing $STATICPERL/src/perl
353to $PERL_PREFIX 407to $PERL_PREFIX
354EOF 408EOF
355 409
356 ln -sf "perl/bin/" "$STATICPERL/bin" 410 ln -sf "perl/bin/" "$STATICPERL/bin"
357 ln -sf "perl/lib/" "$STATICPERL/lib" 411 ln -sf "perl/lib/" "$STATICPERL/lib"
359 mkdir "$STATICPERL/patched" 413 mkdir "$STATICPERL/patched"
360 414
361 ln -sf "$PERL_PREFIX" "$STATICPERL/perl" # might get overwritten 415 ln -sf "$PERL_PREFIX" "$STATICPERL/perl" # might get overwritten
362 rm -rf "$PERL_PREFIX" # by this rm -rf 416 rm -rf "$PERL_PREFIX" # by this rm -rf
363 417
418 rcd "$STATICPERL/src/perl"
419
364 "$MAKE" install || fatal "make install: error while installing" 420 "$MAKE" install || fatal "make install: error while installing"
365 421
366 rcd "$PERL_PREFIX" 422 rcd "$PERL_PREFIX"
367 423
368 # create a "make install" replacement for CPAN 424 # create a "make install" replacement for CPAN
369 write_shellscript SP-make-install-make <<'EOF' 425 write_shellscript SP-make-make <<'end_of_make'
426#CAT make-make.sh
427end_of_make
428
429 # create a "make install" replacement for CPAN
430 write_shellscript SP-make-install-make <<'end_of_make_install_make'
370#CAT make-install-make.sh 431#CAT make-install-make.sh
371EOF 432end_of_make_install_make
372 433
373 # create a "patch modules" helper 434 # create a "patch modules" helper
374 write_shellscript SP-patch-postinstall <<'EOF' 435 write_shellscript SP-patch-postinstall <<'end_of_patch_postinstall'
375#CAT patch-postinstall.sh 436#CAT patch-postinstall.sh
376EOF 437end_of_patch_postinstall
377 438
439 # immediately use it
378 "$PERL_PREFIX/bin/SP-patch-postinstall" 440 "$PERL_PREFIX/bin/SP-patch-postinstall"
379 441
380 # help to trick CPAN into avoiding ~/.cpan completely 442 # help to trick CPAN into avoiding ~/.cpan completely
381 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" 443 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
382 444
383 # we call cpan with -MCPAN::MyConfig in this script, which 445 # we call cpan with -MCPAN::MyConfig in this script, which
384 # is strictly unnecssary as we have to patch CPAN anyway, 446 # is strictly unnecessary as we have to patch CPAN anyway,
385 # so consider it "for good measure". 447 # so consider it "for good measure".
386 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e ' 448 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e '
387 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); 449 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
450 CPAN::Shell->o (conf => pushy_https => "0");
388 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 451 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
389 CPAN::Shell->o (conf => q<init>); 452 CPAN::Shell->o (conf => q<init>);
390 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 453 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
391 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); 454 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build");
392 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs"); 455 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs");
393 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile"); 456 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile");
394 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources"); 457 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources");
458 CPAN::Shell->o (conf => q<makepl_arg>, "MAP_TARGET=perl");
459 CPAN::Shell->o (conf => q<make>, "'"$PERL_PREFIX"'/bin/SP-make-make");
395 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/SP-make-install-make"); 460 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/SP-make-install-make");
396 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); 461 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>);
397 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>); 462 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<yes>);
463 CPAN::Shell->o (conf => q<recommends_policy>, q<0>);
464 CPAN::Shell->o (conf => q<suggests_policy>, q<0>);
398 CPAN::Shell->o (conf => q<prefer_installer>, "EUMM"); 465 CPAN::Shell->o (conf => q<prefer_installer>, q<EUMM>);
399 CPAN::Shell->o (conf => q<commit>); 466 CPAN::Shell->o (conf => q<commit>);
400 ' || fatal "error while initialising CPAN" 467 ' || fatal "error while initialising CPAN"
401 468
469 postcpanconfig
470
402 : > "$PERL_PREFIX/staticstamp.install" 471 : > "$PERL_PREFIX/staticstamp.install"
403 fi 472 fi
404 473
405 _postinstall 474 _postinstall
475) || exit
406} 476}
407 477
408import() { 478import() {
479(
409 IMPORT="$1" 480 IMPORT="$1"
410 481
411 rcd "$STATICPERL" 482 rcd "$STATICPERL"
412 483
413 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then 484 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
418 rm -rf bin cpan lib patched perl src 489 rm -rf bin cpan lib patched perl src
419 mkdir -m 755 perl perl/bin 490 mkdir -m 755 perl perl/bin
420 ln -s perl/bin/ bin 491 ln -s perl/bin/ bin
421 ln -s "$IMPORT" perl/bin/ 492 ln -s "$IMPORT" perl/bin/
422 493
494 echo "$IMPORT" > "$PERL_PREFIX/.import"
495
423 : > "$PERL_PREFIX/staticstamp.install" 496 : > "$PERL_PREFIX/staticstamp.install"
424 fi 497 fi
425 498
426 _postinstall 499 _postinstall
500) || exit
427} 501}
428 502
429############################################################################# 503#############################################################################
430# install a module from CPAN 504# install a module from CPAN
431 505
432instcpan() { 506instcpan() {
433 [ $NOCHECK_INSTALL ] || install 507 [ $NOCHECK_INSTALL ] || install
434 508
435 verblock <<EOF 509 verblock <<EOF
436installing modules from CPAN 510installing modules from CPAN
437$@ 511$*
438EOF 512EOF
439 513
440 #"$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e 'notest install $_ for @ARGV' -- "$@" | tee "$STATICPERL/instcpan.log" 514 MYCONFIG=
515 [ -e "$PERL_PREFIX/.import" ] || MYCONFIG=-MCPAN::MyConfig
516
441 "$PERL_PREFIX"/bin/perl -MCPAN -e 'notest install $_ for @ARGV' -- "$@" | tee "$STATICPERL/instcpan.log" 517 "$PERL_PREFIX"/bin/perl $MYCONFIG -MCPAN -e 'notest (install => $_) for @ARGV' -- "$@" | tee "$STATICPERL/instcpan.log"
442 518
443 if grep -q " -- NOT OK\$" "$STATICPERL/instcpan.log"; then 519 if grep -q " -- NOT OK\$" "$STATICPERL/instcpan.log"; then
444 fatal "failure while installing modules from CPAN ($@)" 520 fatal "failure while installing modules from CPAN ($*)"
445 fi 521 fi
446 rm -f "$STATICPERL/instcpan.log" 522 rm -f "$STATICPERL/instcpan.log"
447} 523}
448 524
449############################################################################# 525#############################################################################
452instsrc() { 528instsrc() {
453 [ $NOCHECK_INSTALL ] || install 529 [ $NOCHECK_INSTALL ] || install
454 530
455 verblock <<EOF 531 verblock <<EOF
456installing modules from source 532installing modules from source
457$@ 533$*
458EOF 534EOF
459 535
460 for mod in "$@"; do 536 for mod in "$@"; do
461 echo 537 echo
462 echo $mod 538 echo $mod
500catmkbundle() { 576catmkbundle() {
501 { 577 {
502 read dummy 578 read dummy
503 echo "#!$PERL_PREFIX/bin/perl" 579 echo "#!$PERL_PREFIX/bin/perl"
504 cat 580 cat
505 } <<'MKBUNDLE' 581 } <<'end_of_mkbundle'
506#CAT mkbundle 582#CAT mkbundle
507MKBUNDLE 583end_of_mkbundle
508} 584}
509 585
510bundle() { 586bundle() {
511 MKBUNDLE="${MKBUNDLE:=$PERL_PREFIX/bin/SP-mkbundle}" 587 MKBUNDLE="${MKBUNDLE:=$PERL_PREFIX/bin/SP-mkbundle}"
512 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create" 588 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines