Changeset 2199

Show
Ignore:
Timestamp:
08/03/08 00:23:09 (4 months ago)
Author:
mbr
Message:

merged 2188:2198 file:///home/mbr/svn/psad_repos/psad/branches/psad-nodeps-testing into trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • psad/trunk/install.pl

    r2178 r2199  
    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'}; 
  • psad/trunk/packaging/psad.spec

    r2186 r2199  
    5555done 
    5656 
     57cd deps 
    5758cd IPTables-Parse && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir 
    5859cd .. 
     
    6667cd .. 
    6768cd Date-Calc && perl Makefile.PL PREFIX=%psadlibdir LIB=%psadlibdir 
    68 cd .. 
     69cd ../.. 
    6970 
    7071%build 
     
    7576make OPTS="$RPM_OPT_FLAGS" -C whois 
    7677 
     78cd deps 
    7779### build perl modules used by psad 
    7880make OPTS="$RPM_OPT_FLAGS" -C IPTables-Parse 
     
    8284make OPTS="$RPM_OPT_FLAGS" -C Unix-Syslog 
    8385make OPTS="$RPM_OPT_FLAGS" -C Date-Calc 
     86cd .. 
    8487 
    8588%install 
     
    140143 
    141144### install perl modules used by psad 
     145cd deps 
    142146install -m 555 Bit-Vector/blib/arch/auto/Bit/Vector/Vector.so $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Bit/Vector/Vector.so 
    143147install -m 444 Bit-Vector/blib/arch/auto/Bit/Vector/Vector.bs $RPM_BUILD_ROOT%psadlibdir/%psadmoddir/auto/Bit/Vector/Vector.bs 
     
    165169install -m 444 IPTables-Parse/blib/lib/IPTables/Parse.pm $RPM_BUILD_ROOT%psadlibdir/IPTables/Parse.pm 
    166170install -m 444 IPTables-ChainMgr/blib/lib/IPTables/ChainMgr.pm $RPM_BUILD_ROOT%psadlibdir/IPTables/ChainMgr.pm 
     171cd .. 
    167172 
    168173### install snort rules files 
  • psad/trunk/psad

    r2188 r2199  
    26582658            Today Date_to_Time Mktime Localtime)); 
    26592659    Unix::Syslog->import(qw(:subs :macros)); 
    2660     Storable->import(qw(retrieve store)) if $store_file; 
     2660    Storable->import(qw(retrieve store)) if $store_file; 
    26612661 
    26622662    return;