Apache-Logmonster

 view release on metacpan or  search on metacpan

bin/install_deps.pl  view on Meta::CPAN

sub install_module_freebsd {
    my ($module, $info, $version) = @_;

    print " from ports...";
    my $name = $info->{port} || $module;
    my $portname = "p5-$name";
    $portname =~ s/::/-/g;

    if (`/usr/sbin/pkg_info | /usr/bin/grep $portname`) {
        return print "$module is installed.\n";
    }

    print "installing $module";

    my ($portdir) = </usr/ports/*/$portname>;

    if ( $portdir && -d $portdir && chdir $portdir ) {
        print " from ports ($portdir)\n";
        system "make install clean" 
            and warn "'make install clean' failed for port $module\n";
    }
}

sub install_module_linux {
    my ($module, $info, $version) = @_;

    if ( -x '/usr/bin/yum' ) {
        my $rpm = $info->{rpm} || $module;
        my $package = "perl-$rpm";
        $package =~ s/::/-/g;
        system "/usr/bin/yum -y install $package";
    }
    elsif ( -x '/usr/bin/apt-get' ) {
        my $lib = 'lib' . $module . '-perl';
        $lib =~ s/::/-/g;
        system "/usr/bin/apt-get -y install $lib";
    }
    else {
        warn "no Linux package manager detected\n";
    };
};

sub get_cpan_config {

    my $ftp = `which ftp`; chomp $ftp;
    my $gzip = `which gzip`; chomp $gzip;
    my $unzip = `which unzip`; chomp $unzip;
    my $tar  = `which tar`; chomp $tar;
    my $make = `which make`; chomp $make;
    my $wget = `which wget`; chomp $wget;

    return 
{
  'build_cache' => q[10],
  'build_dir' => qq[$ENV{HOME}/.cpan/build],
  'cache_metadata' => q[1],
  'cpan_home' => qq[$ENV{HOME}/.cpan],
  'ftp' => $ftp,
  'ftp_proxy' => q[],
  'getcwd' => q[cwd],
  'gpg' => q[],
  'gzip' => $gzip,
  'histfile' => qq[$ENV{HOME}/.cpan/histfile],
  'histsize' => q[100],
  'http_proxy' => q[],
  'inactivity_timeout' => q[5],
  'index_expire' => q[1],
  'inhibit_startup_message' => q[1],
  'keep_source_where' => qq[$ENV{HOME}/.cpan/sources],
  'lynx' => q[],
  'make' => $make,
  'make_arg' => q[],
  'make_install_arg' => q[],
  'makepl_arg' => q[],
  'ncftp' => q[],
  'ncftpget' => q[],
  'no_proxy' => q[],
  'pager' => q[less],
  'prerequisites_policy' => q[follow],
  'scan_cache' => q[atstart],
  'shell' => q[/bin/csh],
  'tar' => $tar,
  'term_is_latin' => q[1],
  'unzip' => $unzip,
  'urllist' => [ 'http://www.perl.com/CPAN/', 'http://mirrors.kernel.org/pub/CPAN/', 'ftp://cpan.cs.utah.edu/pub/CPAN/', 'ftp://mirrors.kernel.org/pub/CPAN', 'ftp://osl.uoregon.edu/CPAN/', 'http://cpan.yahoo.com/', 'ftp://ftp.funet.fi/pub/languages/p...
  'wget' => $wget, };
}




( run in 0.857 second using v1.01-cache-2.11-cpan-e1769b4cff6 )