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.8 by root, Tue Dec 7 19:55:56 2010 UTC vs.
Revision 1.11 by root, Wed Dec 8 22:27:35 2010 UTC

61############################################################################# 61#############################################################################
62# support 62# support
63 63
64# set version in a way that Makefile.PL can extract 64# set version in a way that Makefile.PL can extract
65VERSION=VERSION; eval \ 65VERSION=VERSION; eval \
66$VERSION=0.1 66$VERSION=0.9
67 67
68BZ2=bz2 68BZ2=bz2
69BZIP2=bzip2 69BZIP2=bzip2
70 70
71fatal() { 71fatal() {
246 246
247 postbuild || fatal "postbuild hook failed" 247 postbuild || fatal "postbuild hook failed"
248} 248}
249 249
250install() { 250install() {
251 [ -e "$PERL_PREFIX/staticstamp.install" ] && return 251 if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then
252
253 build 252 build
254 253
255 verblock <<EOF 254 verblock <<EOF
256installing $STATICPERL/src/perl-$PERL_VERSION 255installing $STATICPERL/src/perl-$PERL_VERSION
257to $PERL_PREFIX 256to $PERL_PREFIX
258EOF 257EOF
259 258
260 rm -rf "$PERL_PREFIX" 259 rm -rf "$PERL_PREFIX"
261 260
262 make install || fatal "make install: error while installing" 261 make install || fatal "make install: error while installing"
263 262
264 rcd "$PERL_PREFIX" 263 rcd "$PERL_PREFIX"
265 264
266 # create a "make install" replacement for CPAN 265 # create a "make install" replacement for CPAN
267 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF 266 cat >"$PERL_PREFIX"/bin/cpan-make-install <<EOF
268make install UNINST=1 267make || exit
268
269if find blib/arch/auto -type f | grep -q -v .exists; then 269if find blib/arch/auto -type f | grep -q -v .exists; then
270 echo Probably an XS module, rebuilding perl 270 echo Probably an XS module, rebuilding perl
271 make perl 271 if make perl; then
272 rm -f "$PERL_PREFIX"/bin/perl 272 mv perl "$PERL_PREFIX"/bin/perl
273 make -f Makefile.aperl inst_perl
274 make -f Makefile.aperl map_clean 273 make -f Makefile.aperl map_clean
274 else
275 make -f Makefile.aperl map_clean
276 exit 1
277 fi
275fi 278fi
279
280make install UNINST=1
276EOF 281EOF
277 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install 282 chmod 755 "$PERL_PREFIX"/bin/cpan-make-install
278 283
279 # trick CPAN into avoiding ~/.cpan completely 284 # trick CPAN into avoiding ~/.cpan completely
280 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm" 285 echo 1 >"$PERL_PREFIX/lib/CPAN/MyConfig.pm"
281 286
282 "$PERL_PREFIX"/bin/perl -MCPAN -e ' 287 "$PERL_PREFIX"/bin/perl -MCPAN -e '
283 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'"); 288 CPAN::Shell->o (conf => urllist => push => "'"$CPAN"'");
284 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 289 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
285 CPAN::Shell->o (conf => q<init>); 290 CPAN::Shell->o (conf => q<init>);
286 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan"); 291 CPAN::Shell->o (conf => q<cpan_home>, "'"$STATICPERL"'/cpan");
287 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build"); 292 CPAN::Shell->o (conf => q<build_dir>, "'"$STATICPERL"'/cpan/build");
288 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs"); 293 CPAN::Shell->o (conf => q<prefs_dir>, "'"$STATICPERL"'/cpan/prefs");
289 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile"); 294 CPAN::Shell->o (conf => q<histfile> , "'"$STATICPERL"'/cpan/histfile");
290 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources"); 295 CPAN::Shell->o (conf => q<keep_source_where>, "'"$STATICPERL"'/cpan/sources");
291 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/cpan-make-install"); 296 CPAN::Shell->o (conf => q<make_install_make_command>, "'"$PERL_PREFIX"'/bin/cpan-make-install");
292 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>); 297 CPAN::Shell->o (conf => q<prerequisites_policy>, q<follow>);
293 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>); 298 CPAN::Shell->o (conf => q<build_requires_install_policy>, q<no>);
294 CPAN::Shell->o (conf => q<commit>); 299 CPAN::Shell->o (conf => q<commit>);
295 ' || fatal "error while initialising CPAN" 300 ' || fatal "error while initialising CPAN"
296 301
302 touch "$PERL_PREFIX/staticstamp.install"
303 fi
304
305 if ! [ -e "$PERL_PREFIX/staticstamp.postinstall" ]; then
297 NOCHECK_INSTALL=+ 306 NOCHECK_INSTALL=+
298 instcpan $STATICPERL_MODULES 307 instcpan $STATICPERL_MODULES
299 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES 308 [ $EXTRA_MODULES ] && instcpan $EXTRA_MODULES
300 309
301 postinstall || fatal "postinstall hook failed" 310 postinstall || fatal "postinstall hook failed"
302 311
303 touch "$PERL_PREFIX/staticstamp.install" 312 touch "$PERL_PREFIX/staticstamp.postinstall"
313 fi
304} 314}
305 315
306############################################################################# 316#############################################################################
307# install a module from CPAN 317# install a module from CPAN
308 318
420 mkperl ) 430 mkperl )
421 ( install ) 431 ( install )
422 bundle --perl "$@" 432 bundle --perl "$@"
423 exit 433 exit
424 ;; 434 ;;
435 mkapp )
436 ( install )
437 bundle --app "$@"
438 exit
439 ;;
425 help ) 440 help )
426 podusage 2 441 podusage 2
427 ;; 442 ;;
428 * ) 443 * )
429 exec 1>&2 444 exec 1>&2

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines