| 1 | #!/usr/bin/perl -w |
|---|
| 2 | |
|---|
| 3 | use strict; |
|---|
| 4 | use CPAN; |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | ########################################################################### |
|---|
| 8 | # |
|---|
| 9 | # Copyright Dan Cardamore <wombat@hld.ca> 2000 - 2001 |
|---|
| 10 | # This program is licensed under the GNU GPL. Since this is free |
|---|
| 11 | # software, the author assumes no liability for it and the damages |
|---|
| 12 | # that it may cause. |
|---|
| 13 | # |
|---|
| 14 | # Please read the README file. |
|---|
| 15 | # http://www.hld.ca/opensource/hldfilter |
|---|
| 16 | # |
|---|
| 17 | ########################################################################### |
|---|
| 18 | # $rcs = ' $Id: install.pl,v 3.1 2001/06/01 17:35:32 wombat Exp $ ' ; |
|---|
| 19 | ########################################################################### |
|---|
| 20 | |
|---|
| 21 | print <<START; |
|---|
| 22 | Please make sure you are running this program as root since |
|---|
| 23 | if you are not, this install will not succeed. |
|---|
| 24 | |
|---|
| 25 | This will first attempt to download all required modules, and |
|---|
| 26 | then it will copy the files hldfilter and statsgen.pl into |
|---|
| 27 | /usr/local/bin where all users will be able to access them. |
|---|
| 28 | |
|---|
| 29 | Please make sure that /usr/local/bin is in the system path. |
|---|
| 30 | START |
|---|
| 31 | |
|---|
| 32 | sleep 3; |
|---|
| 33 | |
|---|
| 34 | my @modules = ( |
|---|
| 35 | "Mail::Audit", |
|---|
| 36 | "Mail::Address", |
|---|
| 37 | "Mail::RBL", |
|---|
| 38 | "Mail::CheckUser", |
|---|
| 39 | "MIME::Lite", |
|---|
| 40 | "Getopt::Long", |
|---|
| 41 | "Date::Manip", |
|---|
| 42 | "GD::Graph", |
|---|
| 43 | "GD::pie", |
|---|
| 44 | "GD::bars" |
|---|
| 45 | ); |
|---|
| 46 | |
|---|
| 47 | print "Copying HLDFilter files into /usr/local/bin...\n"; |
|---|
| 48 | `cp hldfilter /usr/local/bin`; |
|---|
| 49 | `chmod 755 /usr/local/bin/hldfilter`; |
|---|
| 50 | `cp statsgen.pl /usr/local/bin/`; |
|---|
| 51 | `chmod 755 /usr/local/bin/statsgen.pl`; |
|---|
| 52 | |
|---|
| 53 | my $status = 1; |
|---|
| 54 | foreach my $module (@modules) { |
|---|
| 55 | print "Installing $module...\n"; |
|---|
| 56 | unless (install($module)) { $status = undef; } |
|---|
| 57 | } |
|---|
| 58 | |
|---|
| 59 | print "\n\n"; |
|---|
| 60 | if ($status) { |
|---|
| 61 | print "All modules installed successfully!\n"; |
|---|
| 62 | } |
|---|
| 63 | else { |
|---|
| 64 | print "Some module installs failed.\n"; |
|---|
| 65 | } |
|---|
| 66 | sleep 2; |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | print <<END; |
|---|
| 70 | Installation of modules is complete. If any errors occured, you |
|---|
| 71 | will have to install those yourself either by downloading them and |
|---|
| 72 | installing them yourself from www.cpan.org, or by using cpan: |
|---|
| 73 | perl -MCPAN -e shell |
|---|
| 74 | |
|---|
| 75 | You will also be required to ensure that the path to perl at the |
|---|
| 76 | very top line of both /usr/local/bin/hldfilter and |
|---|
| 77 | /usr/local/bin/statsgen.pl is correct. You can find this path by |
|---|
| 78 | typing 'which perl' at the command line. |
|---|
| 79 | |
|---|
| 80 | To get started filtering, type 'hldfilter --init' to set a user up. |
|---|
| 81 | |
|---|
| 82 | If you have problems with hldfilter, please join one of the |
|---|
| 83 | mailing lists located at http://www.hld.ca/opensource/hldfilter |
|---|
| 84 | END |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | |
|---|