[Bio] / FigCommon / env.mac-tiger.pl Repository:
ViewVC logotype

View of /FigCommon/env.mac-tiger.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Thu May 5 20:51:44 2005 UTC (15 years, 2 months ago) by olson
Branch: MAIN
CVS Tags: merge-trunktag-bobdev_news-2, Root-bobdev_news, merge-bobdev_news-1, merge-trunktag-bobdev_news-1, merge-bodev_news-3, lwc, caBIG-00-00-00, merge-bobdev_news-2, merge-trunktag-bodev_news-3
Branch point for: Branch-bobdev_news
Dup of env.mac.pl for tiger.

#
# MacPython appears to want this for pythonw use.
#

use FileHandle;

my $osx_dir = "$ENV{HOME}/.MacOSX";
    
if (! -d $osx_dir)
{
    mkdir($osx_dir);
}

my $plist = "$osx_dir/environment.plist";

if (-f $plist)
{
    #
    # One already exists, try making a backup if there's not one already.
    #

    my $bak = "$plist.bak";

    if (! -f $bak)
    {
	rename($plist, $bak);
    }
}

$fh = new FileHandle(">$plist");

my $path = $OtherConfig->{pythonpath};

print $fh <<EOF;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DISPLAY</key>
<string>:0.0</string>
<key>PYTHONPATH</key>
<string>$path</string>
</dict>
</plist>
EOF

$fh->close();

#
# The Mac SEED always uses postgres. Load the postgres intiialization
# code.
#

#
# First, determine physical memory size and shmmax parameters.
#

sub get_sysctl
{
    my($var) = @_;
    my $sysctl = find_in_path("sysctl", "/sbin", "/usr/sbin");
    
    if (! -x $sysctl)
    {
	return undef;
    }

    my $out = `$sysctl $var`;
    chomp($out);
    my @a = split(/\s+/, $out);

    return $a[1];
}

$OtherConfig->{memory} = get_sysctl("hw.memsize");
$OtherConfig->{shmmax} = get_sysctl("kern.sysv.shmmax");

$pg_script = "$ENV{FIGCONFIG_RELEASE_DIR}/FigCommon/envsub.postgres.pl";

run_script($pg_script);


MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3