#
# IPtoLL
#
# Robert Olson
# olson@mcs.anl.gov
# Argonne National Laboratory
# September, 1996
#
# Please keep this heading attached to the file it heads.
#

require 5.002;

require FileHandle;
use ExtUtils::MakeMaker;
use Config;

my %opts = ('NAME'	=> 'IPtoLL',
	    'VERSION_FROM' => 'lib/IPtoLL.pm', # finds $VERSION
);

#
# User Configuration:
#
# Set $dbi_host and $dbi_dbname to the name of the database server
# and the name of the database that will be used for MTk.
#
# Setting $dbi_host to the empty string causes it to use the
# mSQL server on the local machine.
#

$dbi_driver = 'msql';
$dbi_host = 'sandman.npac.syr.edu';
#$dbi_host = 'msqlserver.your.host.domain';
$dbi_dbname = 'LogAnalyze';

&write_config();

WriteMakefile(%opts);

sub write_config
{
    my($config_file, $out);
    
    $config_file = "lib/IPtoLL/Config.pm";
    $out = new FileHandle ">$config_file";
    
    if (!$out)
    {
	die "Cannot open config file $config_file: $!\n";
    }
    
    print "Writing config file $config_file\n";

    print $out <<END;
package IPtoLL;

#
# Config.pm created by Makefile.PL
#

use strict;

\$IPtoLL::DBDriver = '$dbi_driver';
\$IPtoLL::DBServerHost = '$dbi_host';
\$IPtoLL::DBName = '$dbi_dbname';

END
    
    print $out "\n1;\n";

    $out->close();
}


# Determine things that should *not* be installed
sub MY::libscan {
    my($self, $path) = @_;
#    return '' if $path =~ m:/classes:;
    return '' if $path =~ m/.(pl|dtd|sgml)$/;
    return '' if $path =~ m:\bCVS/:;
    return '' if $path =~ m/~$/;
    return '' if $path =~ m:/#[^/]*$:;
#    print "libscan: path=$path\n";
    $path;
}

