--- gallery-1.2.5.orig/configure.sh
+++ gallery-1.2.5/configure.sh
@@ -1,13 +1,25 @@
 #!/bin/sh
-chmod 755 setup
 
-if [ ! -f config.php ]; then
-    touch config.php
-fi
-if [ ! -f .htaccess ]; then
-    touch .htaccess
+set -e
+
+ROOT=/usr/share/gallery
+CONFDIR=/etc/gallery
+
+if [ `whoami` != "root" ] ; then
+    echo "You must be root to run this script" 2>&1
+    exit 1
 fi
-chmod 666 config.php .htaccess
+
+for file in $CONFDIR/config.php $CONFDIR/htaccess ; do
+    if [ ! -f $file ]; then
+        touch $file
+    fi
+    chown www-data:root $file
+    chmod 644 $file
+done
+
+chmod 755 $ROOT/setup
+
 
 echo ""
 echo "You are now in setup mode, which is *INSECURE*.  Your Gallery"
@@ -15,7 +27,7 @@
 echo "to the URL to 'setup' in this directory."
 echo ""
 echo "When you are done with your installation, don't forget to"
-echo "run the secure.sh script!"
+echo "run the secure.sh script as root!"
 echo ""
-echo "    % sh secure.sh"
+echo "    # $ROOT/secure.sh"
 echo ""
--- gallery-1.2.5.orig/delete_photo.php
+++ gallery-1.2.5/delete_photo.php
@@ -33,12 +33,25 @@
 if (!$gallery->user->canDeleteFromAlbum($gallery->album)) {
 	exit;
 }
-	
-if ($confirm && isset($index)) {
+
+if (isset($id)) {
+        $index = $gallery->album->getPhotoIndex($id);
+}
+
+if ($confirm && isset($id)) {
 	if ($albumDelete) {
-		$myAlbum = $gallery->album->getNestedAlbum($index);
-		$myAlbum->delete();
+		/* Track down the corresponding photo index and remove it */
+		$index = 0;
+		for ($i = 1; $i <= sizeof($gallery->album->photos); $i++) {
+		    $photo = $gallery->album->getPhoto($i);
+		    if (isset($photo->isAlbumName) && !strcmp($photo->isAlbumName, $id)) {
+			/* Found it */
+			$index = $i;
+			break;
+		    }
+		}
 	}
+
 	$gallery->album->deletePhoto($index);
 	$gallery->album->save();
 	dismissAndReload();
@@ -55,7 +68,7 @@
 
 
 <?
-if ($gallery->album && isset($index)) {
+if ($gallery->album && isset($id)) {
 	if (isset($albumDelete)) {
 ?>
 
@@ -67,7 +80,8 @@
 <br>
 <br>
 <?
-$myAlbum = $gallery->album->getNestedAlbum($index);
+$myAlbum = new Album();
+$myAlbum->load($id);
 ?>
 <?= $myAlbum->getHighlightTag() ?>
 <br>
@@ -80,7 +94,7 @@
 <?= $myAlbum->fields[description] ?>
 <br>
 <?= makeFormIntro("delete_photo.php"); ?>
-<input type=hidden name=index value=<?= $index?>>
+<input type=hidden name=id value=<?= $id?>>
 <input type=hidden name=albumDelete value=<?= $albumDelete?>>
 <input type=submit name=confirm value="Delete">
 <input type=submit value="Cancel" onclick='parent.close()'>
@@ -100,7 +114,7 @@
 <?= $gallery->album->getCaption($index) ?>
 <br>
 <?= makeFormIntro("delete_photo.php"); ?>
-<input type=hidden name=index value=<?= $index?>>
+<input type=hidden name=id value=<?= $id?>>
 <input type=submit name=confirm value="Delete">
 <input type=submit value="Cancel" onclick='parent.close()'>
 </form>
--- gallery-1.2.5.orig/secure.sh
+++ gallery-1.2.5/secure.sh
@@ -1,17 +1,31 @@
 #!/bin/sh
-chmod 0 setup
 
-if [ -f config.php ]; then
-    chmod 644 config.php 
-fi
+set -e
+
+ROOT=/usr/share/gallery
+CONFDIR=/etc/gallery
+SETUPDIR=/var/lib/gallery/setup
 
-if [ -f .htaccess ]; then
-    chmod 644 .htaccess
+if [ `whoami` != "root" ] ; then
+    echo "You must be root to run this script" 2>&1
+    exit 1
 fi
 
+# Change perms back to being owned by root on the config files
+for file in $CONFDIR/config.php $CONFDIR/htaccess; do
+    if [ -s $file ] ; then
+        chown root:root $file
+    else
+        # the file is 0 bytes, remove it as it didn't get written out
+        rm -f $file
+    fi
+done
+
+chmod 700 $ROOT/setup
+
 echo ""
 echo "Your Gallery is now secure and cannot be configured.  If"
-echo "you wish to reconfigure it, run:"
+echo "you wish to reconfigure it, run configure.sh as root:"
 echo ""
-echo "    % sh configure.sh"
+echo "    # $ROOT/configure.sh"
 echo ""
--- gallery-1.2.5.orig/util.php
+++ gallery-1.2.5/util.php
@@ -688,7 +688,6 @@
 	}
 
 	if (fs_file_exists($GALLERY_BASEDIR . "setup") && 
-                !broken_link($GALLERY_BASEDIR . "setup") &&
 		is_readable($GALLERY_BASEDIR . "setup")) {
 		/* 
 		 * on some systems, PHP's is_readable returns false
--- gallery-1.2.5.orig/view_album.php
+++ gallery-1.2.5/view_album.php
@@ -480,10 +480,12 @@
 				if($gallery->album->isAlbumName($i)) { 
 					if($gallery->user->canDeleteAlbum($myAlbum)) {
 						showChoice("Delete $label", "delete_photo.php",
-							array("index" => $i, "albumDelete" => 1));
+							array("id" => $myAlbum->fields["name"],
+							      "albumDelete" => 1));
 					}
 				} else {
-					showChoice("Delete $label", "delete_photo.php", array("index" => $i));
+					showChoice("Delete $label", "delete_photo.php",
+						   array("id" => $id));
 				}
 			}
 			if (($gallery->user->canDeleteFromAlbum($gallery->album)) || 
--- gallery-1.2.5.orig/view_photo.php
+++ gallery-1.2.5/view_photo.php
@@ -289,7 +289,7 @@
 
 	if ($gallery->user->canDeleteFromAlbum($gallery->album)) {
 		$adminCommands .= '<a href="#" onClick="'.
-			popup("delete_photo.php?index=$index").';return false"><nobr>[delete photo]</nobr></a>';
+			popup("delete_photo.php?id=$id").';return false"><nobr>[delete photo]</nobr></a>';
 	}
 
 	if (!strcmp($gallery->album->fields["use_fullOnly"], "yes")) {
--- gallery-1.2.5.orig/css/standalone_style.css.default
+++ gallery-1.2.5/css/standalone_style.css.default
@@ -31,7 +31,7 @@
 */
 BODY  
 	{ 
-	  background-color: #CCCC99;
+	  background-color: #ffffff;
 	  color: #000000;
 	}
 TD, P 
--- gallery-1.2.5.orig/errors/configmode.php
+++ gallery-1.2.5/errors/configmode.php
@@ -1,3 +1,12 @@
+<?
+// Hack prevention.
+if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
+            print "Security violation\n";
+	            exit;
+		    }
+?>
 <? require($GALLERY_BASEDIR . "errors/configure_instructions.php") ?>
 <html>
 <head>
--- gallery-1.2.5.orig/errors/needinit.php
+++ gallery-1.2.5/errors/needinit.php
@@ -1,3 +1,12 @@
+<?
+// Hack prevention.
+if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
+            print "Security violation\n";
+	            exit;
+		    }
+?>
 <? require($GALLERY_BASEDIR . "errors/configure_instructions.php") ?>
 <html>
 <head>
--- gallery-1.2.5.orig/errors/reconfigure.php
+++ gallery-1.2.5/errors/reconfigure.php
@@ -1,3 +1,12 @@
+<?
+// Hack prevention.
+if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
+            print "Security violation\n";
+	            exit;
+		    }
+?>
 <? require($GALLERY_BASEDIR . "errors/configure_instructions.php") ?>
 <html>
 <head>
--- gallery-1.2.5.orig/errors/unconfigured.php
+++ gallery-1.2.5/errors/unconfigured.php
@@ -1,3 +1,12 @@
+<?
+// Hack prevention.
+if (!empty($HTTP_GET_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_POST_VARS["GALLERY_BASEDIR"]) ||
+                    !empty($HTTP_COOKIE_VARS["GALLERY_BASEDIR"])) {
+            print "Security violation\n";
+	            exit;
+		    }
+?>
 <? require($GALLERY_BASEDIR . "errors/configure_instructions.php") ?>
 <html>
 <head>
--- gallery-1.2.5.orig/errors/configure_instructions.php
+++ gallery-1.2.5/errors/configure_instructions.php
@@ -7,18 +7,7 @@
    <td>
     <code>
      <br> <b>Unix</b> with shell access
-     <br> % cd /path/to/your/gallery
-     <br> % sh ./<?=$cmd?>.sh
-     <br>
-     <br> <b>Unix</b> with FTP access
-     <br> ftp> chmod <?= configure_filemode($cmd) ?> .htaccess
-     <br> ftp> chmod <?= configure_filemode($cmd) ?> config.php
-     <br> ftp> chmod <?= configure_dirmode($cmd) ?> setup
-     <br>
-     <br> <b>Windows</b>
-     <br> C:\> cd \path\to\your\gallery
-     <br> C:\> <?=$cmd?>.bat
-     <br>
+     <br> % /usr/share/gallery/<?=$cmd?>.sh
      <br>
    </td>
   </tr>
@@ -42,4 +31,5 @@
 		return 0;
 	}
 }
-?>
\ No newline at end of file
+?>
+
--- gallery-1.2.5.orig/setup/config_data.inc
+++ gallery-1.2.5/setup/config_data.inc
@@ -138,7 +138,7 @@
 		"prompt" => "Temporary directory",
 		"desc" => "The filesystem path to a temporary directory.  Eg. <i>/tmp</i> or " .
 			"<i>c:\\windows\\temp</i>",
-		"value" => getenv("TMP"),
+		"value" => "/tmp",
 		"filename" => 1,
 		"require-write-dir" => 1,
 		"attrs" => array("size" => 50),
@@ -356,7 +356,7 @@
 	"print_photos" => array(
 		"prompt" => "Printing Service",
 		"desc" => "Allow visitors to print photos directly from the album.",
-		"value" => "shutterfly",
+		"value" => "none",
 		"choices" => array("none", "shutterfly")
 	),
 	"returnto" => array(
--- gallery-1.2.5.orig/setup/confirm.inc
+++ gallery-1.2.5/setup/confirm.inc
@@ -12,7 +12,7 @@
 <pre>
 
 <?
-require("../Version.php");
+require("/usr/share/gallery/Version.php");
 
 $error = 0;
 
--- gallery-1.2.5.orig/setup/functions.inc
+++ gallery-1.2.5/setup/functions.inc
@@ -211,7 +211,7 @@
 		fs_executable("giftopnm"), 
 		fs_executable("pngtopnm"), 
 		fs_executable("ppmtojpeg"), 
-		fs_executable("ppmtogif"), 
+#		fs_executable("ppmtogif"), 
 		fs_executable("pnmtopng"), 
 		fs_executable("pnmscale"), 
 		fs_executable("pnmfile"),
--- gallery-1.2.5.orig/setup/index.php
+++ gallery-1.2.5/setup/index.php
@@ -11,11 +11,11 @@
 <body>
 
 <?
-require("../util.php");
+require("/usr/share/gallery/util.php");
 require("functions.inc");
 
-if (fs_file_exists("../config.php")) {
-	include("../config.php");
+if (fs_file_exists("/usr/share/gallery/config.php")) {
+	include("/usr/share/gallery/config.php");
 }
 
 if (function_exists("posix_getpwuid")) {
--- gallery-1.2.5.orig/setup/init.php
+++ gallery-1.2.5/setup/init.php
@@ -7,7 +7,7 @@
 error_reporting(E_ALL & ~E_NOTICE);
 
 if (substr(PHP_OS, 0, 3) == 'WIN') {
-	include("../platform/fs_win32.php");
+	include("/usr/share/gallery/platform/fs_win32.php");
 	if (fs_file_exists("SECURE")) {
 ?>
 Gallery is in secure mode and cannot be configured.
@@ -17,7 +17,7 @@
 		exit;
 	}
 } else {
-	include("../platform/fs_unix.php");
+	include("/usr/share/gallery/platform/fs_unix.php");
 }
 
 /* 
--- gallery-1.2.5.orig/setup/write.inc
+++ gallery-1.2.5/setup/write.inc
@@ -1,9 +1,9 @@
 <?
-require("../classes/User.php");
-require("../classes/gallery/User.php");
-require("../classes/NobodyUser.php");
-require("../classes/EverybodyUser.php");
-require("../errors/configure_instructions.php");
+require("/usr/share/gallery/classes/User.php");
+require("/usr/share/gallery/classes/gallery/User.php");
+require("/usr/share/gallery/classes/NobodyUser.php");
+require("/usr/share/gallery/classes/EverybodyUser.php");
+require("/usr/share/gallery/errors/configure_instructions.php");
 
 $outfile = "$GALLERY_DIR/config.php";
 copy("gpl.txt", $outfile);
@@ -66,9 +66,9 @@
  * Don't require UserDB before we've written and included config.php or it will
  * have a cow when it tries to verify that the $gallery->app->userDir exists.
  */
-include("../config.php");
-include("../classes/UserDB.php");
-include("../classes/gallery/UserDB.php");
+include("/usr/share/gallery/config.php");
+include("/usr/share/gallery/classes/UserDB.php");
+include("/usr/share/gallery/classes/gallery/UserDB.php");
 
 $userDB = new Gallery_UserDB();
 $admin = $userDB->getOrCreateUser("admin");
--- gallery-1.2.5.orig/search.php
+++ gallery-1.2.5/search.php
@@ -46,7 +46,7 @@
 includeHtmlWrap("search.header");
 ?>
 <?
-$searchString = removeTags($searchstring);
+$searchstring = removeTags($searchstring);
 if ($searchstring) {
 ?>
 <table width=100% border=0 cellspacing=0>
--- gallery-1.2.5.orig/Version.php
+++ gallery-1.2.5/Version.php
@@ -38,7 +38,7 @@
 	$gallery = new stdClass();
 }
 
-$gallery->version = "1.2.5";
+$gallery->version = "1.2.5-debian7.woody.0";
 $gallery->config_version = 26;
 $gallery->album_version = 4;
 $gallery->remote_protocol_version = 1;
--- gallery-1.2.5.orig/debian/README.Debian
+++ gallery-1.2.5/debian/README.Debian
@@ -0,0 +1,54 @@
+gallery for Debian
+------------------
+
+CONFIGURATION
+-------------
+
+Gallery is configure through a web-based configurator. Quick steps to configure
+gallery are:
+    1. as root, run /usr/share/gallery/configure.sh
+    2. goto your gallery url with a browser (e.g. http://my.site.com/gallery)
+    3. configure using the web interface and save configuration
+    4. as root, run /usr/share/gallery/secure.sh (VERY IMPORTANT)
+
+You can now login as the admin user.
+
+See /usr/share/doc/gallery/README.gz for more instructions on configuring
+gallery (you may also want to read the DEBIAN CHANGES section as well).
+
+
+CSS/HTML_WRAP MODIFICATIONS
+---------------------------
+The default stylesheets (e.g. filename.default) in /usr/share/gallery/css can
+be overriden by creating a filename without the ".default" extension in
+/etc/gallery (e.g. /etc/gallery/filename).
+
+The same is true for the files in /usr/share/gallery/html_wrap.
+
+
+DEBIAN CHANGES
+--------------
+
+The following changes have been made to the upstream gallery source for the
+Debian package.
+
+Functional/Layout Changes:
+
+    . files symlinked into other portions of the fs for FHS compliance:
+
+        gallery/setup                   -> /var/lib/gallery/setup
+        gallery/.htaccess               -> /etc/gallery/htaccess
+        gallery/config.php              -> /etc/gallery/config.php
+        gallery/css/stanalone_style.css -> /etc/gallery/stanalone_style.css
+        gallery/css/embedded_style.css  -> /etc/gallery/embedded_style.css
+
+    . changes to setup.sh and configure.sh to work with debian config scheme
+
+Cosmetic Changes:
+
+    . change default css to have a white background
+
+    . tiny change in configure instructions to exclude extra instructions for
+      Windows users
+
+ -- Adam Lazur <zal@debian.org>, Fri, 07 Dec 2001 11:00:38 -0500
--- gallery-1.2.5.orig/debian/apache.conf
+++ gallery-1.2.5/debian/apache.conf
@@ -0,0 +1,15 @@
+# $Id: apache.conf,v 1.2 2001/12/07 14:57:57 laz Exp $
+
+Alias /gallery /usr/share/gallery
+
+<Directory /usr/share/gallery>
+  Options FollowSymLinks
+  AllowOverride Limit Options FileInfo
+</Directory>
+
+# some people prefer a simple URL like http://gallery.example.com
+#<VirtualHost 1.2.3.4>
+#  DocumentRoot /usr/share/gallery
+#  ServerName gallery.example.com
+#</VirtualHost>
+
--- gallery-1.2.5.orig/debian/changelog
+++ gallery-1.2.5/debian/changelog
@@ -0,0 +1,58 @@
+gallery (1.2.5-8woody1) stable-security; urgency=high
+
+  * Non-maintainer upload by the Security Team
+  * Fix cross-site scripting in searchstring parameter
+    (CAN-2003-0614)
+    [search.php]
+
+ -- Matt Zimmerman <mdz@debian.org>  Wed, 30 Jul 2003 19:06:54 -0400
+
+gallery (1.2.5-7.woody.0) stable-security; urgency=high
+
+  * SECURITY: fix from upstream CVS to stop remote command execution through
+    $GALLERY_BASEDIR var.
+
+ -- Adam Lazur <zal@debian.org>  Wed, 31 Jul 2002 11:22:04 -0400
+
+gallery (1.2.5-6) unstable; urgency=high
+
+  * add apache-perl to apache depends possibility              (closes: #140750)
+  * add a Recommends for jhead                                 (closes: #140801)
+  * integrate upstream patch (and fix) for photo delete bug    (closes: #141355)
+  * move unzip to Recommends
+
+ -- Adam Lazur <zal@debian.org>  Wed, 10 Apr 2002 22:27:11 -0400
+
+gallery (1.2.5-5) unstable; urgency=high
+
+  * delete photos by name instead of by id to avoid stale submission bug which
+    may result in the wrong photo being deleted (closes: #135457)
+
+ -- Adam Lazur <zal@debian.org>  Mon, 18 Mar 2002 22:04:02 -0500
+
+gallery (1.2.5-4) unstable; urgency=low
+
+  * add links for customizations in html_wrap dir to point to /etc/gallery
+
+ -- Adam Lazur <zal@debian.org>  Wed, 19 Dec 2001 14:58:52 -0500
+
+gallery (1.2.5-3) unstable; urgency=medium
+
+  * Remove failure for not finding ppmtogif if netpbm-nonfree is not installed
+    (closes: bug#125756)
+
+ -- Adam Lazur <zal@debian.org>  Wed, 19 Dec 2001 00:01:48 -0500
+
+gallery (1.2.5-2) unstable; urgency=low
+
+  * Fix typo in netpbm-nonfree in Suggests field
+  * Add lintian override for directory perms on /var/lib/gallery/setup
+  * make it arch all instead of arch any (doh)
+
+ -- Adam Lazur <zal@debian.org>  Thu, 13 Dec 2001 11:04:02 -0500
+
+gallery (1.2.5-1) unstable; urgency=low
+
+  * Initial Release (closes: bug#120205)
+
+ -- Adam Lazur <zal@debian.org>  Mon, 10 Dec 2001 14:10:11 -0500
--- gallery-1.2.5.orig/debian/control
+++ gallery-1.2.5/debian/control
@@ -0,0 +1,25 @@
+Source: gallery
+Section: web
+Priority: optional
+Maintainer: Adam Lazur <zal@debian.org>
+Build-Depends-Indep: debhelper (>> 3.0.0)
+Standards-Version: 3.5.2
+
+Package: gallery
+Architecture: all
+Depends: apache | apache-ssl | apache-perl, php4, netpbm (>= 9.20), wwwconfig-common
+Suggests: netpbm-nonfree
+Recommends: jhead, unzip
+Description: a web-based photo album written in php
+ Gallery is a web-based photo album with multiple user support. It
+ provides users with the ability to create and maintain their own albums via an
+ intuitive web interface. Photo management includes automatic thumbnail
+ creation, image resizing, rotation, ordering, captioning, searching and more.
+ Albums can have read, write and caption permissions per individual
+ authenticated user for an additional level of privacy.
+ .
+ Created in an effort to prevent well meaning folks from sending obscenely
+ large photos by email, Gallery provides an easy place for friends and
+ relatives to create and maintain their own photo albums.
+ .
+ The upstream web site is: http://gallery.sf.net
--- gallery-1.2.5.orig/debian/copyright
+++ gallery-1.2.5/debian/copyright
@@ -0,0 +1,13 @@
+This package was debianized by Adam Lazur <Adam Lazur <zal@debian.org>> on
+Fri, 30 Nov 2001 10:54:40 -0500.
+
+It was downloaded from http://gallery.sourceforge.net
+
+Upstream Authors: 
+
+Copyright: You are free to distribute this software under the terms of the GNU
+General Public License version 2.
+
+On Debian systems, the complete text of the GNU General Public License can
+be found in /usr/share/common-licenses/GPL file.
+
--- gallery-1.2.5.orig/debian/dirs
+++ gallery-1.2.5/debian/dirs
@@ -0,0 +1,3 @@
+usr/share/gallery
+etc/gallery
+var/lib/gallery/setup
--- gallery-1.2.5.orig/debian/docs
+++ gallery-1.2.5/debian/docs
@@ -0,0 +1,3 @@
+README
+UPGRADING
+todo
--- gallery-1.2.5.orig/debian/gallery.lintian.override
+++ gallery-1.2.5/debian/gallery.lintian.override
@@ -0,0 +1 @@
+gallery: non-standard-dir-perm var/lib/gallery/setup/ 0700 != 0755
--- gallery-1.2.5.orig/debian/links
+++ gallery-1.2.5/debian/links
@@ -0,0 +1,20 @@
+/etc/gallery/config.php /usr/share/gallery/config.php
+/etc/gallery/htaccess /usr/share/gallery/.htaccess
+/etc/gallery/standalone_style.css /usr/share/gallery/css/standalone_style.css
+/etc/gallery/embedded_style.css /usr/share/gallery/css/embedded_style.css
+/var/lib/gallery/setup /usr/share/gallery/setup
+
+/etc/gallery/album.footer /usr/share/gallery/html_wrap/album.footer
+/etc/gallery/album.header /usr/share/gallery/html_wrap/album.header
+/etc/gallery/gallery.footer /usr/share/gallery/html_wrap/gallery.footer
+/etc/gallery/gallery.header /usr/share/gallery/html_wrap/gallery.header
+/etc/gallery/inline_albumthumb.footer /usr/share/gallery/html_wrap/inline_albumthumb.footer
+/etc/gallery/inline_albumthumb.header /usr/share/gallery/html_wrap/inline_albumthumb.header
+/etc/gallery/inline_photo.footer /usr/share/gallery/html_wrap/inline_photo.footer
+/etc/gallery/inline_photo.header /usr/share/gallery/html_wrap/inline_photo.header
+/etc/gallery/photo.footer /usr/share/gallery/html_wrap/photo.footer
+/etc/gallery/photo.header /usr/share/gallery/html_wrap/photo.header
+/etc/gallery/search.footer /usr/share/gallery/html_wrap/search.footer
+/etc/gallery/search.header /usr/share/gallery/html_wrap/search.header
+/etc/gallery/wrapper.footer /usr/share/gallery/html_wrap/wrapper.footer
+/etc/gallery/wrapper.header /usr/share/gallery/html_wrap/wrapper.header
--- gallery-1.2.5.orig/debian/postinst
+++ gallery-1.2.5/debian/postinst
@@ -0,0 +1,51 @@
+#!/bin/sh
+# $Id: postinst,v 1.1 2001/12/04 01:56:21 laz Exp $
+
+set -e
+
+case "$1" in
+    configure)
+
+      # ensure php is enabled
+      phpver=php4
+      phpini=/etc/php4/apache/php.ini
+      server=apache
+      . /usr/share/wwwconfig-common/apache-php.sh
+      if [ "$status" = "uncomment" ] ; then
+        restart="$server $restart"
+      fi
+
+      # ensure php indexes are allowed
+      index=index.php
+      server=apache
+      . /usr/share/wwwconfig-common/apache-index_all.sh
+      if [ "$status" = "added" ] ; then
+        restart="$server $restart"
+      fi
+
+      # include gallery directives
+      server=apache
+      includefile=/etc/gallery/apache.conf
+      . /usr/share/wwwconfig-common/apache-include_all.sh
+      if [ "$status" = "uncomment" -o "$status" = "include" ] ; then
+        restart="$server $restart"
+      fi
+
+      # restart servers if necessary
+      servers="apache-ssl apache"
+      . /usr/share/wwwconfig-common/restart.sh
+
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument: $1" >&2
+        exit 0
+    ;;
+esac
+
+#DEBHELPER#
+
--- gallery-1.2.5.orig/debian/postrm
+++ gallery-1.2.5/debian/postrm
@@ -0,0 +1,45 @@
+#! /bin/sh
+# $Id: postrm,v 1.3 2001/12/07 16:05:29 laz Exp $
+
+set -e
+
+case "$1" in
+       purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+         server=apache
+         includefile=/etc/gallery/apache.conf
+         case "$1" in
+           purge)
+             # remove gallery directives
+             . /usr/share/wwwconfig-common/apache-uninclude_all.sh
+             if [ "$status" = "purge" ] ; then
+               restart="$restart $server"
+             fi
+             ;;
+           remove)
+             # comment out gallery directives
+             . /usr/share/wwwconfig-common/apache-cominclude_all.sh
+             if [ "$status" = "comment" ] ; then
+               restart="$restart $server"
+             fi
+             ;;
+         esac
+
+         # restart servers if necessary
+         servers="apache-ssl apache"
+         . /usr/share/wwwconfig-common/restart.sh
+
+         # remove gallery config if purging
+         if [ $1 = "purge" ] ; then
+           rm -rf /etc/gallery
+         fi
+       ;;
+
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 0
+
+esac
+
+#DEBHELPER#
+
--- gallery-1.2.5.orig/debian/rules
+++ gallery-1.2.5/debian/rules
@@ -0,0 +1,63 @@
+#!/usr/bin/make -f
+# $Id: rules,v 1.18 2001/12/13 16:14:36 laz Exp $
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=3
+
+DESTDIR=$(CURDIR)/debian/gallery
+GDIR=$(DESTDIR)/usr/share/gallery
+GCONFDIR=$(DESTDIR)/etc/gallery
+GVARDIR=$(DESTDIR)/var/lib/gallery
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	dh_clean
+
+install:
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+# commands to install the files into debian/gallery.
+	install -m 755 -d $(GDIR)
+	install -m 755 -d $(GCONFDIR)
+	install -m 755 -d $(GVARDIR)
+	install -m 755 -d $(DESTDIR)/usr/share/lintian/overrides
+	install -m 700 -d $(GVARDIR)/setup
+	install -m 755 -o www-data -d $(DESTDIR)/var/www/albums
+	install -m 755 secure.sh configure.sh $(GDIR)
+	install -m 644 *.php $(GDIR)
+	for dir in classes css errors html html_wrap images java layout platform ; do \
+	    cp -ar $$dir $(GDIR)/$$dir ; \
+	    find $(GDIR)/$$dir -type f -exec chmod 644 {} \; ;\
+	done
+	install -m 644 setup/* setup/.??* $(GVARDIR)/setup
+	install -m 644 debian/apache.conf $(GCONFDIR)
+	install -m 644 debian/gallery.lintian.override $(DESTDIR)/usr/share/lintian/overrides/gallery
+
+build:
+
+# Build architecture-independent files here.
+binary-indep: install
+# We have nothing to do by default.
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installchangelogs ChangeLog
+	dh_link
+	dh_fixperms -Xalbums -Xsetup
+	dh_compress
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep
+.PHONY: clean binary-indep install
