[debian-edu-commits] debian-edu/pkg-team/ 16/32: Imported Debian patch 2.7.4-3

Mike Gabriel sunweaver at debian.org
Tue Apr 1 16:52:05 UTC 2014


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository gosa.

commit 33b0b7b8c85f92b8be1f94f0635339a3e3d090a5
Author: Cajus Pollmeier <cajus at debian.org>
Date:   Mon Jun 18 14:29:03 2012 +0200

    Imported Debian patch 2.7.4-3
---
 debian/changelog                            |   8 ++
 debian/control                              |   5 +-
 debian/{gosa.conf => gosa-apache.conf}      |   0
 debian/gosa.apache2                         |   1 -
 debian/gosa.install                         |   1 +
 debian/gosa.postinst                        |  45 +++++----
 debian/gosa.postrm                          |  26 ++---
 debian/patches/01_fix_smarty_location.patch |   4 +-
 debian/patches/series                       |   2 +
 debian/patches/smarty31.patch               | 143 ++++++++++++++++++++++++++++
 debian/patches/style-robustness.patch       |  14 +++
 debian/rules                                |   2 +-
 12 files changed, 214 insertions(+), 37 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index f25f601..fe2879c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+gosa (2.7.4-3) unstable; urgency=low
+
+  * Reverted Apache2 transition because it has been aborted. Closes: #674357.
+  * Checked if the package runs with debian packaged smarty 
+    3.1.x. Closes: #672398.
+
+ -- Cajus Pollmeier <cajus at debian.org>  Mon, 18 Jun 2012 14:29:03 +0200
+
 gosa (2.7.4-2) unstable; urgency=low
 
   * More robustness for the postinst scripts. Closes: #673168.
diff --git a/debian/control b/debian/control
index 2b0b084..2369cc7 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: web
 Priority: optional
 Maintainer: GOsa packages maintainers group <gosa-pkg at oss.gonicus.de>
 Uploaders: Cajus Pollmeier <cajus at debian.org>
-Build-Depends: debhelper (>= 7.0.50~), dh-apache2
+Build-Depends: debhelper (>= 7.0.50~)
 Build-Depends-Indep: po-debconf
 Standards-Version: 3.9.3
 Homepage: https://oss.gonicus.de/labs/gosa/
@@ -237,7 +237,7 @@ Description: base mail plugin for GOsa²
 
 Package: gosa-plugin-mit-krb5
 Architecture: all
-Conflicts: gosa-plugin-heimdal
+Conflicts: gosa-plugin-heimdal 
 Breaks: gosa (<<2.7)
 Depends: ${misc:Depends}, gosa, gosa-plugin-systems
 Description: mit-krb5 plugin for GOsa²
@@ -534,4 +534,3 @@ Description: webdav plugin for GOsa²
  .
  GOsa² is a combination of system-administrator and end-user web
  interface, designed to handle LDAP based setups.
-
diff --git a/debian/gosa.conf b/debian/gosa-apache.conf
similarity index 100%
rename from debian/gosa.conf
rename to debian/gosa-apache.conf
diff --git a/debian/gosa.apache2 b/debian/gosa.apache2
index 6cb1c9f..e69de29 100644
--- a/debian/gosa.apache2
+++ b/debian/gosa.apache2
@@ -1 +0,0 @@
-conf debian/gosa.conf lighttpd
diff --git a/debian/gosa.install b/debian/gosa.install
index ea1e2e9..8a3d752 100644
--- a/debian/gosa.install
+++ b/debian/gosa.install
@@ -6,6 +6,7 @@ gosa-core/include			/usr/share/gosa
 gosa-core/locale			/usr/share/gosa
 gosa-core/plugins			/usr/share/gosa
 gosa-core/setup				/usr/share/gosa
+debian/gosa-apache.conf			/etc/gosa
 debian/gosa-lighttpd.conf		/etc/gosa
 gosa-core/contrib/shells		/etc/gosa
 gosa-core/contrib/encodings		/etc/gosa
diff --git a/debian/gosa.postinst b/debian/gosa.postinst
index ea6789c..c48ea12 100644
--- a/debian/gosa.postinst
+++ b/debian/gosa.postinst
@@ -28,7 +28,6 @@ esac
 # Set ID's
 WEBUSER="www-data"
 WEBGROUP="www-data"
-CONF="gosa"
 
 # Create empty inclusion file for apache
 if [ ! -f /etc/gosa/gosa.secrets ]; then
@@ -36,24 +35,36 @@ if [ ! -f /etc/gosa/gosa.secrets ]; then
     chmod 600 /etc/gosa/gosa.secrets
 fi
 
-if [ -d /etc/apache2 ]; then
-	if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
-		. /usr/share/apache2/apache2-maintscript-helper
-		apache2_invoke enconf $CONF
-
-		# Add support for RequestHeader
-		if ! apache2_invoke enmod headers ; then
-			echo "Failed to enable the apache2 headers module!"
-		fi
-	elif  dpkg-query -f '${Version}'  -W 'apache2.2-common' > /dev/null 2>&1 ; then
-		[ -d /etc/apache2/conf.d/ ] && [ ! -L /etc/apache2/conf.d/$CONF.conf ] && ln -s ../conf-available/$CONF.conf /etc/apache2/conf.d/$CONF.conf
-		if [ -e /usr/sbin/a2enmod ]; then
-			a2enmod headers
-		fi
-	fi
+if [ -d /etc/apache2/conf.d ]; then
+
+  # Copy GOsa configuration to conf.d directories
+  if [ ! -L /etc/apache2/conf.d/gosa.conf ]; then
+
+    # Remove old instances of this file
+    if [ -f /etc/apache2/conf.d/gosa.conf ]; then
+      echo "Found old gosa apache configuration in /etc/apache2/conf.d - moving it to gosa.conf.orig..."
+      echo "Please check for changes in /etc/gosa/gosa-apache.conf if you modified this file!"
+      mv /etc/apache2/conf.d/gosa.conf /etc/apache2/conf.d/gosa.conf.orig
+    fi
+
+    echo "Making /gosa available in /etc/apache2/conf.d"
+
+    # Add GOsa include file
+    ln -s /etc/gosa/gosa-apache.conf /etc/apache2/conf.d/gosa.conf
+  fi
+  
+  # Add support for RequestHeader
+  a2enmod headers
+
+  # Finally restart servers
+  if [ -x /usr/sbin/invoke-rc.d ]; then
+    invoke-rc.d apache2 reload
+  else
+    /etc/init.d/apache2 reload
+  fi
 fi
 
-if [ -d /etc/lighttpd/conf-available -a -e /etc/init.d/lighttpd ]; then
+if [ -d /etc/lighttpd/conf-available ]; then
 
   # Copy GOsa configuration to conf-available directories /etc/lighttpd/conf-available
   if [ ! -L /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf ]; then
diff --git a/debian/gosa.postrm b/debian/gosa.postrm
index 4257db2..253fcf3 100644
--- a/debian/gosa.postrm
+++ b/debian/gosa.postrm
@@ -3,19 +3,7 @@
 #
 
 set -e
-
-if [ "$1" = "remove" ] || [ "$1" = "purge" ] ; then
-
-        CONF="gosa"
-
-        if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
-                . /usr/share/apache2/apache2-maintscript-helper
-                apache2_invoke disconf $CONF
-        elif  dpkg-query -f '${Version}'  -W 'apache2.2-common' > /dev/null 2>&1 ; then
-                [ -L /etc/apache2/conf.d/$CONF.conf ] && rm /etc/apache2/conf.d/$CONF.conf
-        fi
-
-fi
+set -x
 
 case "$1" in
   purge)
@@ -35,6 +23,18 @@ case "$1" in
 	;;
 
   remove)
+        if [ -d /etc/apache2/conf.d ]; then
+          # Remove GOsa include
+          [ -L /etc/apache2/conf.d/gosa.conf ] && rm -f /etc/apache2/conf.d/gosa.conf
+
+          # Restart servers
+          if [ -x /usr/sbin/invoke-rc.d ]; then
+            invoke-rc.d apache2 restart
+          else
+            /etc/init.d/apache2 restart
+          fi
+        fi
+
         if [ -d /etc/lighttpd/conf-available ]; then
           # Remove GOsa include
           [ -L /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf ] && rm -f /etc/lighttpd/conf-enabled/99gosa-lighttpd.conf
diff --git a/debian/patches/01_fix_smarty_location.patch b/debian/patches/01_fix_smarty_location.patch
index d7325ae..50144b3 100644
--- a/debian/patches/01_fix_smarty_location.patch
+++ b/debian/patches/01_fix_smarty_location.patch
@@ -13,5 +13,5 @@ Description: Adapt location for debian packaged smarty
 +	require("/usr/share/php/smarty3/libs/Smarty.class.php");
 +}
  $smarty = new Smarty;
- $smarty->template_dir = $BASE_DIR.'/ihtml/';
- $smarty->caching= false;
+ $smarty->setCaching(false);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index e452262..c00a57f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,5 @@
+style-robustness.patch
+smarty31.patch
 01_fix_smarty_location.patch
 02_fix_template_location.patch
 03_fix_class_mapping.patch
diff --git a/debian/patches/smarty31.patch b/debian/patches/smarty31.patch
new file mode 100644
index 0000000..ddbe232
--- /dev/null
+++ b/debian/patches/smarty31.patch
@@ -0,0 +1,143 @@
+--- a/gosa-core/html/index.php
++++ b/gosa-core/html/index.php
+@@ -167,6 +167,7 @@
+ 
+ /* Enable compressed output */
+ if ($config->get_cfg_value("core","sendCompressedOutput") != "") {
++    ob_end_clean();
+     ob_start("ob_gzhandler");
+ }
+ 
+--- a/gosa-core/html/main.php
++++ b/gosa-core/html/main.php
+@@ -80,6 +80,7 @@
+ 
+ /* Enable compressed output */
+ if ($config->get_cfg_value("core","sendCompressedOutput") == "true"){
++  ob_end_clean();
+   ob_start("ob_gzhandler");
+ }
+ 
+@@ -110,7 +111,7 @@
+ @DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
+ 
+ /* Set template compile directory */
+-$smarty->compile_dir= $config->get_cfg_value("core","templateCompileDirectory");
++$smarty->setCompileDir($config->get_cfg_value("core","templateCompileDirectory"));
+ $smarty->error_unassigned= true;
+ 
+ /* Set default */
+--- a/gosa-core/html/setup.php
++++ b/gosa-core/html/setup.php
+@@ -60,7 +60,8 @@
+ session::set('errorsAlreadyPosted',array());
+ session::set('LastError',"");
+ 
+-$smarty->compile_dir= "/var/spool/gosa/";
++$smarty->setTemplateDir("$BASE_DIR/setup");
++$smarty->setCompileDir("/var/spool/gosa");
+ if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))){
+ 
+     if(isset($_SERVER['SCRIPT_FILENAME'])){
+@@ -157,6 +158,6 @@
+   $smarty->assign("version","");
+ }
+ 
+-echo $header.$smarty->fetch("../setup/setup_frame.tpl");
++echo $header.$smarty->fetch("setup_frame.tpl");
+ // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
+ ?>
+--- a/gosa-core/include/class_pluglist.inc
++++ b/gosa-core/include/class_pluglist.inc
+@@ -504,10 +504,11 @@
+      */
+     function get_path($index)
+     {
++	global $BASE_DIR;
+         if(!isset($this->dirlist[$index])){
+             return ("");
+         }
+-        return ("../".$this->dirlist[$index]);
++        return ("$BASE_DIR/".$this->dirlist[$index]);
+     }
+ 
+ 
+--- a/gosa-core/include/php_setup.inc
++++ b/gosa-core/include/php_setup.inc
+@@ -297,8 +297,7 @@
+ /* Do smarty setup */
+ require("smarty/Smarty.class.php");
+ $smarty = new Smarty;
+-$smarty->template_dir = $BASE_DIR.'/ihtml/';
+-$smarty->caching= false;
++$smarty->setCaching(false);
+ 
+ // To be able to switch between smarty version 2/3                                                                      
+ if(defined('SMARTY_PHP_REMOVE')){                                                                                       
+--- a/gosa-core/include/smartyAddons/block.t.php
++++ b/gosa-core/include/smartyAddons/block.t.php
+@@ -73,6 +73,11 @@
+ function smarty_block_t($params, $text, &$smarty)
+ {
+ 	$text = stripslashes($text);
++
++	//TODO: need to figure out why this happens for every string...
++	if ($text == "") {
++		return ("");
++	}
+ 	
+ 	// set escape mode
+ 	if (isset($params['escape'])) {
+@@ -119,7 +124,7 @@
+ 				break;
+ 		}
+ 	}
+-	
++
+ 	return $text;
+ }
+ 
+--- a/gosa-core/setup/class_setupStep_Finish.inc
++++ b/gosa-core/setup/class_setupStep_Finish.inc
+@@ -117,7 +117,7 @@
+     $smarty->assign("msg2", sprintf(_("After downloading and placing the file under %s, please make sure that the user the web server is running with is able to read %s, while other users shouldn't. You may want to execute these commands to achieve this requirement:"),CONFIG_DIR,CONFIG_FILE));
+ 
+     $smarty->assign("cv",$this->parent->captured_values);
+-    return($smarty -> fetch (get_template_path("../setup/setup_finish.tpl")));
++    return($smarty->fetch(get_template_path("setup_finish.tpl")));
+   }
+ 
+ 
+--- a/gosa-core/setup/class_setupStep_Ldap.inc
++++ b/gosa-core/setup/class_setupStep_Ldap.inc
+@@ -88,7 +88,7 @@
+       $base_to_append = substr($base_to_append,0,17)."...";
+     }
+     $smarty->assign("base_to_append",$base_to_append);
+-    return($smarty -> fetch (get_template_path("../setup/setup_ldap.tpl")));
++    return($smarty->fetch (get_template_path("setup_ldap.tpl")));
+   }
+ 
+   function get_connection_status()
+--- a/gosa-core/setup/class_setupStep_License.inc
++++ b/gosa-core/setup/class_setupStep_License.inc
+@@ -68,7 +68,7 @@
+     $smarty -> assign("license_found",$this->license_found);
+     $smarty -> assign("accepted",$this->accepted);
+ 
+-    return($smarty -> fetch (get_template_path("../setup/setup_license.tpl")));
++    return($smarty->fetch (get_template_path("setup_license.tpl")));
+   }
+ 
+   
+--- a/gosa-core/setup/class_setupStep_Schema.inc
++++ b/gosa-core/setup/class_setupStep_Schema.inc
+@@ -101,7 +101,7 @@
+             $smarty->assign('message', $message);
+         }
+         $smarty->assign('checkFailed', !$this->is_completed);
+-        return($smarty->fetch (get_template_path("../setup/setup_schema.tpl")));
++        return($smarty->fetch (get_template_path("setup_schema.tpl")));
+     }
+ }
+ 
diff --git a/debian/patches/style-robustness.patch b/debian/patches/style-robustness.patch
new file mode 100644
index 0000000..c6b2183
--- /dev/null
+++ b/debian/patches/style-robustness.patch
@@ -0,0 +1,14 @@
+--- a/gosa-core/include/functions.inc
++++ b/gosa-core/include/functions.inc
+@@ -3576,6 +3576,11 @@
+   }
+   $styles= session::global_get('img-styles');
+ 
++  /* If there's nothing available, just return nothing */
++  if (!array_key_exists($path, $styles)) {
++    return "";
++  }
++
+   /* Extract labels from path */
+   if (preg_match("/\.png\[(.*)\]$/", $path, $matches)) {
+     $label= $matches[1];
diff --git a/debian/rules b/debian/rules
index 05c0e44..4e8a1c3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 
 %:
-	dh $@ --with apache2
+	dh $@
 
 override_dh_compress:
 	dh_compress

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/gosa.git



More information about the debian-edu-commits mailing list