ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/App-Staticperl/staticperl.sh
Revision: 1.63
Committed: Fri Oct 16 02:43:37 2015 UTC (10 years, 11 months ago) by root
Content type: application/x-sh
Branch: MAIN
Changes since 1.62: +12 -4 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/bin/sh
2    
3     #############################################################################
4 root 1.45 # configuration to fill in (or to replace in your .staticperlrc)
5 root 1.1
6     STATICPERL=~/.staticperl
7 root 1.14 CPAN=http://mirror.netcologne.de/cpan # which mirror to use
8 root 1.1 EMAIL="read the documentation <rtfm@example.org>"
9 root 1.45 DLCACHE=
10 root 1.1
11     # perl build variables
12 root 1.21 MAKE=make
13 root 1.62 PERL_VERSION=http://stableperl.schmorp.de/dist/latest.tar.gz # 5.12.5 and 5.8.9 are good choices for small builds
14 root 1.19 PERL_CC=cc
15 root 1.4 PERL_CONFIGURE="" # additional Configure arguments
16 root 1.32 PERL_CCFLAGS="-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG"
17 root 1.51 PERL_OPTIMIZE="-Os" # -Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math"
18 root 1.1
19     ARCH="$(uname -m)"
20    
21 root 1.51 #case "$ARCH" in
22     # i*86 | x86_64 | amd64 )
23     # PERL_OPTIMIZE="$PERL_OPTIMIZE -mpush-args -mno-inline-stringops-dynamically -mno-align-stringops -mno-ieee-fp" # x86/amd64
24     # case "$ARCH" in
25     # i*86 )
26     # PERL_OPTIMIZE="$PERL_OPTIMIZE -fomit-frame-pointer -march=pentium3 -mtune=i386" # x86 only
27     # ;;
28     # esac
29     # ;;
30     #esac
31 root 1.1
32     # -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 :/
34 root 1.16 # --allow-multiple-definition exists to work around uclibc's pthread static linking bug
35 root 1.37 #PERL_LDFLAGS="-Wl,--no-gc-sections -Wl,--allow-multiple-definition"
36     PERL_LDFLAGS=
37 root 1.1 PERL_LIBS="-lm -lcrypt" # perl loves to add lotsa crap itself
38    
39     # some configuration options for modules
40 root 1.24 PERL_MM_USE_DEFAULT=1
41 root 1.39 PERL_MM_OPT="MAN1PODS= MAN3PODS="
42 root 1.24 #CORO_INTERFACE=p # needed without nptl on x86, due to bugs in linuxthreads - very slow
43 root 1.47 #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'
44     export PERL_MM_USE_DEFAULT PERL_MM_OPT
45 root 1.1
46     # which extra modules to install by default from CPAN that are
47     # required by mkbundle
48 root 1.58 STATICPERL_MODULES="ExtUtils::MakeMaker ExtUtils::CBuilder common::sense Pod::Strip PPI PPI::XS Pod::Usage"
49 root 1.2
50     # which extra modules you might want to install
51     EXTRA_MODULES=""
52 root 1.1
53     # overridable functions
54 root 1.7 preconfigure() { : ; }
55 root 1.37 patchconfig() { : ; }
56 root 1.1 postconfigure() { : ; }
57     postbuild() { : ; }
58     postinstall() { : ; }
59    
60     # now source user config, if any
61 root 1.14 if [ "$STATICPERLRC" ]; then
62     . "$STATICPERLRC"
63     else
64     [ -r /etc/staticperlrc ] && . /etc/staticperlrc
65     [ -r ~/.staticperlrc ] && . ~/.staticperlrc
66     [ -r "$STATICPERL/rc" ] && . "$STATICPERL/rc"
67     fi
68 root 1.1
69     #############################################################################
70     # support
71    
72 root 1.58 # work around ExtUtils::CBuilder and others
73     export CC="$PERL_CC"
74     export CFLAGS="$PERL_CFLASGS"
75     export LD="$PERL_CC"
76     export LDFLAGS="$PERL_LDFLAGS"
77     unset LIBS
78    
79 root 1.14 PERL_PREFIX="${PERL_PREFIX:=$STATICPERL/perl}" # where the perl gets installed
80    
81 root 1.38 unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
82 root 1.39 unset PERL_MB_OPT
83 root 1.24 LC_ALL=C; export LC_ALL # just to be on the safe side
84 root 1.12
85 root 1.38 # prepend PATH - not required by staticperl itself, but might make
86     # life easier when working in e.g. "staticperl cpan / look"
87     PATH="$PERL_PREFIX/perl/bin:$PATH"
88    
89 root 1.1 # set version in a way that Makefile.PL can extract
90     VERSION=VERSION; eval \
91 root 1.58 $VERSION="1.44"
92 root 1.1
93     fatal() {
94     printf -- "\nFATAL: %s\n\n" "$*" >&2
95     exit 1
96     }
97    
98     verbose() {
99     printf -- "%s\n" "$*"
100     }
101    
102     verblock() {
103     verbose
104     verbose "***"
105     while read line; do
106     verbose "*** $line"
107     done
108     verbose "***"
109     verbose
110     }
111    
112     rcd() {
113     cd "$1" || fatal "$1: cannot enter"
114     }
115    
116     trace() {
117     prefix="$1"; shift
118     # "$@" 2>&1 | while read line; do
119     # echo "$prefix: $line"
120     # done
121     "$@"
122     }
123    
124     trap wait 0
125    
126     #############################################################################
127     # clean
128    
129     distclean() {
130     verblock <<EOF
131 root 1.14 deleting everything installed by this script (rm -rf $STATICPERL)
132 root 1.1 EOF
133    
134     rm -rf "$STATICPERL"
135     }
136    
137     #############################################################################
138     # download/configure/compile/install perl
139    
140     clean() {
141 root 1.48 rm -rf "$STATICPERL/src"
142 root 1.1 }
143    
144 root 1.23 realclean() {
145     rm -f "$PERL_PREFIX/staticstamp.postinstall"
146     rm -f "$PERL_PREFIX/staticstamp.install"
147 root 1.62 rm -f "$STATICPERL/src/perl/staticstamp.configure"
148 root 1.23 }
149    
150 root 1.1 fetch() {
151     rcd "$STATICPERL"
152    
153     mkdir -p src
154     rcd src
155    
156 root 1.62 if ! [ -d "perl" ]; then
157 root 1.63 rm -rf unpack
158     mkdir -p unpack
159    
160 root 1.62 case "$PERL_VERSION" in
161     *:* )
162 root 1.63 # url
163 root 1.62 PERLURL="$PERL_VERSION"
164     PERLTAR="$(basename "$PERL_VERSION")"
165     ;;
166 root 1.63 /* )
167     # directory
168     verbose "copying $PERL_VERSION"
169     cp -Rp "$PERL_VERSION/." unpack/.
170     chmod -R u+w unpack
171     mv unpack perl
172     return
173     ;;
174 root 1.62 * )
175     PERLURL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.bz2"
176     PERLTAR=perl-$PERL_VERSION.tar.bz2
177     ;;
178     esac
179 root 1.1
180 root 1.62 if ! [ -e "$PERLTAR" ]; then
181 root 1.1 verblock <<EOF
182     downloading perl
183 root 1.42
184 root 1.62 trying to download from $PERLURL
185 root 1.45
186     you can configure a download cache directory via DLCACHE
187     in your .staticperlrc to avoid repeated downloads.
188 root 1.62
189     to manually download perl yourself, place a suitable tarball in
190     $DLCACHE/$PERLTAR
191    
192     either curl or wget is required for automatic download.
193     curl is tried first, then wget.
194 root 1.1 EOF
195    
196 root 1.45 rm -f $PERLTAR~ # just to be on the safe side
197 root 1.48 { [ "$DLCACHE" ] && cp "$DLCACHE"/$PERLTAR $PERLTAR~ >/dev/null 2>&1; } \
198 root 1.62 || wget -O $PERLTAR~ "$PERLURL" \
199     || curl -f >$PERLTAR~ "$PERLURL" \
200 root 1.5 || fatal "$URL: unable to download"
201 root 1.45 rm -f $PERLTAR
202     mv $PERLTAR~ $PERLTAR
203     if [ "$DLCACHE" ]; then
204     mkdir -p "$DLCACHE"
205 root 1.57 cp $PERLTAR "$DLCACHE"/$PERLTAR~$$~ && \
206     mv "$DLCACHE"/$PERLTAR~$$~ "$DLCACHE"/$PERLTAR
207 root 1.45 fi
208 root 1.1 fi
209    
210     verblock <<EOF
211     unpacking perl
212     EOF
213    
214 root 1.62 case "$PERLTAR" in
215     *.xz ) UNCOMPRESS="xz -d" ;;
216     *.lzma ) UNCOMPRESS="lzma -d" ;;
217     *.bz2 ) UNCOMPRESS="bzip2 -d" ;;
218     *.gz ) UNCOMPRESS="gzip -d" ;;
219     *.tar ) UNCOMPRESS="cat" ;;
220     * )
221     fatal "don't know hot to uncompress $PERL_TAR,\nonly tar, tar.gz, tar.bz2, tar.lzma and tar.xz are supported."
222     exit 1
223     ;;
224     esac
225    
226     <"$PERLTAR" $UNCOMPRESS -d | ( cd unpack && tar xf - ) \
227 root 1.45 || fatal "$PERLTAR: error during unpacking"
228 root 1.62
229     if [ -d unpack/*/ ]; then
230     chmod -R u+w unpack/*/
231     mv unpack/*/ perl
232     rmdir -p unpack
233     else
234     fatal "unpacking $PERLTAR did not result in a single directory, don't know how to handle this"
235     fi
236    
237     rm "$PERLTAR"
238 root 1.1 fi
239     }
240    
241     # similar to GNU-sed -i or perl -pi
242     sedreplace() {
243     sed -e "$1" <"$2" > "$2~" || fatal "error while running sed"
244 root 1.20 rm -f "$2"
245 root 1.1 mv "$2~" "$2"
246     }
247    
248 root 1.22 configure_failure() {
249     cat <<EOF
250    
251    
252     ***
253     *** Configure failed - see above for the exact error message(s).
254     ***
255     *** Most commonly, this is because the default PERL_CCFLAGS or PERL_OPTIMIZE
256     *** flags are not supported by your compiler. Less often, this is because
257     *** PERL_LIBS either contains a library not available on your system (such as
258     *** -lcrypt), or because it lacks a required library (e.g. -lsocket or -lnsl).
259     ***
260     *** You can provide your own flags by creating a ~/.staticperlrc file with
261     *** variable assignments. For example (these are the actual values used):
262     ***
263    
264     PERL_CC="$PERL_CC"
265     PERL_CCFLAGS="$PERL_CCFLAGS"
266     PERL_OPTIMIZE="$PERL_OPTIMIZE"
267     PERL_LDFLAGS="$PERL_LDFLAGS"
268     PERL_LIBS="$PERL_LIBS"
269    
270     EOF
271     exit 1
272     }
273    
274 root 1.1 configure() {
275     fetch
276    
277 root 1.62 rcd "$STATICPERL/src/perl"
278 root 1.1
279     [ -e staticstamp.configure ] && return
280    
281     verblock <<EOF
282 root 1.62 configuring $STATICPERL/src/perl
283 root 1.1 EOF
284    
285 root 1.8 rm -f "$PERL_PREFIX/staticstamp.install"
286 root 1.1
287 root 1.21 "$MAKE" distclean >/dev/null 2>&1
288 root 1.1
289 root 1.23 sedreplace '/^#define SITELIB/d' config_h.SH
290    
291     # I hate them for this
292 root 1.1 grep -q -- -fstack-protector Configure && \
293     sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure
294    
295 root 1.37 # what did that bloke think
296     grep -q -- usedl=.define hints/darwin.sh && \
297     sedreplace '/^usedl=.define.;$/d' hints/darwin.sh
298    
299     preconfigure || fatal "preconfigure hook failed"
300 root 1.7
301 root 1.1 # trace configure \
302     sh Configure -Duselargefiles \
303     -Uuse64bitint \
304     -Dusemymalloc=n \
305     -Uusedl \
306     -Uusethreads \
307     -Uuseithreads \
308     -Uusemultiplicity \
309     -Uusesfio \
310     -Uuseshrplib \
311 root 1.26 -Uinstallusrbinperl \
312 root 1.22 -A ccflags=" $PERL_CCFLAGS" \
313 root 1.19 -Dcc="$PERL_CC" \
314 root 1.1 -Doptimize="$PERL_OPTIMIZE" \
315     -Dldflags="$PERL_LDFLAGS" \
316     -Dlibs="$PERL_LIBS" \
317 root 1.6 -Dprefix="$PERL_PREFIX" \
318     -Dbin="$PERL_PREFIX/bin" \
319     -Dprivlib="$PERL_PREFIX/lib" \
320     -Darchlib="$PERL_PREFIX/lib" \
321 root 1.1 -Uusevendorprefix \
322 root 1.6 -Dsitelib="$PERL_PREFIX/lib" \
323     -Dsitearch="$PERL_PREFIX/lib" \
324 root 1.1 -Uman1dir \
325     -Uman3dir \
326     -Usiteman1dir \
327     -Usiteman3dir \
328     -Dpager=/usr/bin/less \
329     -Demail="$EMAIL" \
330     -Dcf_email="$EMAIL" \
331     -Dcf_by="$EMAIL" \
332 root 1.4 $PERL_CONFIGURE \
333 root 1.19 -Duseperlio \
334 root 1.22 -dE || configure_failure
335 root 1.1
336     sedreplace '
337     s/-Wl,--no-gc-sections/-Wl,--gc-sections/g
338     s/ *-fno-stack-protector */ /g
339     ' config.sh
340    
341 root 1.37 patchconfig || fatal "patchconfig hook failed"
342    
343 root 1.1 sh Configure -S || fatal "Configure -S failed"
344    
345     postconfigure || fatal "postconfigure hook failed"
346    
347 root 1.48 : > staticstamp.configure
348 root 1.1 }
349    
350 root 1.39 write_shellscript() {
351     {
352     echo "#!/bin/sh"
353     echo "STATICPERL=\"$STATICPERL\""
354     echo "PERL_PREFIX=\"$PERL_PREFIX\""
355     echo "MAKE=\"$MAKE\""
356     cat
357     } >"$PERL_PREFIX/bin/$1"
358     chmod 755 "$PERL_PREFIX/bin/$1"
359     }
360    
361 root 1.1 build() {
362     configure
363    
364 root 1.62 rcd "$STATICPERL/src/perl"
365 root 1.1
366     verblock <<EOF
367 root 1.62 building $STATICPERL/src/perl
368 root 1.1 EOF
369    
370 root 1.6 rm -f "$PERL_PREFIX/staticstamp.install"
371 root 1.1
372 root 1.21 "$MAKE" || fatal "make: error while building perl"
373 root 1.1
374     postbuild || fatal "postbuild hook failed"
375     }
376    
377 root 1.48 _postinstall() {
378     if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then
379     NOCHECK_INSTALL=+
380     instcpan $STATICPERL_MODULES
381 root 1.56 [ "$EXTRA_MODULES" ] && instcpan $EXTRA_MODULES
382 root 1.48
383     postinstall || fatal "postinstall hook failed"
384    
385     : > "$PERL_PREFIX/staticstamp.postinstall"
386     fi
387     }
388    
389 root 1.1 install() {
390 root 1.9 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
391     build
392 root 1.1
393 root 1.9 verblock <<EOF
394 root 1.62 installing $STATICPERL/src/perl
395 root 1.6 to $PERL_PREFIX
396 root 1.1 EOF
397    
398 root 1.14 ln -sf "perl/bin/" "$STATICPERL/bin"
399     ln -sf "perl/lib/" "$STATICPERL/lib"
400    
401 root 1.39 mkdir "$STATICPERL/patched"
402    
403 root 1.14 ln -sf "$PERL_PREFIX" "$STATICPERL/perl" # might get overwritten
404     rm -rf "$PERL_PREFIX" # by this rm -rf
405    
406 root 1.21 "$MAKE" install || fatal "make install: error while installing"
407 root 1.1
408 root 1.9 rcd "$PERL_PREFIX"
409 root 1.2
410 root 1.9 # create a "make install" replacement for CPAN
411 root 1.39 write_shellscript SP-make-install-make <<'EOF'
412     #CAT make-install-make.sh
413     EOF
414 root 1.10
415 root 1.39 # create a "patch modules" helper
416     write_shellscript SP-patch-postinstall <<'EOF'
417     #CAT patch-postinstall.sh
418     EOF
419 root 1.10
420 root 1.58 # immediately use it
421 root 1.39 "$PERL_PREFIX/bin/SP-patch-postinstall"
422 root 1.9
423 root 1.39 # help to trick CPAN into avoiding ~/.cpan completely
424 root 1.9 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
425 root 1.1
426 root 1.39 # we call cpan with -MCPAN::MyConfig in this script, which
427     # is strictly unnecssary as we have to patch CPAN anyway,
428     # so consider it "for good measure".
429 root 1.36 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e '
430 root 1.9 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
431     CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
432     CPAN::Shell->o (conf => q<init>);
433     CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
434     CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build");
435     CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs");
436     CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile");
437     CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources");
438 root 1.59 CPAN::Shell->o (conf => q<makepl_arg>, "MAP_TARGET=perl");
439 root 1.39 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/SP-make-install-make");
440 root 1.9 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>);
441 root 1.57 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<yes>);
442 root 1.36 CPAN::Shell->o (conf => q<prefer_installer>, "EUMM");
443 root 1.9 CPAN::Shell->o (conf => q<commit>);
444     ' || fatal "error while initialising CPAN"
445 root 1.2
446 root 1.48 : > "$PERL_PREFIX/staticstamp.install"
447 root 1.9 fi
448    
449 root 1.48 _postinstall
450     }
451    
452     import() {
453     IMPORT="$1"
454    
455     rcd "$STATICPERL"
456    
457     if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
458     verblock <<EOF
459     import perl from $IMPORT to $STATICPERL
460     EOF
461 root 1.1
462 root 1.48 rm -rf bin cpan lib patched perl src
463     mkdir -m 755 perl perl/bin
464     ln -s perl/bin/ bin
465     ln -s "$IMPORT" perl/bin/
466 root 1.1
467 root 1.51 echo "$IMPORT" > "$PERL_PREFIX/.import"
468    
469 root 1.48 : > "$PERL_PREFIX/staticstamp.install"
470 root 1.9 fi
471 root 1.48
472     _postinstall
473 root 1.1 }
474    
475     #############################################################################
476     # install a module from CPAN
477    
478     instcpan() {
479     [ $NOCHECK_INSTALL ] || install
480    
481     verblock <<EOF
482     installing modules from CPAN
483     $@
484     EOF
485    
486 root 1.51 MYCONFIG=
487     [ -e "$PERL_PREFIX/.import" ] || MYCONFIG=-MCPAN::MyConfig
488    
489     "$PERL_PREFIX"/bin/perl $MYCONFIG -MCPAN -e 'notest (install => $_) for @ARGV' -- "$@" | tee "$STATICPERL/instcpan.log"
490 root 1.48
491     if grep -q " -- NOT OK\$" "$STATICPERL/instcpan.log"; then
492     fatal "failure while installing modules from CPAN ($@)"
493     fi
494     rm -f "$STATICPERL/instcpan.log"
495 root 1.1 }
496    
497     #############################################################################
498     # install a module from unpacked sources
499    
500     instsrc() {
501     [ $NOCHECK_INSTALL ] || install
502    
503     verblock <<EOF
504     installing modules from source
505     $@
506     EOF
507    
508     for mod in "$@"; do
509     echo
510     echo $mod
511     (
512     rcd $mod
513 root 1.21 "$MAKE" -f Makefile.aperl map_clean >/dev/null 2>&1
514     "$MAKE" distclean >/dev/null 2>&1
515 root 1.6 "$PERL_PREFIX"/bin/perl Makefile.PL || fatal "$mod: error running Makefile.PL"
516 root 1.21 "$MAKE" || fatal "$mod: error building module"
517 root 1.39 "$PERL_PREFIX"/bin/SP-make-install-make install || fatal "$mod: error installing module"
518 root 1.21 "$MAKE" distclean >/dev/null 2>&1
519 root 1.1 exit 0
520     ) || exit $?
521     done
522     }
523    
524     #############################################################################
525     # main
526    
527     podusage() {
528     echo
529 root 1.17
530 root 1.6 if [ -e "$PERL_PREFIX/bin/perl" ]; then
531     "$PERL_PREFIX/bin/perl" -MPod::Usage -e \
532 root 1.1 'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \
533     2>/dev/null && exit
534     fi
535 root 1.17
536 root 1.1 # try whatever perl we can find
537     perl -MPod::Usage -e \
538     'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \
539     2>/dev/null && exit
540    
541 root 1.17 fatal "displaying documentation requires a working perl - try '$0 install' to build one in a safe location"
542 root 1.1 }
543    
544     usage() {
545     podusage 0
546     }
547    
548     catmkbundle() {
549     {
550     read dummy
551 root 1.6 echo "#!$PERL_PREFIX/bin/perl"
552 root 1.1 cat
553     } <<'MKBUNDLE'
554     #CAT mkbundle
555     MKBUNDLE
556     }
557    
558     bundle() {
559 root 1.39 MKBUNDLE="${MKBUNDLE:=$PERL_PREFIX/bin/SP-mkbundle}"
560 root 1.1 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create"
561     chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE"
562 root 1.12 CACHE="$STATICPERL/cache"
563     mkdir -p "$CACHE"
564     "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@"
565 root 1.1 }
566    
567     if [ $# -gt 0 ]; then
568     while [ $# -gt 0 ]; do
569     mkdir -p "$STATICPERL" || fatal "$STATICPERL: cannot create"
570 root 1.6 mkdir -p "$PERL_PREFIX" || fatal "$PERL_PREFIX: cannot create"
571 root 1.1
572     command="${1#--}"; shift
573     case "$command" in
574 root 1.14 version )
575     echo "staticperl version $VERSION"
576     ;;
577 root 1.48 fetch | configure | build | install | clean | realclean | distclean )
578 root 1.22 ( "$command" ) || exit
579 root 1.1 ;;
580 root 1.48 import )
581     ( import "$1" ) || exit
582     shift
583     ;;
584 root 1.1 instsrc )
585 root 1.22 ( instsrc "$@" ) || exit
586 root 1.1 exit
587     ;;
588     instcpan )
589 root 1.22 ( instcpan "$@" ) || exit
590 root 1.1 exit
591     ;;
592 root 1.39 perl )
593     ( install ) || exit
594     exec "$PERL_PREFIX/bin/perl" "$@"
595     exit
596     ;;
597 root 1.1 cpan )
598 root 1.22 ( install ) || exit
599 root 1.48 PERL="$PERL_PREFIX/bin/perl"
600     export PERL
601 root 1.39 exec "$PERL_PREFIX/bin/cpan" "$@"
602 root 1.1 exit
603     ;;
604     mkbundle )
605 root 1.22 ( install ) || exit
606 root 1.40 bundle "$@"
607 root 1.1 exit
608     ;;
609     mkperl )
610 root 1.22 ( install ) || exit
611 root 1.40 bundle --perl "$@"
612 root 1.1 exit
613     ;;
614 root 1.11 mkapp )
615 root 1.22 ( install ) || exit
616 root 1.40 bundle --app "$@"
617 root 1.11 exit
618     ;;
619 root 1.1 help )
620     podusage 2
621     ;;
622     * )
623     exec 1>&2
624     echo
625     echo "Unknown command: $command"
626     podusage 0
627     ;;
628     esac
629     done
630     else
631     usage
632     fi
633    
634     exit 0
635    
636     #CAT staticperl.pod
637