Changeset 3554

Show
Ignore:
Timestamp:
01/08/07 19:42:50 (2 years ago)
Author:
qldrob
Message:

OK, lets try it with this patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/deb/trunk/debian/patches/clean-install-amp.dpatch

    r3550 r3554  
    55## DP: Change some stupid defaults in freepbx, like wrong paths, making useless files 
    66## DP: on the webroot, etc. 
    7 ## DP:  
     7## DP: 
    88## DP: By default Debian's version of this script will not install files, 
    99## DP: but only take chaege of installing the needed updates. I also removed 
    10 ## DP: some dependencies checking, as they are already taken care by  
     10## DP: some dependencies checking, as they are already taken care by 
    1111## DP: dpkg. 
     12## 
     13## RT: Update for 2.2.0 
    1214 
    13 @DPATCH@ 
    14 diff -urNad freepbx-2.1.3.dfsg~/install_amp freepbx-2.1.3.dfsg/install_amp 
    15 --- freepbx-2.1.3.dfsg~/install_amp     2006-09-18 17:29:47.000000000 +0300 
    16 +++ freepbx-2.1.3.dfsg/install_amp      2006-09-28 17:47:37.000000000 +0300 
    17 @@ -73,7 +73,8 @@ 
     15--- install_amp 2007-01-09 13:35:31.000000000 +1000 
     16+++ /tmp/install_amp    2007-01-09 13:35:28.000000000 +1000 
     17@@ -93,7 +93,8 @@ 
     18        out("  --debug                  Enable debug output"); 
    1819        out("  --dry-run                Don't actually do anything"); 
    1920        out("  --force-version <ver>    Force upgrade from version <ver>"); 
    20         out("  --dbhost <ip address>    Use a remote database server"); 
    2121-       out("  --no-files               Just run updates without installing files"); 
    2222+       out("  --no-files               Just run updates without installing files (default)"); 
    2323+       out("  --install-files          Just run updates and install files (dagerous!)"); 
    24  } 
    25   
    26  function install_parse_amportal_conf($filename) { 
    27 @@ -196,7 +197,7 @@ 
    28         } while(1); 
     24       out("  --install-moh            Install default music-on-hold files (normally doesn't, unless "); 
     25       out("                           it's a new installation)"); 
     26       out("  --my-svn-is-correct      Ignore Asterisk version, assume it is correct"); 
     27@@ -241,7 +242,7 @@ 
     28        return ($retVal != 0); 
    2929 } 
    3030  
     
    3434        $ntmp = sscanf($mode,"%o",$modenum); //assumes all inputs are octal 
    3535        if (version_compare(phpversion(), 5.0) < 0) { 
    36 @@ -205,6 +206,7 @@ 
     36@@ -250,6 +251,7 @@ 
    3737                        $output = false; 
    3838                        $return_value = false; 
     
    4242                } else { 
    4343                        return mkdir($directory, $modenum); 
    44 @@ -259,7 +261,7 @@ 
     44@@ -311,7 +313,7 @@ 
    4545                        if (is_dir($source)) { 
    4646                                if (!file_exists($destination)) { 
     
    5151                                } 
    5252                        } 
    53 @@ -452,7 +454,7 @@ 
     53@@ -534,7 +536,7 @@ 
    5454                else $amp_conf["AMPWEBROOT"] = rtrim($key,'/'); 
    5555                if (is_dir($amp_conf["AMPWEBROOT"])) { 
     
    6060                        break; 
    6161                } else { 
    62 @@ -461,13 +463,13 @@ 
     62@@ -542,8 +544,21 @@ 
     63                } 
    6364        } while(1); 
    6465         
     66-       // Really no need to ask, is there. 
     67-       $amp_conf["FOPWEBROOT"]=$amp_conf["AMPWEBROOT"]."/panel"; 
     68+       do { 
     69+               out("Enter the path to use for your FOP web root:\n [/usr/share/op-panel] "); 
     70+               $key = trim(fgets(STDIN,1024)); 
     71+               if (preg_match('/^$/',$key)) $amp_conf["FOPWEBROOT"] = "/usr/share/op-panel"; 
     72+               else $amp_conf["FOPWEBROOT"] = rtrim($key,'/'); 
     73+               if (is_dir($amp_conf["FOPWEBROOT"])) { 
     74+                       break; 
     75+               } else if (amp_mkdir($amp_conf["FOPWEBROOT"],"0775",true)){ 
     76+                       out("Created ".$amp_conf["FOPWEBROOT"]); 
     77+                       break; 
     78+               } else { 
     79+                       fatal("Cannot create ".$amp_conf["FOPWEBROOT"]."!"); 
     80+               } 
     81+       } while(1); 
     82+ 
     83         
     84        outn("Enter the IP ADDRESS or hostname used to access the AMP web-admin:\n [xx.xx.xx.xx] "); 
     85        $key = trim(fgets(STDIN,1024)); 
     86@@ -561,13 +576,13 @@ 
     87        else $amp_conf["AMPEXTENSIONS"] = $key; 
     88         
    6589        do { 
    66 -               out("Enter the path to use for your FOP web root:\n [/var/www/html/panel] "); 
    67 +               out("Enter the path to use for your FOP web root:\n [/usr/share/op-panel] "); 
    68                 $key = trim(fgets(STDIN,1024)); 
    69 -               if (preg_match('/^$/',$key)) $amp_conf["FOPWEBROOT"] = "/var/www/html/panel"; 
    70 +               if (preg_match('/^$/',$key)) $amp_conf["FOPWEBROOT"] = "/usr/share/op-panel"; 
    71                 else $amp_conf["FOPWEBROOT"] = rtrim($key,'/'); 
    72                 if (is_dir($amp_conf["FOPWEBROOT"])) { 
    73                         break; 
    74 -               } else if (amp_mkdir($amp_conf["FOPWEBROOT"],"0755",true)){ 
    75 +               } else if (amp_mkdir($amp_conf["FOPWEBROOT"],"0775",true)){ 
    76                         out("Created ".$amp_conf["FOPWEBROOT"]); 
    77                         break; 
    78                 } else { 
    79 @@ -476,9 +478,9 @@ 
    80         } while(1); 
    81          
    82         do { 
    83 -               outn("Enter the path to your Apache cgi-bin:\n [/var/www/cgi-bin] "); 
    84 +               outn("Enter the path to your Apache cgi-bin:\n [/usr/lib/cgi-bin] "); 
    85                 $key = trim(fgets(STDIN,1024)); 
    86 -               if (preg_match('/^$/',$key)) $amp_conf["AMPCGIBIN"] = "/var/www/cgi-bin"; 
    87 +               if (preg_match('/^$/',$key)) $amp_conf["AMPCGIBIN"] = "/usr/lib/cgi-bin"; 
    88                 else $amp_conf["AMPCGIBIN"] = rtrim($key,'/'); 
    89                 if (is_dir($amp_conf["AMPCGIBIN"])) break; 
    90                 else fatal($amp_conf["AMPCGIBIN"]." is not a directory!"); 
    91 @@ -502,11 +504,11 @@ 
    92         do { 
    93                 out("Enter directory in which to store AMP executable scripts:\n [/var/lib/asterisk/bin] "); 
     90-               out("Enter directory in which to store AMP executable scripts:\n [/var/lib/asterisk/bin] "); 
     91+               out("Enter directory in which to store AMP executable scripts:\n [/usr/lib/asterisk/bin] "); 
    9492                $key = trim(fgets(STDIN,1024)); 
    9593-               if (preg_match('/^$/',$key)) $amp_conf["AMPBIN"] = "/var/lib/asterisk/bin"; 
     
    103101                        break; 
    104102                } else { 
    105 @@ -521,7 +523,7 @@ 
     103@@ -582,7 +597,7 @@ 
    106104                else $amp_conf["AMPSBIN"] = rtrim($key,'/'); 
    107105                if (is_dir($amp_conf["AMPSBIN"])) { 
     
    112110                        break; 
    113111                } else { 
    114 @@ -551,7 +553,7 @@ 
     112@@ -612,7 +627,7 @@ 
    115113 outn("Checking for PEAR DB.."); 
    116114 if (! @ include('DB.php')) { 
     
    121119 out("OK"); 
    122120  
    123 @@ -560,7 +562,7 @@ 
     121@@ -621,7 +636,7 @@ 
    124122 outn("Checking for PEAR Console::Getopt.."); 
    125123 if (! @ include("Console/Getopt.php")) { 
     
    130128 out("OK"); 
    131129  
    132 @@ -577,7 +579,7 @@ 
     130@@ -638,7 +653,7 @@ 
    133131  
    134132 $debug = false; 
    135133 $dryrun = false; 
    136134-$install_files = true; 
    137 +$install_files = false; // by default, do not install any files 
    138   
    139  //initialize variables to avoid php notices 
    140  $dbhost = null;  
    141 @@ -617,6 +619,9 @@ 
     135+$install_files = false; // Do not install files in a packaged environment 
     136 $override_astvers = false; 
     137  
     138 $install_moh = false; 
     139@@ -686,6 +701,9 @@ 
    142140                case "--no-files": 
    143141                        $install_files = false; 
     
    145143+               case "--install-files": 
    146144+                       $install_files = true; 
    147 +                       out("Installing files, I hope you know what you are doying...."); 
     145+                       out("Installing files, I hope you know what you are doing...."); 
    148146                break; 
    149         } 
    150  } 
    151 @@ -665,24 +670,25 @@ 
    152   
    153         if (!array_key_exists("AMPWEBROOT",$amp_conf)) { 
    154                 out("Adding AMPWEBROOT option to amportal.conf - using AMP default"); 
    155 -               $amp_conf["AMPWEBROOT"] = "/var/www/html"; 
    156 +               $amp_conf["AMPWEBROOT"] = "/usr/share/freepbx"; 
    157         } 
    158          
    159         if (!array_key_exists("AMPCGIBIN",$amp_conf)) { 
    160                 out("Adding AMPCGIBIN option to amportal.conf - using AMP default"); 
    161 -               $amp_conf["AMPCGIBIN"] = "/var/www/cgi-bin"; 
    162 +               $amp_conf["AMPCGIBIN"] = "/usr/lib/cgi-bin"; 
    163         } 
    164          
    165         if (!array_key_exists("FOPWEBROOT",$amp_conf)) { 
    166                 out("Adding FOPWEBROOT option to amportal.conf - using AMP default"); 
    167 -               $amp_conf["FOPWEBROOT"] = $amp_conf["AMPWEBROOT"]."/panel"; 
    168 +               $amp_conf["FOPWEBROOT"] = "/usr/share/op-panel"; 
    169         } 
    170          
    171         if (!array_key_exists("AMPBIN",$amp_conf)) { 
    172                 out("Adding AMPBIN option to amportal.conf - using AMP default"); 
    173 -               $amp_conf["AMPBIN"] = "/var/lib/asterisk/bin"; 
    174 +               $amp_conf["AMPBIN"] = "/usr/share/asterisk/bin"; 
    175         } 
    176          
    177 +       // todo, is this needed on debian...? 
    178         if (!array_key_exists("AMPSBIN",$amp_conf)) { 
    179                 out("Adding AMPSBIN option to amportal.conf - using AMP default"); 
    180                 $amp_conf["AMPSBIN"] = "/usr/sbin"; 
    181 @@ -710,7 +716,7 @@ 
    182         write_amportal_conf(AMP_CONF, $amp_conf); 
    183  } 
     147                case "--my-svn-is-correct": 
     148                        $override_astvers = true; 
     149@@ -749,7 +767,7 @@ 
     150 out("OK"); 
     151  
    184152  
    185153-// **** Check for amportal.conf, create if necessary 
    186154+// **** Check for asterisk.conf, create if necessary 
    187155  
     156 outn("Checking for ".AMP_CONF.".."); 
     157 if (!file_exists(AMP_CONF)) { 
     158@@ -776,17 +794,17 @@ 
     159  
     160 if (!array_key_exists("AMPWEBROOT",$amp_conf)) { 
     161        out("Adding AMPWEBROOT option to amportal.conf - using AMP default"); 
     162-       $amp_conf["AMPWEBROOT"] = "/var/www/html"; 
     163+       $amp_conf["AMPWEBROOT"] = "/usr/share/freepbx"; 
     164 } 
     165  
     166 if (!array_key_exists("FOPWEBROOT",$amp_conf)) { 
     167        out("Adding FOPWEBROOT option to amportal.conf - using AMP default"); 
     168-       $amp_conf["FOPWEBROOT"] = $amp_conf["AMPWEBROOT"]."/panel"; 
     169+       $amp_conf["FOPWEBROOT"] = "/usr/share/op-panel"; 
     170 } 
     171  
     172 if (!array_key_exists("AMPBIN",$amp_conf)) { 
     173        out("Adding AMPBIN option to amportal.conf - using AMP default"); 
     174-       $amp_conf["AMPBIN"] = "/var/lib/asterisk/bin"; 
     175+       $amp_conf["AMPBIN"] = "/usr/share/asterisk/bin"; 
     176 } 
     177  
     178 if (!array_key_exists("AMPSBIN",$amp_conf)) { 
     179@@ -822,7 +840,7 @@ 
     180 // write amportal.conf 
     181 write_amportal_conf(AMP_CONF, $amp_conf); 
     182  
     183-// **** Check for amportal.conf, create if necessary 
     184+// **** Check for asterisk.conf, create if necessary 
     185  
    188186 outn("Checking for ".ASTERISK_CONF.".."); 
    189187 if (!file_exists(ASTERISK_CONF)) { 
    190 @@ -740,14 +746,6 @@ 
    191   
    192  write_amportal_conf(AMP_CONF, $amp_conf); 
    193   
    194 -// **** Check for func_callerid.so - this is only in asterisk 1.2 
    195 
    196 -outn("Checking for Asterisk 1.2.."); 
    197 -if (!file_exists($amp_conf["ASTMODDIR"]."/func_callerid.so")) { 
    198 -       fatal("Asterisk 1.2 is required for this version of freePBX"); 
    199 -} 
    200 -out("OK"); 
    201 
    202  // **** Make sure selinux isn't enabled 
    203   
    204  outn("Checking for selinux.."); 
    205 @@ -781,7 +779,7 @@ 
     188@@ -943,7 +961,7 @@ 
    206189                // datasource in in this style: dbengine://username:password@host/database  
    207190                if (!function_exists($db_engine.'_connect')) { 
     
    212195         
    213196                $datasource = $db_engine.'://'.$db_user.':'.$db_pass.'@'.$db_host.'/'.$db_name; 
    214 @@ -847,7 +845,7 @@ 
     197@@ -1009,7 +1027,7 @@ 
    215198        $md5sums = read_md5_file(UPGRADE_DIR."/".$version.".md5"); 
    216199        recursive_copy("amp_conf", "", $md5sums); 
     
    221204 } 
    222205  
    223 @@ -855,8 +853,6 @@ 
     206@@ -1017,8 +1035,6 @@ 
    224207 debug("Running ".dirname(__FILE__)."/apply_conf.sh"); 
    225208 outn("Configuring install for your environment.."); 
     
    230213 } 
    231214 out("OK"); 
    232 @@ -868,18 +864,6 @@ 
     215@@ -1030,18 +1046,6 @@ 
    233216        amp_mkdir($asterisk_conf["astspooldir"]."/fax","0766",true); 
    234217  
     
    249232  
    250233 outn("Checking for upgrades.."); 
    251 @@ -920,14 +904,6 @@ 
     234@@ -1082,14 +1086,6 @@ 
    252235 out("OK"); 
    253236  
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads