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.25 by root, Tue Dec 28 18:03:47 2010 UTC vs.
Revision 1.36 by root, Sun Mar 13 23:20:21 2011 UTC

7CPAN=http://mirror.netcologne.de/cpan # which mirror to use 7CPAN=http://mirror.netcologne.de/cpan # which mirror to use
8EMAIL="read the documentation <rtfm@example.org>" 8EMAIL="read the documentation <rtfm@example.org>"
9 9
10# perl build variables 10# perl build variables
11MAKE=make 11MAKE=make
12PERL_VERSION=5.12.2 # 5.8.9 is also a good choice 12PERL_VERSION=5.12.3 # 5.8.9 is also a good choice
13PERL_CC=cc 13PERL_CC=cc
14PERL_CONFIGURE="" # additional Configure arguments 14PERL_CONFIGURE="" # additional Configure arguments
15PERL_CCFLAGS="-DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=65536 -D_GNU_SOURCE -DNDEBUG" 15PERL_CCFLAGS="-g -DPERL_DISABLE_PMC -DPERL_ARENA_SIZE=16376 -DNO_PERL_MALLOC_ENV -D_GNU_SOURCE -DNDEBUG"
16PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math" 16PERL_OPTIMIZE="-Os -ffunction-sections -fdata-sections -finline-limit=8 -ffast-math"
17 17
18ARCH="$(uname -m)" 18ARCH="$(uname -m)"
19 19
20case "$ARCH" in 20case "$ARCH" in
71unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG 71unset PERL5OPT PERL5LIB PERLLIB PERL_UNICODE PERLIO_DEBUG
72LC_ALL=C; export LC_ALL # just to be on the safe side 72LC_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
75VERSION=VERSION; eval \ 75VERSION=VERSION; eval \
76$VERSION=0.92 76$VERSION="1.2"
77 77
78BZ2=bz2 78BZ2=bz2
79BZIP2=bzip2 79BZIP2=bzip2
80 80
81fatal() { 81fatal() {
165unpacking perl 165unpacking perl
166EOF 166EOF
167 167
168 mkdir -p unpack 168 mkdir -p unpack
169 rm -rf unpack/perl-$PERL_VERSION 169 rm -rf unpack/perl-$PERL_VERSION
170 $BZIP2 -d <perl-$PERL_VERSION.tar.bz2 | tar xfC - unpack \ 170 $BZIP2 -d <perl-$PERL_VERSION.tar.$BZ2 | ( cd unpack && tar x ) \
171 || fatal "perl-$PERL_VERSION.tar.bz2: error during unpacking" 171 || fatal "perl-$PERL_VERSION.tar.$BZ2: error during unpacking"
172 chmod -R u+w unpack/perl-$PERL_VERSION 172 chmod -R u+w unpack/perl-$PERL_VERSION
173 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION 173 mv unpack/perl-$PERL_VERSION perl-$PERL_VERSION
174 rmdir -p unpack 174 rmdir -p unpack
175 fi 175 fi
176} 176}
239 -Uusethreads \ 239 -Uusethreads \
240 -Uuseithreads \ 240 -Uuseithreads \
241 -Uusemultiplicity \ 241 -Uusemultiplicity \
242 -Uusesfio \ 242 -Uusesfio \
243 -Uuseshrplib \ 243 -Uuseshrplib \
244 -Uinstallusrbinperl \
244 -A ccflags=" $PERL_CCFLAGS" \ 245 -A ccflags=" $PERL_CCFLAGS" \
245 -Dcc="$PERL_CC" \ 246 -Dcc="$PERL_CC" \
246 -Doptimize="$PERL_OPTIMIZE" \ 247 -Doptimize="$PERL_OPTIMIZE" \
247 -Dldflags="$PERL_LDFLAGS" \ 248 -Dldflags="$PERL_LDFLAGS" \
248 -Dlibs="$PERL_LIBS" \ 249 -Dlibs="$PERL_LIBS" \
314 315
315 # create a "make install" replacement for CPAN 316 # create a "make install" replacement for CPAN
316 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF 317 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF
317"$MAKE" || exit 318"$MAKE" || exit
318 319
320# patch CPAN::HandleConfig.pm
321HCPM="$PERL_PREFIX"/lib/CPAN/HandleConfig.pm
322case "\$(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 ;;
334esac
335
319if find blib/arch/auto -type f | grep -q -v .exists; then 336if find blib/arch/auto -type f | grep -q -v .exists; then
320 echo Probably an XS module, rebuilding perl 337 echo Probably an XS module, rebuilding perl
321 if "$MAKE" perl; then 338 if "$MAKE" perl; then
322 mv perl "$PERL_PREFIX"/bin/perl~ \ 339 mv perl "$PERL_PREFIX"/bin/perl~ \
323 && rm -f "$PERL_PREFIX"/bin/perl \ 340 && rm -f "$PERL_PREFIX"/bin/perl \
334 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install 351 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install
335 352
336 # trick CPAN into avoiding ~/.cpan completely 353 # trick CPAN into avoiding ~/.cpan completely
337 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" 354 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
338 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
339 "$PERL_PREFIX"/bin/perl -MCPAN -e ' 360 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e '
340 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); 361 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
341 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 362 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
342 CPAN::Shell->o (conf => q<init>); 363 CPAN::Shell->o (conf => q<init>);
343 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 364 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
344 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); 365 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build");
346 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile"); 367 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile");
347 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources"); 368 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources");
348 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");
349 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); 370 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>);
350 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");
351 CPAN::Shell->o (conf => q<commit>); 373 CPAN::Shell->o (conf => q<commit>);
352 ' || fatal "error while initialising CPAN" 374 ' || fatal "error while initialising CPAN"
353 375
354 touch "$PERL_PREFIX/staticstamp.install" 376 touch "$PERL_PREFIX/staticstamp.install"
355 fi 377 fi
375installing modules from CPAN 397installing modules from CPAN
376$@ 398$@
377EOF 399EOF
378 400
379 for mod in "$@"; do 401 for mod in "$@"; do
380 "$PERL_PREFIX"/bin/perl -MCPAN -e 'notest install => "'"$mod"'"' \ 402 "$PERL_PREFIX"/bin/perl -MCPAN::MyConfig -MCPAN -e 'notest install => "'"$mod"'"' \
381 || fatal "$mod: unable to install from CPAN" 403 || fatal "$mod: unable to install from CPAN"
382 done 404 done
383 rm -rf "$STATICPERL/build" 405 rm -rf "$STATICPERL/build"
384} 406}
385 407

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines