Changeset 2194

Show
Ignore:
Timestamp:
08/02/08 22:42:31 (4 months ago)
Author:
mbr
Message:

updated to set --Skip-mod-install if deps/ does not exist - this will allow a 'nodeps' tarball that removes this directory

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • psad/branches/psad-nodeps-testing/install.pl

    r2178 r2194  
    153153my $locale = 'C';  ### default LC_ALL env variable 
    154154my $no_locale = 0; 
     155my $deps_dir = 'deps'; 
    155156my $init_dir = '/etc/init.d'; 
    156157my $init_name = 'psad'; 
     
    189190&import_config(); 
    190191 
    191 my @LOGR_FILES   = (*STDOUT, $config{'INSTALL_LOG_FILE'}); 
     192my @LOGR_FILES = (*STDOUT, $config{'INSTALL_LOG_FILE'}); 
    192193 
    193194$force_mod_re = qr|$force_mod_re| if $force_mod_re; 
    194195$exclude_mod_re = qr|$exclude_mod_re| if $exclude_mod_re; 
     196 
     197### see if the deps/ directory exists, and if not then we are installing 
     198### from the -nodeps sources so don't install any perl modules 
     199$skip_module_install = 1 unless -d $deps_dir; 
    195200 
    196201$cmds{'make'}     = $makeCmd; 
     
    255260 
    256261    ### make sure install.pl is being called from the source directory 
    257     unless (-e 'psad' and -d 'IPTables-ChainMgr') { 
     262    unless (-e 'psad') { 
    258263        die "[*] install.pl can only be executed from the directory\n", 
    259264            "    that contains the psad sources!  Exiting."; 
     
    276281 
    277282    ### change any existing psad module directory to allow anyone to import 
    278     my $dir_tmp = $config{'PSAD_LIBS_DIR'}; 
    279     $dir_tmp =~ s|lib/|lib64/|; 
    280     for my $dir ($config{'PSAD_LIBS_DIR'}, $dir_tmp) { 
    281         if (-d $dir) { 
    282             chmod 0755, $dir; 
    283             unless ($no_rm_old_lib_dir) { 
    284                 &logr("[+] Removing $dir/ directory from previous " . 
    285                     "psad installation.\n"); 
    286                 rmtree $dir; 
     283    unless ($skip_module_install) { 
     284        my $dir_tmp = $config{'PSAD_LIBS_DIR'}; 
     285        $dir_tmp =~ s|lib/|lib64/|; 
     286        for my $dir ($config{'PSAD_LIBS_DIR'}, $dir_tmp) { 
     287            if (-d $dir) { 
     288                chmod 0755, $dir; 
     289                unless ($no_rm_old_lib_dir) { 
     290                    &logr("[+] Removing $dir/ directory from previous " . 
     291                        "psad installation.\n"); 
     292                    rmtree $dir; 
     293                } 
    287294            } 
    288295        } 
     
    396403    unless (((system "$cmds{'perl'} -c fwcheck_psad.pl")>>8) == 0) { 
    397404        die "[*] fwcheck_psad.pl does not compile with \"perl -c\".  Download ", 
    398             "the latest sources from:\n\nhttp://www.cipherdyne.org/\n"; 
     405            "the latest sources from:\n\nhttp://www.cipherdyne.org/\n" 
     406            unless $skip_module_install; 
    399407    } 
    400408 
     
    404412    unless (((system "$cmds{'perl'} -c psad")>>8) == 0) { 
    405413        die "[*] psad does not compile with \"perl -c\".  Download the", 
    406             " latest sources from:\n\nhttp://www.cipherdyne.org/\n"; 
     414            " latest sources from:\n\nhttp://www.cipherdyne.org/\n" 
     415            unless $skip_module_install; 
    407416    } 
    408417 
     
    411420    unless (((system "$cmds{'perl'} -c nf2csv")>>8) == 0) { 
    412421        die "[*] nf2csv does not compile with \"perl -c\".  Download ", 
    413             "the latest sources from:\n\nhttp://www.cipherdyne.org/\n"; 
     422            "the latest sources from:\n\nhttp://www.cipherdyne.org/\n" 
     423            unless $skip_module_install; 
    414424    } 
    415425 
     
    937947    my $mod_name = shift; 
    938948 
     949    chdir $src_dir or die "[*] Could not chdir $src_dir: $!"; 
     950    chdir $deps_dir or die "[*] Could not chdir($deps_dir): $!"; 
     951 
    939952    die '[*] Missing force-install key in required_perl_modules hash.' 
    940953        unless defined $required_perl_modules{$mod_name}{'force-install'};