Changeset 2194
- Timestamp:
- 08/02/08 22:42:31 (4 months ago)
- Files:
-
- psad/branches/psad-nodeps-testing/install.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
psad/branches/psad-nodeps-testing/install.pl
r2178 r2194 153 153 my $locale = 'C'; ### default LC_ALL env variable 154 154 my $no_locale = 0; 155 my $deps_dir = 'deps'; 155 156 my $init_dir = '/etc/init.d'; 156 157 my $init_name = 'psad'; … … 189 190 &import_config(); 190 191 191 my @LOGR_FILES = (*STDOUT, $config{'INSTALL_LOG_FILE'});192 my @LOGR_FILES = (*STDOUT, $config{'INSTALL_LOG_FILE'}); 192 193 193 194 $force_mod_re = qr|$force_mod_re| if $force_mod_re; 194 195 $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; 195 200 196 201 $cmds{'make'} = $makeCmd; … … 255 260 256 261 ### make sure install.pl is being called from the source directory 257 unless (-e 'psad' and -d 'IPTables-ChainMgr') {262 unless (-e 'psad') { 258 263 die "[*] install.pl can only be executed from the directory\n", 259 264 " that contains the psad sources! Exiting."; … … 276 281 277 282 ### 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 } 287 294 } 288 295 } … … 396 403 unless (((system "$cmds{'perl'} -c fwcheck_psad.pl")>>8) == 0) { 397 404 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; 399 407 } 400 408 … … 404 412 unless (((system "$cmds{'perl'} -c psad")>>8) == 0) { 405 413 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; 407 416 } 408 417 … … 411 420 unless (((system "$cmds{'perl'} -c nf2csv")>>8) == 0) { 412 421 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; 414 424 } 415 425 … … 937 947 my $mod_name = shift; 938 948 949 chdir $src_dir or die "[*] Could not chdir $src_dir: $!"; 950 chdir $deps_dir or die "[*] Could not chdir($deps_dir): $!"; 951 939 952 die '[*] Missing force-install key in required_perl_modules hash.' 940 953 unless defined $required_perl_modules{$mod_name}{'force-install'};
