ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.sh
Revision: 1.62
Committed: Fri Oct 16 01:52:08 2015 UTC (10 years, 11 months ago) by root
Content type: application/x-sh
Branch: MAIN
Changes since 1.61: +54 -29 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     case "$PERL_VERSION" in
158     *:* )
159     # assume url
160     PERLURL="$PERL_VERSION"
161     PERLTAR="$(basename "$PERL_VERSION")"
162     ;;
163     * )
164     PERLURL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.bz2"
165     PERLTAR=perl-$PERL_VERSION.tar.bz2
166     ;;
167     esac
168 root 1.1
169 root 1.62 if ! [ -e "$PERLTAR" ]; then
170 root 1.1 verblock <<EOF
171     downloading perl
172 root 1.42
173 root 1.62 trying to download from $PERLURL
174 root 1.45
175     you can configure a download cache directory via DLCACHE
176     in your .staticperlrc to avoid repeated downloads.
177 root 1.62
178     to manually download perl yourself, place a suitable tarball in
179     $DLCACHE/$PERLTAR
180    
181     either curl or wget is required for automatic download.
182     curl is tried first, then wget.
183 root 1.1 EOF
184    
185 root 1.45 rm -f $PERLTAR~ # just to be on the safe side
186 root 1.48 { [ "$DLCACHE" ] && cp "$DLCACHE"/$PERLTAR $PERLTAR~ >/dev/null 2>&1; } \
187 root 1.62 || wget -O $PERLTAR~ "$PERLURL" \
188     || curl -f >$PERLTAR~ "$PERLURL" \
189 root 1.5 || fatal "$URL: unable to download"
190 root 1.45 rm -f $PERLTAR
191     mv $PERLTAR~ $PERLTAR
192     if [ "$DLCACHE" ]; then
193     mkdir -p "$DLCACHE"
194 root 1.57 cp $PERLTAR "$DLCACHE"/$PERLTAR~$$~ && \
195     mv "$DLCACHE"/$PERLTAR~$$~ "$DLCACHE"/$PERLTAR
196 root 1.45 fi
197 root 1.1 fi
198    
199     verblock <<EOF
200     unpacking perl
201     EOF
202    
203 root 1.62 rm -rf unpack
204 root 1.1 mkdir -p unpack
205 root 1.62
206     case "$PERLTAR" in
207     *.xz ) UNCOMPRESS="xz -d" ;;
208     *.lzma ) UNCOMPRESS="lzma -d" ;;
209     *.bz2 ) UNCOMPRESS="bzip2 -d" ;;
210     *.gz ) UNCOMPRESS="gzip -d" ;;
211     *.tar ) UNCOMPRESS="cat" ;;
212     * )
213     fatal "don't know hot to uncompress $PERL_TAR,\nonly tar, tar.gz, tar.bz2, tar.lzma and tar.xz are supported."
214     exit 1
215     ;;
216     esac
217    
218     <"$PERLTAR" $UNCOMPRESS -d | ( cd unpack && tar xf - ) \
219 root 1.45 || fatal "$PERLTAR: error during unpacking"
220 root 1.62
221     if [ -d unpack/*/ ]; then
222     chmod -R u+w unpack/*/
223     mv unpack/*/ perl
224     rmdir -p unpack
225     else
226     fatal "unpacking $PERLTAR did not result in a single directory, don't know how to handle this"
227     fi
228    
229     rm "$PERLTAR"
230 root 1.1 fi
231     }
232    
233     # similar to GNU-sed -i or perl -pi
234     sedreplace() {
235     sed -e "$1" <"$2" > "$2~" || fatal "error while running sed"
236 root 1.20 rm -f "$2"
237 root 1.1 mv "$2~" "$2"
238     }
239    
240 root 1.22 configure_failure() {
241     cat <<EOF
242    
243    
244     ***
245     *** Configure failed - see above for the exact error message(s).
246     ***
247     *** Most commonly, this is because the default PERL_CCFLAGS or PERL_OPTIMIZE
248     *** flags are not supported by your compiler. Less often, this is because
249     *** PERL_LIBS either contains a library not available on your system (such as
250     *** -lcrypt), or because it lacks a required library (e.g. -lsocket or -lnsl).
251     ***
252     *** You can provide your own flags by creating a ~/.staticperlrc file with
253     *** variable assignments. For example (these are the actual values used):
254     ***
255    
256     PERL_CC="$PERL_CC"
257     PERL_CCFLAGS="$PERL_CCFLAGS"
258     PERL_OPTIMIZE="$PERL_OPTIMIZE"
259     PERL_LDFLAGS="$PERL_LDFLAGS"
260     PERL_LIBS="$PERL_LIBS"
261    
262     EOF
263     exit 1
264     }
265    
266 root 1.1 configure() {
267     fetch
268    
269 root 1.62 rcd "$STATICPERL/src/perl"
270 root 1.1
271     [ -e staticstamp.configure ] && return
272    
273     verblock <<EOF
274 root 1.62 configuring $STATICPERL/src/perl
275 root 1.1 EOF
276    
277 root 1.8 rm -f "$PERL_PREFIX/staticstamp.install"
278 root 1.1
279 root 1.21 "$MAKE" distclean >/dev/null 2>&1
280 root 1.1
281 root 1.23 sedreplace '/^#define SITELIB/d' config_h.SH
282    
283     # I hate them for this
284 root 1.1 grep -q -- -fstack-protector Configure && \
285     sedreplace 's/-fstack-protector/-fno-stack-protector/g' Configure
286    
287 root 1.37 # what did that bloke think
288     grep -q -- usedl=.define hints/darwin.sh && \
289     sedreplace '/^usedl=.define.;$/d' hints/darwin.sh
290    
291     preconfigure || fatal "preconfigure hook failed"
292 root 1.7
293 root 1.1 # trace configure \
294     sh Configure -Duselargefiles \
295     -Uuse64bitint \
296     -Dusemymalloc=n \
297     -Uusedl \
298     -Uusethreads \
299     -Uuseithreads \
300     -Uusemultiplicity \
301     -Uusesfio \
302     -Uuseshrplib \
303 root 1.26 -Uinstallusrbinperl \
304 root 1.22 -A ccflags=" $PERL_CCFLAGS" \
305 root 1.19 -Dcc="$PERL_CC" \
306 root 1.1 -Doptimize="$PERL_OPTIMIZE" \
307     -Dldflags="$PERL_LDFLAGS" \
308     -Dlibs="$PERL_LIBS" \
309 root 1.6 -Dprefix="$PERL_PREFIX" \
310     -Dbin="$PERL_PREFIX/bin" \
311     -Dprivlib="$PERL_PREFIX/lib" \
312     -Darchlib="$PERL_PREFIX/lib" \
313 root 1.1 -Uusevendorprefix \
314 root 1.6 -Dsitelib="$PERL_PREFIX/lib" \
315     -Dsitearch="$PERL_PREFIX/lib" \
316 root 1.1 -Uman1dir \
317     -Uman3dir \
318     -Usiteman1dir \
319     -Usiteman3dir \
320     -Dpager=/usr/bin/less \
321     -Demail="$EMAIL" \
322     -Dcf_email="$EMAIL" \
323     -Dcf_by="$EMAIL" \
324 root 1.4 $PERL_CONFIGURE \
325 root 1.19 -Duseperlio \
326 root 1.22 -dE || configure_failure
327 root 1.1
328     sedreplace '
329     s/-Wl,--no-gc-sections/-Wl,--gc-sections/g
330     s/ *-fno-stack-protector */ /g
331     ' config.sh
332    
333 root 1.37 patchconfig || fatal "patchconfig hook failed"
334    
335 root 1.1 sh Configure -S || fatal "Configure -S failed"
336    
337     postconfigure || fatal "postconfigure hook failed"
338    
339 root 1.48 : > staticstamp.configure
340 root 1.1 }
341    
342 root 1.39 write_shellscript() {
343     {
344     echo "#!/bin/sh"
345     echo "STATICPERL=\"$STATICPERL\""
346     echo "PERL_PREFIX=\"$PERL_PREFIX\""
347     echo "MAKE=\"$MAKE\""
348     cat
349     } >"$PERL_PREFIX/bin/$1"
350     chmod 755 "$PERL_PREFIX/bin/$1"
351     }
352    
353 root 1.1 build() {
354     configure
355    
356 root 1.62 rcd "$STATICPERL/src/perl"
357 root 1.1
358     verblock <<EOF
359 root 1.62 building $STATICPERL/src/perl
360 root 1.1 EOF
361    
362 root 1.6 rm -f "$PERL_PREFIX/staticstamp.install"
363 root 1.1
364 root 1.21 "$MAKE" || fatal "make: error while building perl"
365 root 1.1
366     postbuild || fatal "postbuild hook failed"
367     }
368    
369 root 1.48 _postinstall() {
370     if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then
371     NOCHECK_INSTALL=+
372     instcpan $STATICPERL_MODULES
373 root 1.56 [ "$EXTRA_MODULES" ] && instcpan $EXTRA_MODULES
374 root 1.48
375     postinstall || fatal "postinstall hook failed"
376    
377     : > "$PERL_PREFIX/staticstamp.postinstall"
378     fi
379     }
380    
381 root 1.1 install() {
382 root 1.9 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
383     build
384 root 1.1
385 root 1.9 verblock <<EOF
386 root 1.62 installing $STATICPERL/src/perl
387 root 1.6 to $PERL_PREFIX
388 root 1.1 EOF
389    
390 root 1.14 ln -sf "perl/bin/" "$STATICPERL/bin"
391     ln -sf "perl/lib/" "$STATICPERL/lib"
392    
393 root 1.39 mkdir "$STATICPERL/patched"
394    
395 root 1.14 ln -sf "$PERL_PREFIX" "$STATICPERL/perl" # might get overwritten
396     rm -rf "$PERL_PREFIX" # by this rm -rf
397    
398 root 1.21 "$MAKE" install || fatal "make install: error while installing"
399 root 1.1
400 root 1.9 rcd "$PERL_PREFIX"
401 root 1.2
402 root 1.9 # create a "make install" replacement for CPAN
403 root 1.39 write_shellscript SP-make-install-make <<'EOF'
404     #CAT make-install-make.sh
405     EOF
406 root 1.10
407 root 1.39 # create a "patch modules" helper
408     write_shellscript SP-patch-postinstall <<'EOF'
409     #CAT patch-postinstall.sh
410     EOF
411 root 1.10
412 root 1.58 # immediately use it
413 root 1.39 "$PERL_PREFIX/bin/SP-patch-postinstall"
414 root 1.9
415 root 1.39 # help to trick CPAN into avoiding ~/.cpan completely
416 root 1.9 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
417 root 1.1
418 root 1.39 # we call cpan with -MCPAN::MyConfig in this script, which
419     # is strictly unnecssary as we have to patch CPAN anyway,
420     # so consider it "for good measure".
421 root 1.36 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e '
422 root 1.9 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
423     CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
424     CPAN::Shell->o (conf => q<init>);
425     CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
426     CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build");
427     CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs");
428     CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile");
429     CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources");
430 root 1.59 CPAN::Shell->o (conf => q<makepl_arg>, "MAP_TARGET=perl");
431 root 1.39 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/SP-make-install-make");
432 root 1.9 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>);
433 root 1.57 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<yes>);
434 root 1.36 CPAN::Shell->o (conf => q<prefer_installer>, "EUMM");
435 root 1.9 CPAN::Shell->o (conf => q<commit>);
436     ' || fatal "error while initialising CPAN"
437 root 1.2
438 root 1.48 : > "$PERL_PREFIX/staticstamp.install"
439 root 1.9 fi
440    
441 root 1.48 _postinstall
442     }
443    
444     import() {
445     IMPORT="$1"
446    
447     rcd "$STATICPERL"
448    
449     if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
450     verblock <<EOF
451     import perl from $IMPORT to $STATICPERL
452     EOF
453 root 1.1
454 root 1.48 rm -rf bin cpan lib patched perl src
455     mkdir -m 755 perl perl/bin
456     ln -s perl/bin/ bin
457     ln -s "$IMPORT" perl/bin/
458 root 1.1
459 root 1.51 echo "$IMPORT" > "$PERL_PREFIX/.import"
460    
461 root 1.48 : > "$PERL_PREFIX/staticstamp.install"
462 root 1.9 fi
463 root 1.48
464     _postinstall
465 root 1.1 }
466    
467     #############################################################################
468     # install a module from CPAN
469    
470     instcpan() {
471     [ $NOCHECK_INSTALL ] || install
472    
473     verblock <<EOF
474     installing modules from CPAN
475     $@
476     EOF
477    
478 root 1.51 MYCONFIG=
479     [ -e "$PERL_PREFIX/.import" ] || MYCONFIG=-MCPAN::MyConfig
480    
481     "$PERL_PREFIX"/bin/perl $MYCONFIG -MCPAN -e 'notest (install => $_) for @ARGV' -- "$@" | tee "$STATICPERL/instcpan.log"
482 root 1.48
483     if grep -q " -- NOT OK\$" "$STATICPERL/instcpan.log"; then
484     fatal "failure while installing modules from CPAN ($@)"
485     fi
486     rm -f "$STATICPERL/instcpan.log"
487 root 1.1 }
488    
489     #############################################################################
490     # install a module from unpacked sources
491    
492     instsrc() {
493     [ $NOCHECK_INSTALL ] || install
494    
495     verblock <<EOF
496     installing modules from source
497     $@
498     EOF
499    
500     for mod in "$@"; do
501     echo
502     echo $mod
503     (
504     rcd $mod
505 root 1.21 "$MAKE" -f Makefile.aperl map_clean >/dev/null 2>&1
506     "$MAKE" distclean >/dev/null 2>&1
507 root 1.6 "$PERL_PREFIX"/bin/perl Makefile.PL || fatal "$mod: error running Makefile.PL"
508 root 1.21 "$MAKE" || fatal "$mod: error building module"
509 root 1.39 "$PERL_PREFIX"/bin/SP-make-install-make install || fatal "$mod: error installing module"
510 root 1.21 "$MAKE" distclean >/dev/null 2>&1
511 root 1.1 exit 0
512     ) || exit $?
513     done
514     }
515    
516     #############################################################################
517     # main
518    
519     podusage() {
520     echo
521 root 1.17
522 root 1.6 if [ -e "$PERL_PREFIX/bin/perl" ]; then
523     "$PERL_PREFIX/bin/perl" -MPod::Usage -e \
524 root 1.1 'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \
525     2>/dev/null && exit
526     fi
527 root 1.17
528 root 1.1 # try whatever perl we can find
529     perl -MPod::Usage -e \
530     'pod2usage -input => *STDIN, -output => *STDOUT, -verbose => '$1', -exitval => 0, -noperldoc => 1' <"$0" \
531     2>/dev/null && exit
532    
533 root 1.17 fatal "displaying documentation requires a working perl - try '$0 install' to build one in a safe location"
534 root 1.1 }
535    
536     usage() {
537     podusage 0
538     }
539    
540     catmkbundle() {
541     {
542     read dummy
543 root 1.6 echo "#!$PERL_PREFIX/bin/perl"
544 root 1.1 cat
545     } <<'MKBUNDLE'
546     #CAT mkbundle
547     MKBUNDLE
548     }
549    
550     bundle() {
551 root 1.39 MKBUNDLE="${MKBUNDLE:=$PERL_PREFIX/bin/SP-mkbundle}"
552 root 1.1 catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create"
553     chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE"
554 root 1.12 CACHE="$STATICPERL/cache"
555     mkdir -p "$CACHE"
556     "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@"
557 root 1.1 }
558    
559     if [ $# -gt 0 ]; then
560     while [ $# -gt 0 ]; do
561     mkdir -p "$STATICPERL" || fatal "$STATICPERL: cannot create"
562 root 1.6 mkdir -p "$PERL_PREFIX" || fatal "$PERL_PREFIX: cannot create"
563 root 1.1
564     command="${1#--}"; shift
565     case "$command" in
566 root 1.14 version )
567     echo "staticperl version $VERSION"
568     ;;
569 root 1.48 fetch | configure | build | install | clean | realclean | distclean )
570 root 1.22 ( "$command" ) || exit
571 root 1.1 ;;
572 root 1.48 import )
573     ( import "$1" ) || exit
574     shift
575     ;;
576 root 1.1 instsrc )
577 root 1.22 ( instsrc "$@" ) || exit
578 root 1.1 exit
579     ;;
580     instcpan )
581 root 1.22 ( instcpan "$@" ) || exit
582 root 1.1 exit
583     ;;
584 root 1.39 perl )
585     ( install ) || exit
586     exec "$PERL_PREFIX/bin/perl" "$@"
587     exit
588     ;;
589 root 1.1 cpan )
590 root 1.22 ( install ) || exit
591 root 1.48 PERL="$PERL_PREFIX/bin/perl"
592     export PERL
593 root 1.39 exec "$PERL_PREFIX/bin/cpan" "$@"
594 root 1.1 exit
595     ;;
596     mkbundle )
597 root 1.22 ( install ) || exit
598 root 1.40 bundle "$@"
599 root 1.1 exit
600     ;;
601     mkperl )
602 root 1.22 ( install ) || exit
603 root 1.40 bundle --perl "$@"
604 root 1.1 exit
605     ;;
606 root 1.11 mkapp )
607 root 1.22 ( install ) || exit
608 root 1.40 bundle --app "$@"
609 root 1.11 exit
610     ;;
611 root 1.1 help )
612     podusage 2
613     ;;
614     * )
615     exec 1>&2
616     echo
617     echo "Unknown command: $command"
618     podusage 0
619     ;;
620     esac
621     done
622     else
623     usage
624     fi
625    
626     exit 0
627    
628     #CAT staticperl.pod
629