--- /var/tmp/portage/vocp-0.9.3/work/vocp-0.9.3/install_vocp.pl 2003-02-05 19:05:35.000000000 -0500 +++ /tmp/install_vocp.pl 2005-04-03 12:39:21.782755960 -0400 @@ -69,7 +69,9 @@ 'Crypt::Blowfish' => [0, 'VOCPweb'], 'MIME::Parser' => [0, 'Email-to-VoiceMail'], ); - + +my $BASEDIR = $ENV{'VOCP_BASEDIR'}; + my $AudioDSPModLocation = 'prog/dependencies/Audio-DSP-0.02b/'; my $ModemVgettyModLocation = 'prog/dependencies/Modem-Vgetty-0.04/'; @@ -77,13 +79,13 @@ my $VOCPDepsLocation = 'prog/dependencies/'; $Version = '0.9.2'; -$LocalDir = '/usr/local/vocp'; +$LocalDir = $BASEDIR . '/usr/local/vocp'; $Cp = '/bin/cp'; -$VOCP_conf_dir = "/etc/vocp"; +$VOCP_conf_dir = $BASEDIR . "/etc/vocp"; -$Spool_dir = '/var/spool/voice'; +$Spool_dir = $BASEDIR . '/var/spool/voice'; @Message_dirs = ( 'messages/num', @@ -136,7 +138,7 @@ 'boxsample' => 'prog/boxes.conf.sample', ); -@LogFiles = ('/var/log/vocp.log', '/var/log/vocp-calls.log'); +@LogFiles = ($BASEDIR . '/var/log/vocp.log', $BASEDIR . '/var/log/vocp-calls.log'); @Doc_files = ( @@ -170,20 +172,21 @@ $Pwd = `pwd`; chomp($Pwd); - print "\n\nVOCP installer\n" - . "$License\n\n" - ."This program will install VOCP $Version.\n" - ."You may just press the ENTER key to accept " - ."the [default] value for any question.\n"; - - my $AgreeLicense = 'n'; - print "\n\nYou understand that the VOCP system, it's source code and all supporting documents and resources are\n" - . "\nCopyright (C) 2000-2003 Patrick Deegan, Psychogenic INC\n" - . "\nand subject to the terms and conditions described in the accompanying LICENSE file. You have read the LICENSE and " - . "agree to comply with the terms and conditions described therein? [$AgreeLicense]: "; +# print "\n\nVOCP installer\n" +# . "$License\n\n" +# ."This program will install VOCP $Version.\n" +# ."You may just press the ENTER key to accept " +# ."the [default] value for any question.\n"; + +# my $AgreeLicense = 'n'; +# print "\n\nYou understand that the VOCP system, it's source code and all supporting documents and resources are\n" +# . "\nCopyright (C) 2000-2003 Patrick Deegan, Psychogenic INC\n" +# . "\nand subject to the terms and conditions described in the accompanying LICENSE file. You have read the LICENSE and " +# . "agree to comply with the terms and conditions described therein? [$AgreeLicense]: "; +# +# option(\$AgreeLicense); - option(\$AgreeLicense); - + my $AgreeLicense = 'y'; unless ($AgreeLicense =~ m|^\s*[yY]|) { print "\nYou must agree to comply to the terms of the LICENSE before using VOCP or any parts thereof.\n" @@ -191,16 +194,20 @@ exit(0); } - print "\n\n"; - +# print "\n\n"; +# ########################### INSTALL Type ################################ # Type of installation my $install = $Install_type{'full'}; - print "Enter:\n$Install_type{'full'} for full vocp install,\n" - ."$Install_type{'upgrade'} if you are upgrading a previous version of VOCP (read doc/upgrading.txt!),\n" - ."$Install_type{'sound'} if you only wish to convert the sound files " - ."to rmd format\n[$install]: "; - option(\$install); + if ( $ENV{'VOCP_INSTALL_TYPE'} ne '' ) { + $install = $ENV{'VOCP_INSTALL_TYPE'}; + } + +# print "Enter:\n$Install_type{'full'} for full vocp install,\n" +# ."$Install_type{'upgrade'} if you are upgrading a previous version of VOCP (read doc/upgrading.txt!),\n" +# ."$Install_type{'sound'} if you only wish to convert the sound files " +# ."to rmd format\n[$install]: "; +# option(\$install); unless ($install =~ /^\d$/ && $install < 4) { print "Invalid selection ($install), please try again...\n\n"; @@ -212,18 +219,18 @@ || $install == $Install_type{'upgrade'}) && $> != 0); if ($install == $Install_type{'upgrade'}) { # Skip sound file conversion - print "Skipping sound file conversion.\n"; +# print "Skipping sound file conversion.\n"; } else { convert_sound() ; } # If user selected only to convert, we're done. if ($install == $Install_type{'sound'}) { - print "Done.\n\n"; +# print "Done.\n\n"; exit(0); } - system("touch " . join(" ", @LogFiles)); +# system("touch " . join(" ", @LogFiles)); ########################### Dependencies ################################ my $numSpaces = 30; @@ -267,10 +274,10 @@ if ($numFound != $numReqs) { - my $installDeps = 'y'; - print "\nCertain modules now required by VOCP were not found. You must install the modules marked REQUIRED before proceeding. " - . "You may:\n\t- Abort and manually install any dependencies\n\t- Proceed with current configuration.\n\t- Attempt to automatically install all missing dependencies.\n\nInstall ALL dependencies automatically (you must be connected to the Internet)? [$installDeps]: "; - option(\$installDeps); + my $installDeps = 'n'; + print "\nCertain modules now required by VOCP were not found. You must install the modules marked REQUIRED before proceeding."; +# . "You may:\n\t- Abort and manually install any dependencies\n\t- Proceed with current configuration.\n\t- Attempt to automatically install all missing dependencies.\n\nInstall ALL dependencies automatically (you must be connected to the Internet)? [$installDeps]: "; +# option(\$installDeps); if ($installDeps =~ /^\s*[yY]/) { @@ -355,11 +362,11 @@ ########################### VOCP modules ################################ #Copy program files - chdir($Pwd); - print "Installing VOCP Perl modules...\n"; - chdir($PerlModule_dirs{'VOCP'}); - system("perl Makefile.PL; make; make install"); - print "\nDone\n\n\n"; +# chdir($Pwd); +# print "Installing VOCP Perl modules...\n"; +# chdir($PerlModule_dirs{'VOCP'}); +# system("perl Makefile.PL; make; make install"); +# print "\nDone\n\n\n"; chdir($Pwd); @@ -398,9 +405,13 @@ system("$compiler -o pwcheck pwcheck.c"); print "Creating xfer_to_vocp setuid wrapper\n"; system("$compiler -o xfer_to_vocp xfer_to_vocp.c"); - my $haveTTS = 'n'; - print "\nDo you wish to use Text-to-speech (to hear emails, etc.) AND do you have the Festival TTS engine installed [$haveTTS]: "; - option(\$haveTTS); +# my $haveTTS = 'n'; +# print "\nDo you wish to use Text-to-speech (to hear emails, etc.) AND do you have the Festival TTS engine installed [$haveTTS]: "; +# option(\$haveTTS); + my $haveTTS = 'y'; + if ( $ENV{'VOCP_HAVE_TTS'} ne 'y' ) { + $haveTTS = 'n'; + } if ($haveTTS =~ m|^\s*[yY]|) { @@ -408,10 +419,11 @@ my $festDir; do { - print "Under which directory can Festival's bin/text2wave program be \nfound (enter full path up to bin/text2wave): "; - option(\$festDir); - chomp($festDir); +# print "Under which directory can Festival's bin/text2wave program be \nfound (enter full path up to bin/text2wave): "; +# option(\$festDir); +# chomp($festDir); + $festDir = '/usr/bin/text2wave'; # Correct if they've entered the full path including the executable if ($festDir =~ m|^(.*)/bin/text2wave$|) { @@ -504,17 +516,20 @@ } - option(\$VOCP_group); - - while (! -x $Groupadd) - { - print "\nWhat is the full path of the groupadd program on your system?\n" - . "[$Groupadd]: "; - option(\$Groupadd); - } - - print "\nCreating group and setting permissions on boxes.conf and messages.pl...\n"; - system("$Groupadd $VOCP_group"); +# option(\$VOCP_group); + if ( $ENV{'VOCP_GROUP'} ne '' ) { + $VOCP_group = $ENV{'VOCP_GROUP'}; + } +# +# while (! -x $Groupadd) +# { +# print "\nWhat is the full path of the groupadd program on your system?\n" +# . "[$Groupadd]: "; +# option(\$Groupadd); +# } +# +# print "\nCreating group and setting permissions on boxes.conf and messages.pl...\n"; +# system("$Groupadd $VOCP_group"); # Do a little work on permissions @@ -562,11 +577,11 @@ my ($pvftormd, $found); do { # locate pvftormd - my $pvftoolsdir = '/usr/local/bin'; - print "Where is the pvftormd executable (included " - ."with mgetty) installed on your system\n" - ."[$pvftoolsdir]: "; - option(\$pvftoolsdir); + my $pvftoolsdir = '/usr/bin'; +# print "Where is the pvftormd executable (included " +# ."with mgetty) installed on your system\n" +# ."[$pvftoolsdir]: "; +# option(\$pvftoolsdir); $pvftormd = $pvftoolsdir . '/pvftormd'; if (-x $pvftormd) { print "\n"; @@ -580,14 +595,18 @@ } until ($found); my $pvftormdopt = 'Lucent 5'; + + if ( $ENV{'PVF_FORMAT'} ne '' ) { + $pvftormdopt = $ENV{'PVF_FORMAT'}; + } - print "\nListed above are the supported modems and " - ."compression types. You should already know which " - ."of these apply to your modem (if not see the " - ."documentation included on vgetty or the website). " - ."Please enter the options that apply to your modem, " - ."for example, $pvftormdopt\n[$pvftormdopt]: "; - option(\$pvftormdopt); +# print "\nListed above are the supported modems and " +# ."compression types. You should already know which " +# ."of these apply to your modem (if not see the " +# ."documentation included on vgetty or the website). " +# ."Please enter the options that apply to your modem, " +# ."for example, $pvftormdopt\n[$pvftormdopt]: "; +# option(\$pvftormdopt); print "\nConverting sound files, this can take a while...\n";