home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-perl-addon-1.4.9-installer.exe / getsqlite.pl < prev    next >
Encoding:
Perl Script  |  2003-12-05  |  1.0 KB  |  53 lines

  1. use strict;
  2. use LWP::Simple qw(getstore);
  3. use Fatal qw(chdir);
  4. use ExtUtils::Command;
  5.  
  6. my $version = shift || die "Usage: getsqlite.pl <version>\n";
  7.  
  8. print("downloading http://www.sqlite.org/sqlite-$version.tar.gz\n");
  9. if (getstore(
  10.     "http://www.sqlite.org/sqlite-$version.tar.gz", 
  11.     "sqlite.tar.gz") != 200) {
  12.    die "Failed to download";
  13. }
  14. print("done\n");
  15.  
  16. rm_rf('sqlite');
  17. xsystem("tar zxvf sqlite.tar.gz");
  18. chdir("sqlite");
  19. xsystem("sh configure --enable-utf8");
  20. xsystem("make parse.c sqlite.h opcodes.h opcodes.c");
  21.  
  22. my %skip = map { $_ => 1 } map { chomp; $_ } <DATA>;
  23. warn("Skip: $_\n") for keys %skip;
  24.  
  25. foreach (<*.[ch]>, `find src -name \\*.[ch]`) {
  26.     chomp;
  27.     next if $skip{$_};
  28.     xsystem("cp $_ ../");
  29. }
  30.  
  31. exit(0);
  32.  
  33. sub xsystem {
  34.     local $, = ", ";
  35.     print("@_\n");
  36.     my $ret = system(@_);
  37.     if ($ret != 0) {
  38.        die "system(@_) failed: $?";
  39.     }
  40. }
  41.  
  42. __DATA__
  43. lempar.c
  44. src/threadtest.c
  45. src/test1.c
  46. src/test2.c
  47. src/test3.c
  48. src/tclsqlite.c
  49. src/shell.c
  50. src/lemon.c
  51. src/md5.c
  52.  
  53.