#! /usr/bin/env perl # # This is a self-extracting tar.gz file. # Usage: # perl name_of_this_file # # The perl header of this file is # # Copyright (c) 2003 The Regents of the University of California # through E.O. Lawrence Berkeley National Laboratory, subject to # approval by the U.S. Department of Energy. # # and was written in May 2003 by Ralf W. Grosse-Kunstleve. # See also: # http://cctbx.svn.sourceforge.net/viewvc/*checkout*/cctbx/trunk/libtbx/LICENSE_2_0.txt # # The above copyright notice does *not* apply to the attached tar.gz file. # print "Unpacking self-extracting archive\n"; $my_size = -s $0; open(SELF,"<$0") or die "ERROR: Cannot read self-extracting archive!\n"; binmode SELF; $last_seven = "0000000"; $n_end = 0; $n_header = 0; while ($n_header < $my_size && $n_end < 2) { $n_header++; $ch = getc(SELF); $last_seven = substr($last_seven, 1, 6) . $ch; if ($last_seven eq "__END__") { $n_end += 1; } } while ($n_header < $my_size && $ch ne "@") { $n_header++; $ch = getc(SELF); } if ($n_header == $my_size) { die "ERROR: Corrupt self-extracting archive!\n"; } open(TAR_PIPE, "|gunzip -c | tar xf -"); binmode TAR_PIPE; while (read(SELF, $buf, 1000000) != 0) { syswrite(TAR_PIPE, $buf, length($buf)); } close(TAR_PIPE); $cmd = join(" ", ("./cctbx_install_script.csh", @ARGV)); print "Running command: $cmd\n"; system("$cmd"); __END__ @ ?gJ ;oF@A!ʑeYv;u\6M]#N8v,$6rH5Pbݴ9nU43|~nX{ş_=zǓWw<_|qz:lrqv~qt29;B=si*[B/-@s-'-_N61;wt<8?Am_45