[Pkg-voip-commits] r2303 - in freepbx/trunk/debian: . patches

Diego Iastrubni elcuco-guest at costa.debian.org
Thu Aug 24 16:12:21 UTC 2006


Author: elcuco-guest
Date: 2006-08-24 16:12:19 +0000 (Thu, 24 Aug 2006)
New Revision: 2303

Added:
   freepbx/trunk/debian/patches/clean-install-amp.dpatch
Modified:
   freepbx/trunk/debian/changelog
   freepbx/trunk/debian/patches/00list
Log:
new patch which removes obsolete options in install_amp
by default this script will not install files but only take care of the updates
removed some checkings which are not needed on debian - we use dpkg for handling dependencies
also make better defaults on interactive mode


Modified: freepbx/trunk/debian/changelog
===================================================================
--- freepbx/trunk/debian/changelog	2006-08-24 16:08:28 UTC (rev 2302)
+++ freepbx/trunk/debian/changelog	2006-08-24 16:12:19 UTC (rev 2303)
@@ -8,6 +8,7 @@
   * added both manager.d and extensions.d directories (on the same patch)
   * freepbx-panel adds another alternative configuration for op-panel
   * applied a patch to remove blinking on Konqueror
+  * applied a patch to remove not needed functions in install_amp
   
  -- Diego Iastrubni <diego.iastrubni at xorcom.com>  Sun, 19 Jun 2006 18:00:00 +0200
 

Modified: freepbx/trunk/debian/patches/00list
===================================================================
--- freepbx/trunk/debian/patches/00list	2006-08-24 16:08:28 UTC (rev 2302)
+++ freepbx/trunk/debian/patches/00list	2006-08-24 16:12:19 UTC (rev 2303)
@@ -1,8 +1,10 @@
+# fix various things which freepbs just does wrong
 ast-config-dirs
-check-ast-runnning
 disable-online-updates
 fix-retrieve-op-panel-cfg
 fix-fop-config.dpatch
+clean-install-amp
+
+# backports from the trunk, nice features... why not having them as well...?
+check-ast-runnning
 fix-konqueror-blinks
-
-#fix-ivr-sysrec

Added: freepbx/trunk/debian/patches/clean-install-amp.dpatch
===================================================================
--- freepbx/trunk/debian/patches/clean-install-amp.dpatch	2006-08-24 16:08:28 UTC (rev 2302)
+++ freepbx/trunk/debian/patches/clean-install-amp.dpatch	2006-08-24 16:12:19 UTC (rev 2303)
@@ -0,0 +1,234 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## clean-install-amp.dpatch by Diego Iastrubni <diego.iastrubni at xorcom.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Change some stupid defaults in freepbx, like wrong paths, making useless files
+## DP: on the webroot, etc.
+## DP: 
+## DP: By default Debian's version of this script will not install files,
+## DP: but only take chaege of installing the needed updates. I also removed
+## DP: some dependencies checking, as they are already taken care by 
+## DP: dpkg.
+
+ at DPATCH@
+diff -urNad freepbx-2.1.1/install_amp /tmp/dpep.ODnNRA/freepbx-2.1.1/install_amp
+--- freepbx-2.1.1/install_amp	2006-05-30 11:39:40.000000000 +0300
++++ /tmp/dpep.ODnNRA/freepbx-2.1.1/install_amp	2006-08-24 18:45:35.000000000 +0300
+@@ -72,7 +72,8 @@
+ 	out("  --dry-run                Don't actually do anything");
+ 	out("  --force-version <ver>    Force upgrade from version <ver>");
+ 	out("  --dbhost <ip address>    Use a remote database server");
+-	out("  --no-files               Just run updates without installing files");
++	out("  --no-files               Just run updates without installing files (default)");
++	out("  --install-files          Just run updates and install files (dagerous!)");
+ }
+ 
+ function install_parse_amportal_conf($filename) {
+@@ -460,9 +461,9 @@
+ 	} while(1);
+ 	
+ 	do {
+-		out("Enter the path to use for your FOP web root:\n [/var/www/html/panel] ");
++		out("Enter the path to use for your FOP web root:\n [/usr/share/op-panel] ");
+ 		$key = trim(fgets(STDIN,1024));
+-		if (preg_match('/^$/',$key)) $amp_conf["FOPWEBROOT"] = "/var/www/html/panel";
++		if (preg_match('/^$/',$key)) $amp_conf["FOPWEBROOT"] = "/usr/share/op-panel";
+ 		else $amp_conf["FOPWEBROOT"] = rtrim($key,'/');
+ 		if (is_dir($amp_conf["FOPWEBROOT"])) {
+ 			break;
+@@ -475,9 +476,9 @@
+ 	} while(1);
+ 	
+ 	do {
+-		outn("Enter the path to your Apache cgi-bin:\n [/var/www/cgi-bin] ");
++		outn("Enter the path to your Apache cgi-bin:\n [/usr/lib/cgi-bin] ");
+ 		$key = trim(fgets(STDIN,1024));
+-		if (preg_match('/^$/',$key)) $amp_conf["AMPCGIBIN"] = "/var/www/cgi-bin";
++		if (preg_match('/^$/',$key)) $amp_conf["AMPCGIBIN"] = "/usr/lib/cgi-bin";
+ 		else $amp_conf["AMPCGIBIN"] = rtrim($key,'/');
+ 		if (is_dir($amp_conf["AMPCGIBIN"])) break;
+ 		else fatal($amp_conf["AMPCGIBIN"]." is not a directory!");
+@@ -501,7 +502,7 @@
+ 	do {
+ 		out("Enter directory in which to store AMP executable scripts:\n [/var/lib/asterisk/bin] ");
+ 		$key = trim(fgets(STDIN,1024));
+-		if (preg_match('/^$/',$key)) $amp_conf["AMPBIN"] = "/var/lib/asterisk/bin";
++		if (preg_match('/^$/',$key)) $amp_conf["AMPBIN"] = "/usr/lib/asterisk/bin";
+ 		else $amp_conf["AMPBIN"] = rtrim($key,'/');
+ 		if (is_dir($amp_conf["AMPBIN"])) {
+ 			break;
+@@ -550,7 +551,7 @@
+ outn("Checking for PEAR DB..");
+ if (! @ include('DB.php')) {
+ 	out("FAILED");
+-	fatal("PEAR must be installed (requires DB.php). Include path: ".ini_get("include_path"));
++	fatal("PEAR must be installed (requires DB.php). Include path: ".ini_get("include_path") . "\nPlese install the package php4-pear or similar." );
+ }
+ out("OK");
+ 
+@@ -559,38 +560,14 @@
+ outn("Checking for PEAR Console::Getopt..");
+ if (! @ include("Console/Getopt.php")) {
+ 	out("FAILED");
+-	fatal("PEAR must be installed (requires Console/Getopt.php). Include path: ".ini_get("include_path"));
+-}
+-out("OK");
+-
+-/* RC: WE SOULDN'T NEED THESE WITH NEW PHP DIALPARTIES
+-// **** Make sure we have libasteriskperl
+-$perl_test = "perl -e 'use Asterisk::AGI'";
+-outn( "Checking for libasteriskperl (perl bindings for asterisk)..." );
+-exec( " $perl_test &> /dev/null", $perl_output, $perl_result );
+-if ( $perl_result != 0)
+-{
+-	out("FAILED\nReturn code from \"$perl_test\" is: " . $perl_result );
+-	fatal( "Please install libasteriskperl from your vendor.\nThis perl module is needed for executing dialparties.agi." );
+-}
+-out("OK");
+-
+-// **** Make sure we have Net::Telnet
+-$perl_test = "perl -e 'use Net::Telnet'";
+-outn( "Checking for Net::Telnet (used by dialparties.agi)..." );
+-exec( " $perl_test &> /dev/null", $perl_output, $perl_result );
+-if ( $perl_result != 0)
+-{
+-	out("FAILED\nReturn code from \"$perl_test\" is: " . $perl_result );
+-	fatal( "Please install Net::Telnet from your vendor or CPAN.\nThis perl module is needed for executing dialparties.agi." );
++	fatal("PEAR must be installed (requires Console/Getopt.php). Include path: ".ini_get("include_path") . "\nPlese install the package php4-pear or similar." );
+ }
+ out("OK");
+-*/
+ 
+ // **** Parse out command-line options
+ 
+ $shortopts = "h?u:p:";
+-$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files");
++$longopts = array("help","debug","dry-run","username=","password=","force-version=","dbhost=","no-files","install-files");
+ 
+ $args = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), $shortopts, $longopts);
+ if (is_object($args)) {
+@@ -601,7 +578,7 @@
+ 
+ $debug = false;
+ $dryrun = false;
+-$install_files = true;
++$install_files = false;
+ 
+ //initialize variables to avoid php notices
+ $dbhost = null; 
+@@ -641,6 +618,9 @@
+ 		case "--no-files":
+ 			$install_files = false;
+ 			out("Running upgrade only, without installing files.");
++		case "--install-files":
++			$install_files = true;
++			out("Installing files, I hope you know what you are doying....");
+ 		break;
+ 	}
+ }
+@@ -689,24 +669,25 @@
+ 
+ 	if (!array_key_exists("AMPWEBROOT",$amp_conf)) {
+ 		out("Adding AMPWEBROOT option to amportal.conf - using AMP default");
+-		$amp_conf["AMPWEBROOT"] = "/var/www/html";
++		$amp_conf["AMPWEBROOT"] = "/usr/share/freepbx";
+ 	}
+ 	
+ 	if (!array_key_exists("AMPCGIBIN",$amp_conf)) {
+ 		out("Adding AMPCGIBIN option to amportal.conf - using AMP default");
+-		$amp_conf["AMPCGIBIN"] = "/var/www/cgi-bin";
++		$amp_conf["AMPCGIBIN"] = "/usr/lib/cgi-bin";
+ 	}
+ 	
+ 	if (!array_key_exists("FOPWEBROOT",$amp_conf)) {
+ 		out("Adding FOPWEBROOT option to amportal.conf - using AMP default");
+-		$amp_conf["FOPWEBROOT"] = $amp_conf["AMPWEBROOT"]."/panel";
++		$amp_conf["FOPWEBROOT"] = "/usr/share/op-panel";
+ 	}
+ 	
+ 	if (!array_key_exists("AMPBIN",$amp_conf)) {
+ 		out("Adding AMPBIN option to amportal.conf - using AMP default");
+-		$amp_conf["AMPBIN"] = "/var/lib/asterisk/bin";
++		$amp_conf["AMPBIN"] = "/usr/share/asterisk/bin";
+ 	}
+ 	
++	// todo, is this needed on debian...?
+ 	if (!array_key_exists("AMPSBIN",$amp_conf)) {
+ 		out("Adding AMPSBIN option to amportal.conf - using AMP default");
+ 		$amp_conf["AMPSBIN"] = "/usr/sbin";
+@@ -734,7 +715,7 @@
+ 	write_amportal_conf(AMP_CONF, $amp_conf);
+ }
+ 
+-// **** Check for amportal.conf, create if necessary
++// **** Check for asterisk.conf, create if necessary
+ 
+ outn("Checking for ".ASTERISK_CONF."..");
+ if (!file_exists(ASTERISK_CONF)) {
+@@ -764,14 +745,6 @@
+ 
+ write_amportal_conf(AMP_CONF, $amp_conf);
+ 
+-// **** Check for func_callerid.so - this is only in asterisk 1.2
+-
+-outn("Checking for Asterisk 1.2..");
+-if (!file_exists($amp_conf["ASTMODDIR"]."/func_callerid.so")) {
+-	fatal("Asterisk 1.2 is required for this version of freePBX");
+-}
+-out("OK");
+-
+ // **** Make sure selinux isn't enabled
+ 
+ outn("Checking for selinux..");
+@@ -795,7 +768,7 @@
+ 
+ if (!function_exists($db_engine.'_connect')) {
+ 	out("FAILED");
+-	fatal($db_engine." PHP libraries not installed");
++	fatal($db_engine." PHP libraries not installed. \n Please install php4-mysql or similar.");
+ }
+ 
+ $db = DB::connect($datasource); // attempt connection
+@@ -841,8 +814,6 @@
+ debug("Running ".dirname(__FILE__)."/apply_conf.sh");
+ outn("Configuring install for your environment..");
+ if (!$dryrun) {
+-	if (file_exists($amp_conf["AMPSBIN"]."/amportal"))
+-		exec("chmod u+x ".$amp_conf["AMPSBIN"]."/amportal");
+ 	exec(dirname(__FILE__)."/apply_conf.sh");
+ }
+ out("OK");
+@@ -854,18 +825,6 @@
+ 	amp_mkdir($asterisk_conf["astspooldir"]."/fax","0766",true);
+ 
+ 
+-// **** Set permissions all files
+-
+-if ($install_files)
+-{
+-	outn("Setting permissions on files..");
+-	if (!$dryrun) {
+-		exec($amp_conf["AMPSBIN"]."/amportal chown");
+-	}
+-	out("OK");
+-}
+-
+-
+ // **** Read upgrades/ directory
+ 
+ outn("Checking for upgrades..");
+@@ -906,14 +865,6 @@
+ out("OK");
+ 
+ $version = install_getversion();
+-$filename = $amp_conf["AMPWEBROOT"]."/admin/version.txt";
+-if (!$fd = fopen($filename, "w")) {
+-	fatal("Could not open ".$filename." for writing");
+-}
+-fwrite($fd, $version);
+-fclose($fd);
+-
+-
+ 
+ // **** Set reload flag for AMP admin
+ install_needreload();




More information about the Pkg-voip-commits mailing list