Changeset 3554
- Timestamp:
- 01/08/07 21:42:50 (5 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
misc/deb/trunk/debian/patches/clean-install-amp.dpatch
r3550 r3554 5 5 ## DP: Change some stupid defaults in freepbx, like wrong paths, making useless files 6 6 ## DP: on the webroot, etc. 7 ## DP: 7 ## DP: 8 8 ## DP: By default Debian's version of this script will not install files, 9 9 ## 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 11 11 ## DP: dpkg. 12 ## 13 ## RT: Update for 2.2.0 12 14 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"); 18 19 out(" --dry-run Don't actually do anything"); 19 20 out(" --force-version <ver> Force upgrade from version <ver>"); 20 out(" --dbhost <ip address> Use a remote database server");21 21 - out(" --no-files Just run updates without installing files"); 22 22 + out(" --no-files Just run updates without installing files (default)"); 23 23 + 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); 29 29 } 30 30 … … 34 34 $ntmp = sscanf($mode,"%o",$modenum); //assumes all inputs are octal 35 35 if (version_compare(phpversion(), 5.0) < 0) { 36 @@ -2 05,6 +206,7 @@36 @@ -250,6 +251,7 @@ 37 37 $output = false; 38 38 $return_value = false; … … 42 42 } else { 43 43 return mkdir($directory, $modenum); 44 @@ - 259,7 +261,7 @@44 @@ -311,7 +313,7 @@ 45 45 if (is_dir($source)) { 46 46 if (!file_exists($destination)) { … … 51 51 } 52 52 } 53 @@ - 452,7 +454,7 @@53 @@ -534,7 +536,7 @@ 54 54 else $amp_conf["AMPWEBROOT"] = rtrim($key,'/'); 55 55 if (is_dir($amp_conf["AMPWEBROOT"])) { … … 60 60 break; 61 61 } else { 62 @@ -461,13 +463,13 @@ 62 @@ -542,8 +544,21 @@ 63 } 63 64 } while(1); 64 65 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 65 89 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] "); 94 92 $key = trim(fgets(STDIN,1024)); 95 93 - if (preg_match('/^$/',$key)) $amp_conf["AMPBIN"] = "/var/lib/asterisk/bin"; … … 103 101 break; 104 102 } else { 105 @@ -5 21,7 +523,7 @@103 @@ -582,7 +597,7 @@ 106 104 else $amp_conf["AMPSBIN"] = rtrim($key,'/'); 107 105 if (is_dir($amp_conf["AMPSBIN"])) { … … 112 110 break; 113 111 } else { 114 @@ - 551,7 +553,7 @@112 @@ -612,7 +627,7 @@ 115 113 outn("Checking for PEAR DB.."); 116 114 if (! @ include('DB.php')) { … … 121 119 out("OK"); 122 120 123 @@ - 560,7 +562,7 @@121 @@ -621,7 +636,7 @@ 124 122 outn("Checking for PEAR Console::Getopt.."); 125 123 if (! @ include("Console/Getopt.php")) { … … 130 128 out("OK"); 131 129 132 @@ - 577,7 +579,7 @@130 @@ -638,7 +653,7 @@ 133 131 134 132 $debug = false; 135 133 $dryrun = false; 136 134 -$install_files = true; 137 +$install_files = false; // by default, do not install any files138 139 //initialize variables to avoid php notices140 $ dbhost = null;141 @@ -6 17,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 @@ 142 140 case "--no-files": 143 141 $install_files = false; … … 145 143 + case "--install-files": 146 144 + $install_files = true; 147 + out("Installing files, I hope you know what you are do ying....");145 + out("Installing files, I hope you know what you are doing...."); 148 146 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 184 152 185 153 -// **** Check for amportal.conf, create if necessary 186 154 +// **** Check for asterisk.conf, create if necessary 187 155 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 188 186 outn("Checking for ".ASTERISK_CONF.".."); 189 187 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 @@ 206 189 // datasource in in this style: dbengine://username:password@host/database 207 190 if (!function_exists($db_engine.'_connect')) { … … 212 195 213 196 $datasource = $db_engine.'://'.$db_user.':'.$db_pass.'@'.$db_host.'/'.$db_name; 214 @@ - 847,7 +845,7 @@197 @@ -1009,7 +1027,7 @@ 215 198 $md5sums = read_md5_file(UPGRADE_DIR."/".$version.".md5"); 216 199 recursive_copy("amp_conf", "", $md5sums); … … 221 204 } 222 205 223 @@ - 855,8 +853,6 @@206 @@ -1017,8 +1035,6 @@ 224 207 debug("Running ".dirname(__FILE__)."/apply_conf.sh"); 225 208 outn("Configuring install for your environment.."); … … 230 213 } 231 214 out("OK"); 232 @@ - 868,18 +864,6 @@215 @@ -1030,18 +1046,6 @@ 233 216 amp_mkdir($asterisk_conf["astspooldir"]."/fax","0766",true); 234 217 … … 249 232 250 233 outn("Checking for upgrades.."); 251 @@ - 920,14 +904,6 @@234 @@ -1082,14 +1086,6 @@ 252 235 out("OK"); 253 236
