head	1.12;
access;
symbols
	HORDE_1_2_7:1.1.2.71
	HORDE_1_2_6:1.1.2.71
	HORDE_1_2_5:1.1.2.71
	HORDE_1_2_4:1.1.2.66
	HORDE_1_2_3:1.1.2.63
	HORDE_1_2_2:1.1.2.61
	HORDE_1_2_1:1.1.2.60
	HORDE_1_2_0:1.1.2.59
	HORDE_1_2_0_pre14:1.1.2.61
	HORDE_1_2_0_pre13:1.1.2.57
	HORDE_1_2_0_pre11:1.1.2.49
	HORDE_1_3_2:1.10
	HORDE_1_2_0_pre10:1.1.2.34
	HORDE_1_3_1:1.10
	HORDE_1_2_0_pre9:1.1.2.31
	HORDE_1_2_0_pre8:1.1.2.31
	HORDE_1_2_0_pre6:1.1.2.27
	horde-dev-20000104:1.10
	HORDE_1_2_0_pre5:1.1.2.13
	HORDE_1_2_0_pre4:1.1.2.4
	HORDE_1_2_0_pre3:1.1.2.1
	HORDE_1_2_0_pre2:1.1
	HORDE_1_2_0_pre1:1.1
	STABLE_1_2__1_2_0_pre1:1.1
	horde__1_2_0_pre1:1.1
	STABLE_1_2:1.1.0.2;
locks; strict;
comment	@# @;


1.12
date	2000.05.22.11.13.11;	author rkrusty;	state dead;
branches;
next	1.11;

1.11
date	2000.02.15.07.48.37;	author rkrusty;	state Exp;
branches;
next	1.10;

1.10
date	99.10.26.11.16.24;	author rkrusty;	state Exp;
branches;
next	1.9;

1.9
date	99.10.15.02.59.28;	author rkrusty;	state Exp;
branches;
next	1.8;

1.8
date	99.10.15.01.52.50;	author rkrusty;	state Exp;
branches;
next	1.7;

1.7
date	99.09.10.09.36.00;	author rkrusty;	state Exp;
branches;
next	1.6;

1.6
date	99.08.24.01.01.52;	author rkrusty;	state Exp;
branches;
next	1.5;

1.5
date	99.08.19.17.21.25;	author rkrusty;	state Exp;
branches;
next	1.4;

1.4
date	99.08.19.17.21.23;	author rkrusty;	state Exp;
branches;
next	1.3;

1.3
date	99.08.19.15.44.21;	author rkrusty;	state Exp;
branches;
next	1.2;

1.2
date	99.08.11.06.27.34;	author rkrusty;	state Exp;
branches;
next	1.1;

1.1
date	99.08.04.04.51.02;	author mhardy;	state Exp;
branches
	1.1.2.1;
next	;

1.1.2.1
date	99.08.10.11.48.28;	author rkrusty;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	99.08.13.12.06.57;	author rkrusty;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	99.08.18.05.55.40;	author rkrusty;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	99.08.20.11.13.48;	author rkrusty;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	99.10.10.16.52.07;	author rkrusty;	state Exp;
branches;
next	1.1.2.6;

1.1.2.6
date	99.10.14.04.27.54;	author rkrusty;	state Exp;
branches;
next	1.1.2.7;

1.1.2.7
date	99.10.14.05.09.57;	author rkrusty;	state Exp;
branches;
next	1.1.2.8;

1.1.2.8
date	99.10.14.06.22.54;	author rkrusty;	state Exp;
branches;
next	1.1.2.9;

1.1.2.9
date	99.10.15.00.12.22;	author rkrusty;	state Exp;
branches;
next	1.1.2.10;

1.1.2.10
date	99.10.15.02.13.56;	author rkrusty;	state Exp;
branches;
next	1.1.2.11;

1.1.2.11
date	99.10.19.04.39.53;	author rkrusty;	state Exp;
branches;
next	1.1.2.12;

1.1.2.12
date	99.10.20.07.02.09;	author rkrusty;	state Exp;
branches;
next	1.1.2.13;

1.1.2.13
date	99.10.20.17.06.09;	author rkrusty;	state Exp;
branches;
next	1.1.2.14;

1.1.2.14
date	99.10.27.04.17.26;	author rkrusty;	state Exp;
branches;
next	1.1.2.15;

1.1.2.15
date	99.11.01.06.18.51;	author rkrusty;	state Exp;
branches;
next	1.1.2.16;

1.1.2.16
date	99.11.01.11.09.33;	author rkrusty;	state Exp;
branches;
next	1.1.2.17;

1.1.2.17
date	99.11.02.07.58.07;	author rkrusty;	state Exp;
branches;
next	1.1.2.18;

1.1.2.18
date	99.11.16.08.52.31;	author rkrusty;	state Exp;
branches;
next	1.1.2.19;

1.1.2.19
date	99.11.28.09.54.33;	author rkrusty;	state Exp;
branches;
next	1.1.2.20;

1.1.2.20
date	99.11.30.03.34.12;	author rkrusty;	state Exp;
branches;
next	1.1.2.21;

1.1.2.21
date	99.12.04.22.35.25;	author rkrusty;	state Exp;
branches;
next	1.1.2.22;

1.1.2.22
date	99.12.04.22.40.48;	author rkrusty;	state Exp;
branches;
next	1.1.2.23;

1.1.2.23
date	99.12.05.06.44.44;	author rkrusty;	state Exp;
branches;
next	1.1.2.24;

1.1.2.24
date	99.12.06.00.36.33;	author rkrusty;	state Exp;
branches;
next	1.1.2.25;

1.1.2.25
date	99.12.20.21.51.39;	author rkrusty;	state Exp;
branches;
next	1.1.2.26;

1.1.2.26
date	2000.01.08.19.19.37;	author rkrusty;	state Exp;
branches;
next	1.1.2.27;

1.1.2.27
date	2000.01.08.20.35.47;	author rkrusty;	state Exp;
branches;
next	1.1.2.28;

1.1.2.28
date	2000.01.16.18.56.20;	author rkrusty;	state Exp;
branches;
next	1.1.2.29;

1.1.2.29
date	2000.01.18.06.09.35;	author rkrusty;	state Exp;
branches;
next	1.1.2.30;

1.1.2.30
date	2000.01.21.03.36.23;	author rkrusty;	state Exp;
branches;
next	1.1.2.31;

1.1.2.31
date	2000.01.21.04.36.02;	author rkrusty;	state Exp;
branches;
next	1.1.2.32;

1.1.2.32
date	2000.01.24.17.34.18;	author rkrusty;	state Exp;
branches;
next	1.1.2.33;

1.1.2.33
date	2000.01.24.19.40.49;	author rkrusty;	state Exp;
branches;
next	1.1.2.34;

1.1.2.34
date	2000.01.25.05.48.17;	author rkrusty;	state Exp;
branches;
next	1.1.2.35;

1.1.2.35
date	2000.02.01.07.21.43;	author rkrusty;	state Exp;
branches;
next	1.1.2.36;

1.1.2.36
date	2000.02.02.23.11.56;	author rkrusty;	state Exp;
branches;
next	1.1.2.37;

1.1.2.37
date	2000.02.04.21.55.05;	author rkrusty;	state Exp;
branches;
next	1.1.2.38;

1.1.2.38
date	2000.02.04.22.34.50;	author rkrusty;	state Exp;
branches;
next	1.1.2.39;

1.1.2.39
date	2000.02.07.05.52.09;	author rkrusty;	state Exp;
branches;
next	1.1.2.40;

1.1.2.40
date	2000.02.09.05.02.01;	author rkrusty;	state Exp;
branches;
next	1.1.2.41;

1.1.2.41
date	2000.02.10.01.11.12;	author rkrusty;	state Exp;
branches;
next	1.1.2.42;

1.1.2.42
date	2000.02.11.06.58.07;	author rkrusty;	state Exp;
branches;
next	1.1.2.43;

1.1.2.43
date	2000.02.21.01.13.25;	author rkrusty;	state Exp;
branches;
next	1.1.2.44;

1.1.2.44
date	2000.03.09.01.33.07;	author rkrusty;	state Exp;
branches;
next	1.1.2.45;

1.1.2.45
date	2000.03.09.01.37.03;	author rkrusty;	state Exp;
branches;
next	1.1.2.46;

1.1.2.46
date	2000.03.23.03.00.28;	author rkrusty;	state Exp;
branches;
next	1.1.2.47;

1.1.2.47
date	2000.03.30.07.25.34;	author rkrusty;	state Exp;
branches;
next	1.1.2.48;

1.1.2.48
date	2000.04.01.03.30.41;	author rkrusty;	state Exp;
branches;
next	1.1.2.49;

1.1.2.49
date	2000.04.03.09.07.51;	author rkrusty;	state Exp;
branches;
next	1.1.2.50;

1.1.2.50
date	2000.04.05.04.43.48;	author rkrusty;	state Exp;
branches;
next	1.1.2.51;

1.1.2.51
date	2000.04.05.04.49.48;	author rkrusty;	state Exp;
branches;
next	1.1.2.52;

1.1.2.52
date	2000.04.17.11.41.23;	author rkrusty;	state Exp;
branches;
next	1.1.2.53;

1.1.2.53
date	2000.04.26.04.43.22;	author rkrusty;	state Exp;
branches;
next	1.1.2.54;

1.1.2.54
date	2000.05.18.20.23.25;	author rkrusty;	state Exp;
branches;
next	1.1.2.55;

1.1.2.55
date	2000.05.21.03.51.13;	author rkrusty;	state Exp;
branches;
next	1.1.2.56;

1.1.2.56
date	2000.05.22.07.31.32;	author rkrusty;	state Exp;
branches;
next	1.1.2.57;

1.1.2.57
date	2000.05.30.03.58.18;	author rkrusty;	state Exp;
branches;
next	1.1.2.58;

1.1.2.58
date	2000.07.16.10.46.08;	author rkrusty;	state Exp;
branches;
next	1.1.2.59;

1.1.2.59
date	2000.07.18.23.59.05;	author rkrusty;	state Exp;
branches;
next	1.1.2.60;

1.1.2.60
date	2000.09.05.08.43.24;	author rkrusty;	state Exp;
branches;
next	1.1.2.61;

1.1.2.61
date	2000.09.11.06.14.43;	author rkrusty;	state Exp;
branches;
next	1.1.2.62;

1.1.2.62
date	2000.09.21.09.47.12;	author rkrusty;	state Exp;
branches;
next	1.1.2.63;

1.1.2.63
date	2000.09.25.04.06.15;	author rkrusty;	state Exp;
branches;
next	1.1.2.64;

1.1.2.64
date	2000.10.18.21.16.05;	author rkrusty;	state Exp;
branches;
next	1.1.2.65;

1.1.2.65
date	2000.11.16.21.57.51;	author rkrusty;	state Exp;
branches;
next	1.1.2.66;

1.1.2.66
date	2000.11.18.13.13.10;	author rkrusty;	state Exp;
branches;
next	1.1.2.67;

1.1.2.67
date	2001.02.06.19.58.36;	author opal;	state Exp;
branches;
next	1.1.2.68;

1.1.2.68
date	2001.02.07.09.23.50;	author opal;	state Exp;
branches;
next	1.1.2.69;

1.1.2.69
date	2001.02.26.20.12.58;	author opal;	state Exp;
branches;
next	1.1.2.70;

1.1.2.70
date	2001.03.27.09.29.03;	author opal;	state Exp;
branches;
next	1.1.2.71;

1.1.2.71
date	2001.04.30.21.10.37;	author opal;	state Exp;
branches;
next	;


desc
@@


1.12
log
@[IEM] cleaning out the debian dir to prepare for the new stuff...nice clean
start. :)
@
text
@#!/bin/sh -e
# Horde postinst script using debconf
# written by Ivan E. Moore II <rkrusty@@tdyc.com> with help from
# debconf examples and tons of other references
#
# All questions should have been asked via debconf 
# now we just go get those, build a temp file which we read in and
# then build our config files and set everthing up

# Source debconf library
. /usr/share/debconf/confmodule
db_version 2.0

# Determine automatic or manual configuration
db_get "horde/debconf"
debconf="$RET"

# If automatic, ask questions, otherwise, read the file
if [ "$debconf" = "yes" ]; then
  db_get "horde/horde_root_url"
  horde_root_url="$RET"
  db_get "horde/horde_graphics_url"
  horde_graphics_url="$RET"
  db_get "horde/faq_url"
  faq_url="$RET"
  db_get "horde/horde_include_dir"  
  horde_include_dir="$RET"
  db_get "horde/path_to_sendmail"
  path_to_sendmail="$RET"
  db_get "horde/signup"
  signup="$RET"
  db_get "horde/signup_email"
  signup_email="$RET"
  db_get "horde/problem_reporting"
  problem_reporting="$RET"
  db_get "horde/problem_email"
  problem_email="$RET"
else
  # Read in template
  . /etc/horde/horde.php.in
fi

db_get "horde/database_type"
dbtype="$RET"
db_get "horde/database_server"
dbserver="$RET"
db_get "horde/database_name"
dbname="$RET"
db_get "horde/database_user"
dbuser="$RET"
db_get "horde/database_pass"
dbpass="$RET"
db_get "horde/mysql_pass"
mysqlpass="$RET"
db_get "horde/webserver_type"
webtype="$RET"
db_get "horde/dbconfigured"
dbconfigured="$RET"
db_get "horde/dblocal"
dblocal="$RET"
db_get "horde/horderecheck"
hrecheck="$RET"
db_get "horde/restart"
restart="$RET"

# These shortnames allow us to make sed statements common
case $dbtype in
  MySql)
    mydbtype="mysql"
    ;;
  PostgreSQL)
    mydbtype="pgsql"
    ;;
esac

# Translation allows us to use this value on the command line
case $dbpass in
  none)
    mydbpass=
    ;;
  *)
    mydbpass=$dbpass
    ;;
esac

# Allows us to loop and substitute in one pass
case $webtype in
  Apache)
    mywebtype="apache"
    ;;
  Apache-SSL)
    mywebtype="apache-ssl"
    ;;
  Both)
    mywebtype="apache apache-ssl"
    ;;
esac

# php extensions to verify
extensions="$mydbtype"

/bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc.in > /etc/horde/horde_phplib.inc

/bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/${mydbtype}_create.sql.in > /etc/horde/${mydbtype}_create.sql

/bin/sed -e "s#@@dbtype@@#${mydbtype}#" /etc/horde/prepend.php.in > /etc/horde/prepend.php

db_input "critical" "horde/horderecheck" || true
db_go


# If we're asked to check others' files
if [ "$hrecheck" = "yes" ]; then
  echo "Checking non-HORDE config files"
if [ "$dblocal" = "yes" ]; then
  if [ "$dbtype" = "PostgreSQL" ]; then
    chown postgres /etc/horde/pgsql_create.sql
    if [ -f /etc/postgresql/postmaster.init ]; then
      /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
      cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.bak > /dev/null 2>&1
      if grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1; then
        mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init >/dev/null 2>&1;
      fi
      # FIXME: You shouldn't go around doing people's databases like this
      if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
        /etc/init.d/postgresql restart >/dev/null 2>&1
        sleep 2
      fi
    else
      echo "      **** WARNING ****  "
      echo "You stated your using PostgreSQL as a database and"
      echo "that it is local yet the install program cannot seem"
      echo "to find the config files for it.  The install program"
      echo "will NOT confiugre your database for use with HORDE"
      echo "and thus will not function properly until you get this"
      echo "fixed.  "
      echo " "
      echo "Please press ENTER"
      read q
    fi
  fi
fi

  # Check for php files
  if [ -f /etc/php3/apache/php3.ini ]; then
    # Make sure all the extensions are being loaded
    for ext in "$extensions"; do
      echo "checking for $ext php3 extension configuration"
      if egrep "^[[:space:]]*extension.*$ext\.so" /etc/php3/apache/php3.ini >/dev/null 2>&1; then
        echo "php3 extension for $ext found!"
      else
        echo "php3 extension for $ext added!"
        echo "extension=$ext.so" >>/etc/php3/apache/php3.ini
      fi
    done
  fi
  # Check for php4 files
  if [ -f /etc/php4/apache/php.ini ]; then
    # Make sure all the extensions are being loaded
    for ext in "$extensions"; do
      echo "checking for $ext php4 extension configuration"
      if egrep "^[[:space:]]*extension.*$ext\.so" /etc/php4/apache/php.ini >/dev/null 2>&1; then
        echo "php4 extension for $ext found!"
      else
        echo "php4 extension for $ext added!"
        echo "extension=$ext.so" >>/etc/php4/apache/php.ini
      fi
    done
  fi

  # Make sure all our web servers are appropriately configured.
  for server in $mywebtype; do
    /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/$server/httpd.conf > /etc/$server/httpd.conf.tmp
    cp /etc/$server/httpd.conf /etc/$server/httpd.conf.horde.back >/dev/null 2>&1
    if grep 'php3_module' /etc/$server/httpd.conf.tmp >/dev/null 2>&1; then
      mv /etc/$server/httpd.conf.tmp /etc/$server/httpd.conf
    fi
    if grep 'Added for HORDE' /etc/$server/access.conf >/dev/null 2>&1; then
      echo "HORDE settings in /etc/$server/access.conf found!"
    else
      echo "HORDE settings in /etc/$server/access.conf added"
      cat /usr/share/doc/horde/examples/apache_access.conf.in >>/etc/$server/access.conf
    fi
    if grep 'Added for HORDE' /etc/$server/srm.conf >/dev/null 2>&1; then
      echo "HORDE settings in /etc/$server/srm.conf found!"
    else
      echo "HORDE settings in /etc/$server/srm.conf added!"
      cat /usr/share/doc/horde/examples/apache_srm.conf.in >>/etc/$server/srm.conf
    fi
    if grep 'index.php3' /etc/$server/srm.conf >/dev/null 2>&1; then
      echo "php3 settings in /etc/$server/srm.conf found!"
      /bin/sed -e "s#index.html index.php3#index.html index.php index.php3#" /etc/$server/srm.conf > /etc/$server/srm.conf.new
      if grep 'index.php' /etc/$server/srm.conf.new > /dev/null 2>&1; then
        mv /etc/$server/srm.conf.new /etc/$server/srm.conf
      fi
    else 
      echo "php3 settings in /etc/$server/srm.conf added!"
      /bin/sed -e "s#index.html#index.html index.php index.php3#" /etc/$server/srm.conf > /etc/$server/srm.conf.new
      if grep 'index.php' /etc/$server/srm.conf.new > /dev/null 2>&1; then
        mv /etc/$server/srm.conf.new /etc/$server/srm.conf
      fi
    fi
  done
  echo "Finished checking non-HORDE config files"
else
  echo "Not checking non-HORDE config files.  I hope everything is"
  echo "configured properly..."
fi


if [ "$dblocal" = "yes" ]; then
if [ "$dbconfigured" = "no" ] ; then 
  case $dbtype in
    PostgreSQL)
    if [ -f /etc/postgresql/postmaster.init ]; then
      echo "Trying to configure your PostgreSQL database"
      # FIXME: These statements aren't very robust, they should take
      # into account the possibility of the database being on another
      # host, etc.
      if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
        su postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1" 
        su postgres -c "/usr/bin/psql -q -f /etc/horde/pgsql_create.sql template1 >/dev/null 2>&1" 
        db_set "horde/dbconfigured" "yes"
      else
        echo "Can't setup database because we cannot verify that postgresql"
        echo "was restarted and configured properly"
      fi
    if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
      /etc/init.d/postgresql restart >/dev/null 2>&1
      sleep 2
    fi
    fi
    ;;

    MySql)
    if [ -f /usr/bin/mysql ]; then
      echo "Trying to configure your MySQL database"
      /usr/bin/mysql -f --password=$mydbpass < /etc/horde/mysql_create.sql > /dev/null 2>&1
      /usr/bin/mysql -f --password=$mydbpass -e "flush privileges" > /dev/null 2>&1
      db_set "horde/dbconfigured" "yes"
    else 
      echo "Not configuring MySQL database because we cannot locate"
      echo "the mysql executable"
    fi
    ;;
  esac
else
  echo "Not configuring database at your request..."
fi
else
  echo "Not configuring database since it's not local..."
fi


# Build the code
echo "Building HORDE libraries "
cd /usr/share/horde/lib/src && ./build.pl --database=$altdbtype >> /dev/null 2>&1

# Now let's create the horde.php file needed by HORDE
cat > /etc/horde/horde.php <<EOF
<?php

/*            DO NOT EDIT           */
/*   AUTOMATICALLY GENERATED FILE   */
/* Edit /etc/horde/horde.php.in and then */
/* use update-horde to generate this file */

\$default->horde_root_url	= '$horde_root_url';
\$default->horde_graphics_url	= '$horde_graphics_url';
\$default->faq_url		= '$faq_url';
\$default->horde_include_dir	= '$horde_include_dir';

/* Path to sendmail */
\$default->path_to_sendmail	= '$path_to_sendmail';

/* Problem Reporting */
\$default->problem_email	= '$problem_email';
\$default->problem_reporting	= $problem_reporting;

/* Account Signup */
\$default->signup_email		= '$signup_email';
\$default->signup		= $signup;

?>
EOF

# Make sure the perms are right
echo "Fixing file permissions"
chown -R www-data.www-data /usr/share/horde >> /dev/null 2>&1
chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1
chmod 000 /usr/share/horde/setup.php >> /dev/null 2>&1
chown -R www-data.www-data /etc/horde >> /dev/null 2>&1
chmod 555 `find /etc/horde/ -type f -print ` >/dev/null 2>&1
chmod o-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1
if [ -f /etc/horde/pgsql_create.sql ]; then
  if [ "$dblocal" = "yes" ]; then
    if [ "$dbtype" = "PostgreSQL" ]; then
      chown postgres /etc/horde/pgsql_create.sql
    fi
  fi
fi

if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
  if [ "$dbtype" = "PostgreSQL" ]; then
    if [ -f /etc/postgresql/postmaster.init ]; then
    echo "Restarting PostgreSQL"
    /etc/init.d/postgresql restart > /dev/null 2>&1
    fi
  fi
fi

if [ "$restart" = "webserver" ] || [ "$restart" = "both" ]; then
  for server in $mywebtype; do
    echo "Restarting $mywebtype"
    /etc/init.d/$server restart > /dev/null 2>&1
  done
fi

db_stop
echo "All done"
#DEBHELPER#

exit 0

@


1.11
log
@[IEM] first round cleanup of debian package for -dev tree.  Bringing 1.2 stable
branch updates into 1.3-dev tree.
@
text
@@


1.10
log
@[IEM] migrating in changes from 2.2 tree
@
text
@d9 1
d11 2
a12 1
. /usr/share/debconf/confmodule.sh
d14 28
a41 80
# Where the config file is that stores the previous selections
OPTIONS_FILE="/etc/horde/horde.options";
CHOICES_FILE="/etc/horde/horde.choices";
HORDE_FILE="/etc/horde/horde.php3";

# remove choices file if it exists since we will rebuild it from debconf info
if [ -f "$CHOICES_FILE" ]; then
   rm -f $CHOICES_FILE
fi

## Ok set our temp file to use
p=`basename $0`
TMPFILE=`mktemp /tmp/$p.XXXXXX` || exit 1

### Set the shell variable so that it can be sourced in
echo "#!/bin/sh" >>$TMPFILE 
echo "# Config file read in by HORDE setup program" >>$TMPFILE
echo "# Autobuilt by debconf/hordeconf Do not edit" >>$TMPFILE
echo "#" >>$TMPFILE
echo "#  DO NOT EDIT" >>$TMPFILE
echo "#" >>$TMPFILE
echo "# configure program (horde.php3)" >>$TMPFILE

for i in `cat $OPTIONS_FILE | grep -v "#"`; do
  db_get "horde/$i"
  echo "$i=\"$RET\";" >>$TMPFILE
done

db_get "horde/signup"
echo "signup=\"$RET\";" >>$TMPFILE
db_get "horde/signup_email"
echo "signup_email=\"$RET\";" >>$TMPFILE
db_get "horde/problem_reporting"
echo "problem_reporting=\"$RET\";" >>$TMPFILE
db_get "horde/problem_email"
echo "problem_email=\"$RET\";" >>$TMPFILE

# Now drop the newly created file into it's place
mv $TMPFILE $CHOICES_FILE > /dev/null 2>&1;
chmod 755 $CHOICES_FILE
chmod go-rwx $CHOICES_FILE

# Now read the new file in
. $CHOICES_FILE

if [ -f $CHOICES_FILE ]; then
  rm -f $CHOICES_FILE
fi

# Create a new temp file
p=`basename $0`
TMPFILE=`mktemp /tmp/$p.XXXXXX` || exit 1

# Now let's create the horde.php3 file needed by HORDE

echo "<?php" >>$TMPFILE
echo "" >>$TMPFILE
echo "\$default->horde_root_url                 = '$horde_root_url';" >>$TMPFILE
echo "\$default->horde_graphics_url             = '$horde_graphics_url';" >>$TMPFILE
echo "\$default->faq_url                  = '$faq_url';" >>$TMPFILE
echo "\$default->horde_include_dir        = '$horde_include_dir';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Path to sendmail */" >>$TMPFILE
echo "\$default->path_to_sendmail         = '$path_to_sendmail';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Problem Reporting */" >>$TMPFILE
echo "\$default->problem_email             = '$problem_email';" >>$TMPFILE
echo "\$default->problem_reporting         = $problem_reporting;" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Account Signup */" >>$TMPFILE
echo "\$default->signup_email              = '$signup_email';" >>$TMPFILE
echo "\$default->signup                    = $signup;" >>$TMPFILE
echo "" >>$TMPFILE
echo "?>" >>$TMPFILE

# Now lets move that file into place

mv $TMPFILE $HORDE_FILE > /dev/null 2>&1

##  Now take care of the rest of the conf files needing changed
d53 90
d144 26
a169 1
## Now take care of the phplib include file ##
d171 38
a208 1
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.in > /etc/horde/horde_phplib.inc
a209 1
if [ "$dbtype" = "PostgreSQL" ]; then
d211 41
a251 55
 /bin/sed -e "s#@@dbname@@#$dbname#" /usr/share/doc/horde/examples/pgsql_create.sql > /usr/share/doc/horde/examples/pgsql_create.sql.new
 cp /usr/share/doc/horde/examples/pgsql_create.sql /usr/share/doc/horde/examples/pgsql_create.sql.bak >/dev/null 2>&1
 mv /usr/share/doc/horde/examples/pgsql_create.sql.new /usr/share/doc/horde/examples/pgsql_create.sql >/dev/null 2>&1

 /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
 cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.back > /dev/null 2>&1
 if (grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1); 
 then 
   (mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init > /dev/null 2>&1); 
 fi
 /etc/init.d/postgresql restart > /dev/null 2>&1
 sleep 2
 if (grep 'extension' /etc/php3/apache/php3.ini | grep 'pgsql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=pgsql.so' >> /etc/php3/apache/php3.ini); fi 
 /bin/sed -e 's#@@dbtype@@#pgsql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
 cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back
 mv /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1

 # Now do some database stuff

 db_get "horde/dbconfigured"
 if [ "$RET" = "no" ]; then
   PSQL2_QUERY="GRANT SELECT, INSERT, UPDATE ON active_sessions, auth_user, auth_user_md5 TO $dbuser"
   su - postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1"
   su - postgres -c '/usr/bin/psql -q template1 < /usr/share/doc/horde/examples/pgsql_create.sql >/dev/null 2>&1'
   su - postgres -c '/usr/bin/psql -q template1 -c "$PSQL2_QUERY" >/dev/null 2>&1'
   db_set "horde/dbconfigured" "yes"
 fi
 /etc/init.d/postgresql restart > /dev/null 2>&1
 cd /usr/share/horde/lib/src && ./build.pl --database=postgres >> /dev/null 2>&1
fi

if [ "$dbtype" = "MySql" ]; then
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/mysql_create.sql > /usr/share/doc/horde/examples/mysql_create.sql.new
  cp /usr/share/doc/horde/examples/mysql_create.sql /usr/share/doc/horde/examples/mysql_create.sql.bak >/dev/null 2>&1
  mv /usr/share/doc/horde/examples/mysql_create.sql.new /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
  chmod go-rwx /usr/share/doc/horde/examples/mysql_create.sql

  if (grep 'extension' /etc/php3/apache/php3.ini | grep 'imap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=imap.so' >> /etc/php3/apache/php3.ini); fi
  if (grep 'extension' /etc/php3/apache/php3.ini | grep 'ldap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=ldap.so' >> /etc/php3/apache/php3.ini ); fi 
  if (grep 'extension' /etc/php3/apache/php3.ini | grep 'mysql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=mysql.so' >> /etc/php3/apache/php3.ini); fi
        
 /bin/sed -e 's#@@dbtype@@#mysql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
 cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back              
 cp /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1
 db_get "horde/dbconfigured"
 if [ "$RET" = "no" ] ; then 
   if [ "$db_pass" = "none" ] ; then
     /usr/bin/mysql -f < /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
   else
     /usr/bin/mysql -f --password=$db_pass < /usr/share/doc/horde/examples/mysql_create.sql > /dev/null 2>&1
   fi
   db_set "horde/dbconfigured" "yes"
 fi
 /etc/init.d/mysql restart >/dev/null 2>&1
 cd /usr/share/horde/lib/src && ./build.pl --database=mysql >> /dev/null 2>&1
a253 24
db_get "horde/webserver_type"
webtype="$RET";
if [ "$webtype" = "Apache" ] || [ "$webtype" = "Both" ]; then  
  /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache/httpd.conf >/etc/apache/httpd.conf.tmp
  cp /etc/apache/httpd.conf /etc/apache/httpd.conf.horde.back > /dev/null 2>&1
  if (grep 'php3_module' /etc/apache/httpd.conf.tmp >/dev/null 2>&1);
  then
    (mv /etc/apache/httpd.conf.tmp /etc/apache/httpd.conf);
  fi
  if (!(grep 'Added for HORDE' /etc/apache/access.conf >/dev/null 2>&1));  \
  then \
    echo ' ' >> /etc/apache/access.conf ;\
    echo '# Added for HORDE' >> /etc/apache/access.conf ;\
    echo '<Directory /usr/share/horde>' >> /etc/apache/access.conf ;\
    echo 'Options Indexes FollowSymLinks' >> /etc/apache/access.conf ;\
    echo 'AllowOverride None' >> /etc/apache/access.conf ;\
    echo 'order allow,deny' >> /etc/apache/access.conf ;\
    echo 'allow from all' >> /etc/apache/access.conf ;\
    echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache/access.conf ;\
    echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache/access.conf ;\
    echo 'php3_magic_quotes_gpc Off' >> /etc/apache/access.conf ;\
    echo '</Directory>' >> /etc/apache/access.conf ;\
    echo '# End HORDE Configuration Block' >> /etc/apache/access.conf ;\ 
  fi
d255 45
a299 4
  if (!(grep 'Added for HORDE' /etc/apache/srm.conf >/dev/null 2>&1)); \
  then \
    echo '# Added for HORDE' >> /etc/apache/srm.conf ;\
    echo 'Alias /horde /usr/share/horde' >> /etc/apache/srm.conf ;\
a300 1
  /etc/init.d/apache reload >/dev/null 2>&1
a301 22
if [ "$webtype" = "Apache-SSL" ] || [ "$webtype" = "Both" ]; then
  /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache-ssl/httpd.conf >/etc/apache-ssl/httpd.conf.tmp
  cp /etc/apache-ssl/httpd.conf /etc/apache-ssl/httpd.conf.horde.back > /dev/null 2>&1
  if (grep 'php3_module' /etc/apache-ssl/httpd.conf.tmp >/dev/null 2>&1);
  then
    (mv /etc/apache-ssl/httpd.conf.tmp /etc/apache-ssl/httpd.conf);
  fi
  if (!(grep 'Added for HORDE' /etc/apache-ssl/access.conf >/dev/null 2>&1)); \
  then \
    echo ' ' >> /etc/apache-ssl/access.conf ;\
    echo '# Added for HORDE' >> /etc/apache-ssl/access.conf ;\
    echo '<Directory /usr/share/horde>' >> /etc/apache-ssl/access.conf ;\
    echo 'Options Indexes FollowSymLinks' >> /etc/apache-ssl/access.conf ;\
    echo 'AllowOverride None' >> /etc/apache-ssl/access.conf ;\
    echo 'order allow,deny' >> /etc/apache-ssl/access.conf ;\
    echo 'allow from all' >> /etc/apache-ssl/access.conf ;\
    echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache-ssl/access.conf ;\
    echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache-ssl/access.conf ;\
    echo 'php3_magic_quotes_gpc Off' >> /etc/apache-ssl/access.conf ;\
    echo '</Directory>' >> /etc/apache-ssl/access.conf ;\
    echo '# End HORDE Configuration Block' >> /etc/apache-ssl/access.conf ;\
  fi
d303 6
a308 4
  if (!(grep 'Added for HORDE' /etc/apache-ssl/srm.conf >/dev/null 2>&1)); \
  then \
    echo '# Added for HORDE' >> /etc/apache-ssl/srm.conf ;\
    echo 'Alias /horde /usr/share/horde' >> /etc/apache-ssl/srm.conf ;\
a309 1
  /etc/init.d/apache-ssl reload >/dev/null 2>&1
d312 6
a317 6
chown -R www-data.root /usr/share/horde >> /dev/null 2>&1
chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1
chmod 000 /usr/share/horde/setup.php3 >> /dev/null 2>&1
chown -R www-data.root /etc/horde >> /dev/null 2>&1
chmod 555 `find /etc/horde/ -type f -print ` >/dev/null 2>&1
chmod o-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1
d319 2
a322 1
db_stop
d324 1
@


1.9
log
@[IEM] a few more tweaks related to the dev version compared to the pre ver.
@
text
@d6 3
d17 3
a19 3
# read those selections in if and only if they exist
if [ -f "$CHOICES_FILE." ]; then
   . $CHOICES_FILE
a34 1
## Ok, now we need to run through the choices ##
a35 4
  # go get the value, prompt for it if we don't have it
  db_input "medium" "horde/$i"
  db_go
  # set the tmp file with this value
a39 2
db_input medium horde/signup
db_go
d42 2
a43 11
if [ "$RET" = false ]; then
  db_set horde/signup_email "root@@localhost"
  echo "signup_email=\"root@@localhost\";" >>$TMPFILE
else
  db_input "medium" "horde/signup_email"
  db_go
  db_get "horde/signup_email"
  echo "signup_email=\"$RET\";" >>$TMPFILE
fi
db_input medium horde/problem_reporting
db_go
d46 2
a47 9
if [ "$RET" = false ]; then
  db_set horde/problem_email "root@@localhost"
  echo "problem_email=\"root@@localhost\";" >>$TMPFILE
else
  db_input "medium" "horde/problem_email"
  db_go
  db_get "horde/problem_email"
  echo "problem_email=\"$RET\";" >>$TMPFILE
fi
d57 4
d93 47
a139 2
##  We need to figure out what type of database to use now:

d141 25
d167 8
a174 59
  db_input "medium" "horde/database_type"
  db_go
  # set the tmp file with this value
  db_get "horde/database_type"
  dbtype="$RET"
  ##  Ok we have some other database stuff to take care of now
  db_input "medium" "horde/database_server"
  db_go
  db_get "horde/database_server"
  dbserver="$RET"
  db_input "medium" "horde/database_name"
  db_go
  db_get "horde/database_name"
  dbname="$RET"
  db_input "medium" "horde/database_user"
  db_go
  db_get "horde/database_user"
  dbuser="$RET"
  db_input "medium" "horde/database_pass"
  db_go
  db_get "horde/database_pass"
  dbpass="$RET"
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc > /etc/horde/horde_phplib.inc.tmp
  cp /etc/horde/horde_phplib.inc /etc/horde/horde_phplib.inc.bak >/dev/null 2>&1
  mv /etc/horde/horde_phplib.inc.tmp /etc/horde/horde_phplib.inc >/dev/null 2>&1

  if [ "$dbtype" = "PostgreSQL" ]; then

    /bin/sed -e "s#@@dbname@@#$dbname#" /usr/share/doc/horde/examples/pgsql_create.sql > /usr/share/doc/horde/examples/pgsql_create.sql.new
    cp /usr/share/doc/horde/examples/pgsql_create.sql /usr/share/doc/horde/examples/pgsql_create.sql.bak >/dev/null 2>&1
    mv /usr/share/doc/horde/examples/pgsql_create.sql.new /usr/share/doc/horde/examples/pgsql_create.sql >/dev/null 2>&1

    /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
    cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.back > /dev/null 2>&1
    if (grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1); 
    then 
      (mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init > /dev/null 2>&1); 
    fi
      /etc/init.d/postgresql restart > /dev/null 2>&1
       sleep 2
       if (grep 'extension' /etc/php3/apache/php3.ini | grep 'pgsql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=pgsql.so' >> /etc/php3/apache/php3.ini); fi 
       /bin/sed -e 's#@@dbtype@@#pgsql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
       cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back
       mv /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1

       # Now do some database stuff

       db_input "medium" "horde/dbconfigured"
       db_go
       db_get "horde/dbconfigured"
       if [ "$RET" = "no" ]; then
       PSQL2_QUERY="GRANT SELECT, INSERT, UPDATE ON active_sessions, auth_user, auth_user_md5 TO $dbuser"
       su - postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass"
       su - postgres -c '/usr/bin/psql -q template1 < /usr/share/doc/horde/examples/pgsql_create.sql'
       su - postgres -c '/usr/bin/psql -q template1 -c "$PSQL2_QUERY"'
       db_set "horde/dbconfigured" "yes"
       fi
       /etc/init.d/postgresql restart > /dev/null 2>&1
       cd /usr/share/horde/lib/src && ./build.pl --database=postgres >> /dev/null 2>&1
d176 14
a189 27
  if [ "$dbtype" = "MySql" ]; then
    /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/mysql_create.sql > /usr/share/doc/horde/examples/mysql_create.sql.new
    cp /usr/share/doc/horde/examples/mysql_create.sql /usr/share/doc/horde/examples/mysql_create.sql.bak >/dev/null 2>&1
    mv /usr/share/doc/horde/examples/mysql_create.sql.new /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
    chmod go-rwx /usr/share/doc/horde/examples/mysql_create.sql

       if (grep 'extension' /etc/php3/apache/php3.ini | grep 'imap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=imap.so' >> /etc/php3/apache/php3.ini); fi
	if (grep 'extension' /etc/php3/apache/php3.ini | grep 'ldap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=ldap.so' >> /etc/php3/apache/php3.ini ); fi 
	if (grep 'extension' /etc/php3/apache/php3.ini | grep 'mysql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=mysql.so' >> /etc/php3/apache/php3.ini); fi
        
       /bin/sed -e 's#@@dbtype@@#mysql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
       cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back              
       cp /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1
       db_input "medium" "horde/dbconfigured"
       db_go
       db_get "horde/dbconfigured"
       if [ "$RET" = "no" ] ; then 
       if [ "$db_pass" = "none" ] ; then
         /usr/bin/mysql -f < /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
       else
         /usr/bin/mysql -f --password=$db_pass < /usr/share/doc/horde/examples/mysql_create.sql > /dev/null 2>&1

       fi
         db_set "horde/dbconfigured" "yes"
       fi
       /etc/init.d/mysql restart >/dev/null 2>&1
       cd /usr/share/horde/lib/src && ./build.pl --database=mysql >> /dev/null 2>&1
d192 13
a204 37
  db_input "medium" "horde/webserver_type"
  db_go
  # set the tmp file with this value
  db_get "horde/webserver_type"
  if [ "$RET" = "Apache" ]; then  
    /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache/httpd.conf >/etc/apache/httpd.conf.tmp
    cp /etc/apache/httpd.conf /etc/apache/httpd.conf.horde.back > /dev/null 2>&1
    if (grep 'php3_module' /etc/apache/httpd.conf.tmp >/dev/null 2>&1);
    then
      (mv /etc/apache/httpd.conf.tmp /etc/apache/httpd.conf);
    fi
    if (grep 'Added for HORDE' /etc/apache/access.conf >/dev/null 2>&1);  \
    then \
      notsome="1" ;\
    else \
      echo ' ' >> /etc/apache/access.conf ;\
      echo '# Added for HORDE' >> /etc/apache/access.conf ;\
      echo '<Directory /usr/share/horde>' >> /etc/apache/access.conf ;\
      echo 'Options Indexes FollowSymLinks' >> /etc/apache/access.conf ;\
      echo 'AllowOverride None' >> /etc/apache/access.conf ;\
      echo 'order allow,deny' >> /etc/apache/access.conf ;\
      echo 'allow from all' >> /etc/apache/access.conf ;\
      echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache/access.conf ;\
      echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache/access.conf ;\
      echo 'php3_magic_quotes_gpc Off' >> /etc/apache/access.conf ;\
      echo '</Directory>' >> /etc/apache/access.conf ;\
      echo '# End HORDE Configuration Block' >> /etc/apache/access.conf ;\ 
      fi

      if (grep 'Added for HORDE' /etc/apache/srm.conf >/dev/null 2>&1); \
      then \
        (notsome="1"); \
      else \ 
         (echo '# Added for HORDE' >> /etc/apache/srm.conf ;\
         echo 'Alias /horde /usr/share/horde' >> /etc/apache/srm.conf); \
      fi
    /etc/init.d/apache reload >/dev/null 2>&1
d206 14
a219 33
  if [ "$RET" = "Apache-SSL" ]; then
    /bin/sed -e 's#\\# LoadModule php3_module#LoadModule php3_module#' /etc/apache-ssl/httpd.conf >/etc/apache-ssl/httpd.conf.tmp
    cp /etc/apache-ssl/httpd.conf /etc/apache-ssl/httpd.conf.horde.back > /dev/null 2>&1
    if (grep 'php3_module' /etc/apache-ssl/httpd.conf.tmp >/dev/null 2>&1);
    then
      (mv /etc/apache-ssl/httpd.conf.tmp /etc/apache-ssl/httpd.conf);
    fi
    if (grep 'Added for HORDE' /etc/apache-ssl/access.conf >/dev/null 2>&1); \
    then \
      notsome="1"; \
    else \
      echo ' ' >> /etc/apache-ssl/access.conf ;\
      echo '# Added for HORDE' >> /etc/apache-ssl/access.conf ;\
      echo '<Directory /usr/share/horde>' >> /etc/apache-ssl/access.conf ;\
      echo 'Options Indexes FollowSymLinks' >> /etc/apache-ssl/access.conf ;\
      echo 'AllowOverride None' >> /etc/apache-ssl/access.conf ;\
      echo 'order allow,deny' >> /etc/apache-ssl/access.conf ;\
      echo 'allow from all' >> /etc/apache-ssl/access.conf ;\
      echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache-ssl/access.conf ;\
      echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache-ssl/access.conf ;\
      echo 'php3_magic_quotes_gpc Off' >> /etc/apache-ssl/access.conf ;\
      echo '</Directory>' >> /etc/apache-ssl/access.conf ;\
      echo '# End HORDE Configuration Block' >> /etc/apache-ssl/access.conf ;\
      fi

      if (grep 'Added for HORDE' /etc/apache-ssl/srm.conf >/dev/null 2>&1); \
      then \
        (notsome="1"); \
      else \
         (echo '# Added for HORDE' >> /etc/apache-ssl/srm.conf ;\
         echo 'Alias /horde /usr/share/horde' >> /etc/apache-ssl/srm.conf); \
      fi
    /etc/init.d/apache-ssl reload >/dev/null 2>&1
d222 7
a228 6
     chown -R www-data.root /usr/share/horde >> /dev/null 2>&1
     chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1
     chmod 000 /usr/share/horde/setup.php3 >> /dev/null 2>&1
     chown -R www-data.root /etc/horde >> /dev/null 2>&1
     chmod 555 `find /etc/horde/ -type f -print ` >/dev/null 2>&1
     chmod o-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1
d230 6
a235 1
db_stop
d239 1
@


1.8
log
@[IEM] updating the -dev tree's debian stuff...(debconf, etc...)
@
text
@d33 1
a33 1
for i in `cat $HOPTIONS_FILE | grep -v "#"`; do
@


1.7
log
@[IEM] updates for debian:  getting rid of individual phplib.inc files since
by this version all will be using the same settings. (user/pass/db)  Bringing
changes from stable into devel tree.  migrating for /usr/doc to /usr/share/doc
@
text
@d1 4
a4 2
#! /bin/sh
# postinst script for horde
d6 2
a7 1
# see: dh_installdeb(1)
d9 4
a12 1
set -e
d14 4
a17 4
case "$1" in
    configure)
       /usr/bin/hordesetup horde
    ;;
d19 3
a21 1
    abort-upgrade|abort-remove|abort-deconfigure)
d23 8
a30 1
    ;;
d32 9
a40 5
    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac
d42 26
a67 2
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
d69 4
d74 209
a282 1
exit 0
d284 1
d286 1
@


1.6
log
@[IEM] updating deb stuff for -dev so I can start playing
@
text
@d2 1
a2 1
# postinst script for horde-core
@


1.5
log
@[IEM] wow...I forgot to commt my deb stuff too... :)

    1>  Updated italian locales (sync'ng up from -pre)
    2>  Updates to the debian stuff so that it can pseudo like co-exist
        with current horde install.
@
text
@d1 5
a5 1
#!/bin/sh
d7 23
a29 1
/usr/bin/hordesetup-devel horde
@


1.4
log
@[IEM] wow...I forgot to commt my deb stuff too... :)

    1>  Updated italian locales (sync'ng up from -pre)
    2>  Updates to the debian stuff so that it can pseudo like co-exist
        with current horde install.
@
text
@@


1.3
log
@[IEM] Trying to bring the debian stuff up to speed for the devel tree
so that I can build packages for development purposes.  This is all
currently a mirror of what's in -pre right now.
@
text
@d3 1
a3 1
/usr/bin/hordesetup horde
@


1.2
log
@[IEM] updates to the dev tree
@
text
@d1 3
a3 152
#!/usr/bin/perl --
# Copyright 1998,1999 Ivan E. Moore II
# See /usr/share/doc/horde/copyright.
$|=1;

### If horde.lib exists ###
### Change permissions so that we can create a new horde.lib file ###

if (! (-s "/usr/share/horde/lib/horde.lib")) {
  system("chmod -R 644 /usr/share/horde/lib/*.lib >> /dev/null 2>&1");
}

if (-s "/usr/sbin/apache-ssl") {
  $srm='/etc/apache-ssl/srm.conf';
  $http='/etc/apache-ssl/httpd.conf';
} else {
  $srm='/etc/apache/srm.conf';
  $http='/etc/apache/httpd.conf';
}

sub loadconf ($$;$)
{
    $parameter = 'DocumentRoot';
    $default = $_[1];

    $file = (defined ($_[2]) ? $_[2] : "$http");
    $in = `egrep "^[:space:]*$parameter " $file 2> /dev/null| head -1`;
    $in =~ s/\s*$parameter //;
    chomp ($in);
    return $in if ($in ne "");
    return $default;
}

sub load_conf ($$;$)
{
    my $parameter = $_[0];
    my $default = $_[1];

    my $file = (defined ($_[2]) ? $_[2] : "$srm");
    my $in = `egrep "^[:space:]*$parameter " $file 2> /dev/null| head -1`;
    $in =~ s/\s*$parameter //;
    chomp ($in);
    return $in if ($in ne "");
    return $default;
}
$install_dir = loadconf ("DocumentRoot", $tmproot, $srm);

$buildopts ='/etc/horde/build.opts';

sub load_config_files ()
{
    $main::srmconf = `cat $srm`;
    $main::dirindex = load_conf ("DirectoryIndex",$tmpdirindex, $srm);
    $main::buildconf = (-f $buildopts ? `cat $buildopts`: '');

}

### build.opts configuration ###

$write_srmconf = 0;
$restart_apache = 0;
$write_buildopts = 0;

if (-s "/usr/bin/psql") {
                $database='postgres';
    } else {
      if (-s "/usr/bin/mysql") {
                 $database='mysql';
      } else {
                 $database='dummy';
      }
    }

sub add_features ()
{
  $dirindexnew='index.html index.php3 index.htm default.html index.cgi';
  print "\n\nNow verifying both Apache and PHP3 Configurations\n";
  if (! ($srmconf =~ m/.*DirectoryIndex\s+$dirindexnew/m))
  {
    $srmconf =~ s/^\s*DirectoryIndex.*/DirectoryIndex $dirindexnew/m;
    print "DirectoryIndex now $dirindexnew.\n";
    $write_srmconf++;
  }
  if (! ($database =~ dummy)) {
    if (! ($buildconf =~ m/.*database=*/m))
    {
        print "Setting $database as your database option in build.opts\n";
        $buildconf =~ s/$/\ndatabase=$database\n/s;
        $write_buildconf++;
    }
  }
    if (! ($srmconf =~ m/.*Alias\s+\/horde\/\s+\/usr\/share\/horde\//m))
    {
        print "Adding alias /horde/ -> /usr/share/horde/ to srm.conf.\n";
        $srmconf =~ s/$/\n# Added for HORDE\n/s;
        $srmconf =~ s/$/Alias \/horde\/ \/usr\/share\/horde\/\n/s;
    if (! ($srmconf =~ m/.*Alias\s+\/horde\s+\/usr\/share\/horde\//m))
    {
        $srmconf =~ s/$/Alias \/horde \/usr\/share\/horde\/\n/s;
    }
        $write_srmconf++;
    }

}

if (-s "/etc/horde/config") {

  print "\nLooks like a previous install, not going to touch your Apache\n
or PHP stuff so if you don't have something set right, don't blame me!\n";
} else {
  load_config_files ();
  add_features ();
  system ("echo 'Base Install\n' > /etc/horde/config");
}

if ($write_buildconf)
{
    system ("savelog -c 100 $buildopts >> /dev/null 2>&1")
        && die ("couldn't rotate $buildopts\n");
    open (CONF, ">$buildopts") || die ("couldn't open $buildopts\n");
    print CONF $buildconf;
    close (CONF);
}

if ($write_srmconf)
{
    system ("savelog -c 100 $srm >> /dev/null 2>&1")
        && die ("couldn't rotate $srm");
    open (CONF, ">$srm") || die ("couldn't open $srm");
    print CONF $srmconf;
    close (CONF);
    $restart_apache++;
}



### Build horde.lib ###

print "Building HORDE Libraries for your specific installation
";

 system("cd /usr/share/horde/lib/src && ./build.pl >> /dev/null 2>&1");

### Change file permissions for security ###

 system("chown -R www-data.root /usr/share/horde >> /dev/null 2>&1");
 system("chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1");
 system("chmod 000 /usr/share/horde/setup.php3 >> /dev/null 2>&1");
 system("chmod 555 /etc/horde/*.php3 >> /dev/null 2>&1");
 system("chmod 555 /etc/horde/*.txt >> /dev/null 2>&1");

### Done ###
@


1.1
log
@Mike: dipping toes into dev tree swimming pool. packaging stuff is on the move.
@
text
@d3 1
a3 1
# See /usr/doc/horde/copyright.
@


1.1.2.1
log
@[IEM] working horde .deb
@
text
@d3 1
a3 1
# See /usr/share/doc/horde-core/copyright.
@


1.1.2.2
log
@[IEM] More updates and new stuff for debian packaging

     1>  New hordesetup script.  This script will be the core for building
anything horde related.  All module info stuff will be in there..currently
horde and imp.  Passing a module name to the setup script will cause
it to do all the configuration stuff for that module on a debian system.
Currently it handles configuring of the database, asking the user what
type of database they want if it doesn't know already (/etc/horde/build.opts),
verifying that php3 has teh proper modules loaded, verifying Alias settings
in apache.  It still needs 2 other things which I'll get to today. Apache
restart (just remembered that) and some small phplib tweaks to work with
the package in it's current state.

     2> updated changelog to reflect changes
     3> updated control to reflect new phplib package
     4> modified rules and postinst to take care of new hordesetup script
@
text
@d1 152
a152 2
#!/bin/sh
/usr/bin/hordesetup horde
@


1.1.2.3
log
@[IEM] Fixes the reported problem with mysql and not beign able to access
the db.  the username/password pair must be listed and correct in
horde_phplib.inc for mysql. (postgres doesn't seem to care)
@
text
@a1 1
set -e
@


1.1.2.4
log
@[IEM] Fixing post/pre inst scripts
@
text
@d1 1
a1 5
#! /bin/sh
# postinst script for horde-core
#
# see: dh_installdeb(1)

d3 1
a3 23

case "$1" in
    configure)
       /usr/bin/hordesetup horde
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.


exit 0


@


1.1.2.5
log
@[IEM] Preliminary changes for new configuration routines.  Trying to clean
up build process using new debconf option.  Getting rid of extra configuration
files for both postgres and mysql and will instead use a selection bit to
figure out what type of container the user will use and setup phplib and
horde related files on the fly based on choices.  (and upgrades after that
will use existing choices)  This sweep adds to files required by debconf
and specific to debconf working with horde.  horde.php3 and defaults.php3
will be build on the fly.  (really need to get rid of root_url and graphics_url
for the horde module and use the ones supplied in horde.php3 to cut down
on redundancy...adding to my todo)
@
text
@d1 2
a2 4
#!/bin/sh 
# Horde postinst script using debconf
# written by Ivan E. Moore II <rkrusty@@tdyc.com> with help from
# debconf examples and tons of other references
d4 1
a4 2
# Source debconf library
. /usr/share/debconf/confmodule.sh
d6 1
a6 119
# Where the config file is that stores the previous selections
CHOICES_FILE="/etc/horde/defaults.choices";
OPTIONS_FILE="/etc/horde/defaults.options";
DEFAULTS_FILE="/etc/horde/defaults.php3";
HCHOICES_FILE="/etc/horde/horde.choices";
HOPTIONS_FILE="/etc/horde/horde.options";
HORDE_FILE="/etc/horde/horde.php3";

# read those selections in if and only if they exist
if [ -f "$CHOICES_FILE." ]; then
   . $CHOICES_FILE
fi

## Ok set our temp file to use
TMPFILE=`mktmp horde.XXX`;

### Set the shell variable so that it can be sourced in
echo "#!/bin/sh" >>$TMPFILE 2>&1;

## Ok, now we need to run through the choices ##
for i in `cat $OPTIONS_FILE | grep -v "#"`; do
  # go get the value, prompt for it if we don't have it
  db_input "medium" "horde/$i"
  db_go
  # set the tmp file with this value
  db_get "horde/$i"
  echo "$i=\"$RET\";" >>$TMPFILE
done

# Now drop the newly created file into it's place
mv $TMPFILE $CHOICES_FILE > /dev/null 2>&1;

# Read in the new values
. $CHOICES_FILE

#### horde.php3 stuff for a bit
 
## Ok set our temp file to use
TMPFILE=`mktmp horde.XXX`;

### Set the shell variable so that it can be sourced in
echo "#!/bin/sh" >>$TMPFILE 2>&1;

## Ok, now we need to run through the choices ##
for i in `cat $HOPTIONS_FILE | grep -v "#"`; do
  # go get the value, prompt for it if we don't have it
  case "$i" in
     horde_root_url|horde_graphics_url|horde_include_dir|faq_url|path_to_sendmail)
     if [ "$i" = "horde_root_url" ]; then
       RET="$root_url";
     fi
     if [ "$i" = "horde_graphics_url" ]; then
       RET="$graphics_url";
     fi
     if [ "$i" = "horde_include_dir" ]; then
       RET="$horde_include_dir";
     fi
     if [ "$i" = "faq_url" ]; then
       RET="$faq_url";
     fi
     if [ "$i" = "path_to_sendmail" ]; then
       RET="$path_to_sendmail";
     fi
     echo "$i=\"$RET\";" >>$TMPFILE
     ;;
     *)

  db_input "medium" "horde/$i"
  db_go
  # set the tmp file with this value
  db_get "horde/$i"
  echo "$i=\"$RET\";" >>$TMPFILE
     ;;
  esac
done

# Now drop the newly created file into it's place
mv $TMPFILE $HCHOICES_FILE > /dev/null 2>&1;

# Now read the new file in
. $HCHOICES_FILE

# back to defaults

# Create a new temp file
TMPFILE=`mktmp horde.XXX`;

# Now let's create the defaults.php3 file needed by HORDE

echo "<?php" >>$TMPFILE
echo "" >>$TMPFILE

for i in `cat $CHOICES_FILE | grep -v "#"`; do
  echo "\$default->$i" >>$TMPFILE;
done

echo "" >>$TMPFILE
echo "?>" >>$TMPFILE

# Now lets move that file into place

mv $TMPFILE $DEFAULTS_FILE > /dev/null 2>&1

### horde.php3 build

# Create a new temp file
TMPFILE=`mktmp horde.XXX`;

# Now let's create the defaults.php3 file needed by HORDE

echo "<?php" >>$TMPFILE
echo "" >>$TMPFILE

for i in `cat $HCHOICES_FILE | grep -v "#"`; do
  echo "\$default->$i" >>$TMPFILE;
done

echo "" >>$TMPFILE
echo "?>" >>$TMPFILE
d8 4
a11 1
# Now lets move that file into place
d13 1
a13 1
mv $TMPFILE $HORDE_FILE > /dev/null 2>&1
d15 10
a25 1
#DEBHELPER#
d28 2
@


1.1.2.6
log
@[IEM] final touches to the debconf changes.  Now horde is tied into
debocnf so that one will have a one time config option (ala debconf)...now
to finish up the none install configure script that will interact with
debconf...

(2 weeks +/- away from Debian 2.2 freeze)
@
text
@d1 1
a1 1
#!/bin/sh -e
d14 1
a21 4
if [ -f "$HCHOICES_FILE." ]; then
   . $HCHOICES_FILE     
fi

d26 1
a26 7
echo "#!/bin/sh" >>$TMPFILE 
echo "# Config file read in by HORDE setup program" >>$TMPFILE
echo "# Autobuilt by debconf/hordeconf Do not edit" >>$TMPFILE
echo "#" >>$TMPFILE
echo "#  DO NOT EDIT" >>$TMPFILE
echo "#" >>$TMPFILE
echo "# configure program (defaults.php3)" >>$TMPFILE
a39 2
chmod 755 $CHOICES_FILE
chmod go-rwx $CHOICES_FILE
d51 26
a76 23
echo "# Config file read in by HORDE setup program" >>$TMPFILE
echo "# Autobuilt by debconf/hordeconf Do not edit" >>$TMPFILE
echo "#" >>$TMPFILE
echo "#  DO NOT EDIT" >>$TMPFILE
echo "#" >>$TMPFILE
echo "# configure program (horde.php3)" >>$TMPFILE

# these are ones we already got for defaults...
db_get "horde/root_url"
echo "horde_root_url=\"$RET\";" >>$TMPFILE
db_get "horde/graphics_url"
echo "horde_graphics_url=\"$RET\";" >>$TMPFILE
db_get "horde/horde_include_dir"
echo "horde_include_dir=\"$RET\";" >>$TMPFILE
db_input medium horde/signup
db_go
db_get "horde/signup"
echo "signup=\"$RET\";" >>$TMPFILE
if [ "$RET" = false ]; then
  db_set horde/signup_email "root@@localhost"
  echo "signup_email=\"root@@localhost\";" >>$TMPFILE
else
  db_input "medium" "horde/signup_email"
d78 6
a83 17
  db_get "horde/signup_email"
  echo "signup_email=\"$RET\";" >>$TMPFILE
fi
db_input medium horde/problem_reporting
db_go
db_get "horde/problem_reporting"
echo "problem_reporting=\"$RET\";" >>$TMPFILE
if [ "$RET" = false ]; then
  db_set horde/problem_email "root@@localhost"
  echo "problem_email=\"root@@localhost\";" >>$TMPFILE
else
  db_input "medium" "horde/problem_email"
  db_go
  db_get "horde/problem_email"
  echo "problem_email=\"$RET\";" >>$TMPFILE
fi

a86 2
chmod 755 $HCHOICES_FILE
chmod go-rwx $HCHOICES_FILE
d100 5
a104 9
echo "\$default->root_url                 = '$root_url';" >>$TMPFILE
echo "\$default->graphics_url             = '$graphics_url';" >>$TMPFILE
echo "\$default->faq_url                  = '$faq_url';" >>$TMPFILE
echo "\$default->horde_include_dir        = '$horde_include_dir';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Path to sendmail */" >>$TMPFILE
echo "\$default->path_to_sendmail         = '$path_to_sendmail';" >>$TMPFILE
echo "" >>$TMPFILE
echo "\$default->cache_pages              = true;" >>$TMPFILE
a119 5
echo "/*" >>$TMPFILE
echo " * Edit this file to reflect your local system configuration." >>$TMPFILE
echo " * These values reflect global Horde configuration settings;" >>$TMPFILE
echo " * they can be overridden in individual module confgiurations." >>$TMPFILE
echo " */" >>$TMPFILE
d121 5
a125 16
echo "/* Horde urls */" >>$TMPFILE
echo "\$default->horde_root_url           = '$horde_root_url';" >>$TMPFILE
echo "\$default->horde_graphics_url       = '$horde_graphics_url';" >>$TMPFILE
echo "\$default->horde_include_dir        = '$horde_include_dir';" >>$TMPFILE
echo "\$default->faq_url                  = '$faq_url';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Path to sendmail */" >>$TMPFILE
echo "\$default->path_to_sendmail          = '$path_to_sendmail';" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Problem Reporting */" >>$TMPFILE
echo "\$default->problem_email             = '$problem_email';" >>$TMPFILE
echo "\$default->problem_reporting         = $problem_reporting;" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Account Signup */" >>$TMPFILE
echo "\$default->signup_email              = '$signup_email';" >>$TMPFILE
echo "\$default->signup                    = $signup;" >>$TMPFILE
a132 6
##  Ok defaults.php3 and horde.php3 are built
##  Now take care of the rest of the conf files needing changed

##  We need to figure out what type of database to use now:


a133 163
  db_input "medium" "horde/database_type"
  db_go
  # set the tmp file with this value
  db_get "horde/database_type"
  dbtype="$RET"
  ##  Ok we have some other database stuff to take care of now
  db_input "medium" "horde/database_server"
  db_go
  db_get "horde/database_server"
  dbserver="$RET"
  db_input "medium" "horde/database_name"
  db_go
  db_get "horde/database_name"
  dbname="$RET"
  db_input "medium" "horde/database_user"
  db_go
  db_get "horde/database_user"
  dbuser="$RET"
  db_input "medium" "horde/database_pass"
  db_go
  db_get "horde/database_pass"
  dbpass="$RET"
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc > /etc/horde/horde_phplib.inc.tmp
  cp /etc/horde/horde_phplib.inc /etc/horde/horde_phplib.inc.bak >/dev/null 2>&1
  mv /etc/horde/horde_phplib.inc.tmp /etc/horde/horde_phplib.inc >/dev/null 2>&1

  if [ "$dbtype" = "PostgreSQL" ]; then

    /bin/sed -e "s#@@dbname@@#$dbname#" /usr/share/doc/horde/examples/pgsql_create.sql > /usr/share/doc/horde/examples/pgsql_create.sql.new
    cp /usr/share/doc/horde/examples/pgsql_create.sql /usr/share/doc/horde/examples/pgsql_create.sql.bak >/dev/null 2>&1
    mv /usr/share/doc/horde/examples/pgsql_create.sql.new /usr/share/doc/horde/examples/pgsql_create.sql >/dev/null 2>&1

    /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
    cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.back > /dev/null 2>&1
    if (grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1); 
    then 
      (mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init > /dev/null 2>&1); 
    fi
      /etc/init.d/postgresql restart > /dev/null 2>&1
       sleep 2
       if (grep 'extension' /etc/php3/apache/php3.ini | grep 'pgsql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=pgsql.so' >> /etc/php3/apache/php3.ini); fi 
       /bin/sed -e 's#@@dbtype@@#pgsql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
       cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back
       mv /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1

       # Now do some database stuff

       db_input "medium" "horde/dbconfigured"
       db_go
       db_get "horde/dbconfigured"
       if [ "$RET" = "no" ]; then
       PSQL2_QUERY="GRANT SELECT, INSERT, UPDATE ON active_sessions, auth_user, auth_user_md5 TO $dbuser"
       su - postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass"
       su - postgres -c '/usr/bin/psql -q template1 < /usr/share/doc/horde/examples/pgsql_create.sql'
       su - postgres -c '/usr/bin/psql -q template1 -c "$PSQL2_QUERY"'
       db_set "horde/dbconfigured" "yes"
       fi
       /etc/init.d/postgresql restart > /dev/null 2>&1
       cd /usr/share/horde/lib/src && ./build.pl --database=postgres >> /dev/null 2>&1
  fi
  if [ "$dbtype" = "MySql" ]; then

       if (grep 'extension' /etc/php3/apache/php3.ini | grep 'imap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=imap.so' >> /etc/php3/apache/php3.ini); fi
	if (grep 'extension' /etc/php3/apache/php3.ini | grep 'ldap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=ldap.so' >> /etc/php3/apache/php3.ini ); fi 
	if (grep 'extension' /etc/php3/apache/php3.ini | grep 'mysql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=mysql.so' >> /etc/php3/apache/php3.ini); fi
        
       /bin/sed -e 's#@@dbtype@@#mysql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
       cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back              
       cp /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1
       db_input "medium" "horde/dbconfigured"
       db_go
       db_get "horde/dbconfigured"
       if [ "$RET" = "no" ] ; then 
       if [ "$db_pass" = "none" ] ; then
         /usr/bin/mysql -f < /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
       else
         /usr/bin/mysql -f --password=$db_pass < /usr/share/doc/horde/examples/mysql_create.sql > /dev/null 2>&1

       fi
         db_set "horde/dbconfigured" "yes"
       fi
       /etc/init.d/mysql restart >/dev/null 2>&1
       cd /usr/share/horde/lib/src && ./build.pl --database=mysql >> /dev/null 2>&1
  fi

  db_input "medium" "horde/webserver_type"
  db_go
  # set the tmp file with this value
  db_get "horde/webserver_type"
  if [ "$RET" = "Apache" ]; then  
    /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache/httpd.conf >/etc/apache/httpd.conf.tmp
    cp /etc/apache/httpd.conf /etc/apache/httpd.conf.horde.back > /dev/null 2>&1
    if (grep 'php3_module' /etc/apache/httpd.conf.tmp >/dev/null 2>&1);
    then
      (mv /etc/apache/httpd.conf.tmp /etc/apache/httpd.conf);
    fi
    if (grep 'Added for HORDE' /etc/apache/access.conf >/dev/null 2>&1);  \
    then \
      notsome="1" ;\
    else \
      echo ' ' >> /etc/apache/access.conf ;\
      echo '# Added for HORDE' >> /etc/apache/access.conf ;\
      echo '<Directory /usr/share/horde>' >> /etc/apache/access.conf ;\
      echo 'Options Indexes FollowSymLinks' >> /etc/apache/access.conf ;\
      echo 'AllowOverride None' >> /etc/apache/access.conf ;\
      echo 'order allow,deny' >> /etc/apache/access.conf ;\
      echo 'allow from all' >> /etc/apache/access.conf ;\
      echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache/access.conf ;\
      echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache/access.conf ;\
      echo 'php3_magic_quotes_gpc Off' >> /etc/apache/access.conf ;\
      echo '</Directory>' >> /etc/apache/access.conf ;\
      echo '# End HORDE Configuration Block' >> /etc/apache/access.conf ;\ 
      fi

      if (grep 'Added for HORDE' /etc/apache/srm.conf >/dev/null 2>&1); \
      then \
        (notsome="1"); \
      else \ 
         (echo '# Added for HORDE' >> /etc/apache/srm.conf ;\
         echo 'Alias /horde /usr/share/horde' >> /etc/apache/srm.conf); \
      fi
    /etc/init.d/apache reload >/dev/null 2>&1
  fi
  if [ "$RET" = "Apache-SSL" ]; then
    /bin/sed -e 's#\\# LoadModule php3_module#LoadModule php3_module#' /etc/apache-ssl/httpd.conf >/etc/apache-ssl/httpd.conf.tmp
    cp /etc/apache-ssl/httpd.conf /etc/apache-ssl/httpd.conf.horde.back > /dev/null 2>&1
    if (grep 'php3_module' /etc/apache-ssl/httpd.conf.tmp >/dev/null 2>&1);
    then
      (mv /etc/apache-ssl/httpd.conf.tmp /etc/apache-ssl/httpd.conf);
    fi
    if (grep 'Added for HORDE' /etc/apache-ssl/access.conf >/dev/null 2>&1); \
    then \
      notsome="1"; \
    else \
      echo ' ' >> /etc/apache-ssl/access.conf ;\
      echo '# Added for HORDE' >> /etc/apache-ssl/access.conf ;\
      echo '<Directory /usr/share/horde>' >> /etc/apache-ssl/access.conf ;\
      echo 'Options Indexes FollowSymLinks' >> /etc/apache-ssl/access.conf ;\
      echo 'AllowOverride None' >> /etc/apache-ssl/access.conf ;\
      echo 'order allow,deny' >> /etc/apache-ssl/access.conf ;\
      echo 'allow from all' >> /etc/apache-ssl/access.conf ;\
      echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache-ssl/access.conf ;\
      echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache-ssl/access.conf ;\
      echo 'php3_magic_quotes_gpc Off' >> /etc/apache-ssl/access.conf ;\
      echo '</Directory>' >> /etc/apache-ssl/access.conf ;\
      echo '# End HORDE Configuration Block' >> /etc/apache-ssl/access.conf ;\
      fi

      if (grep 'Added for HORDE' /etc/apache-ssl/srm.conf >/dev/null 2>&1); \
      then \
        (notsome="1"); \
      else \
         (echo '# Added for HORDE' >> /etc/apache-ssl/srm.conf ;\
         echo 'Alias /horde /usr/share/horde' >> /etc/apache-ssl/srm.conf); \
      fi
    /etc/init.d/apache-ssl reload >/dev/null 2>&1
  fi

     chown -R www-data.root /usr/share/horde >> /dev/null 2>&1
     chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1
     chmod 000 /usr/share/horde/setup.php3 >> /dev/null 2>&1
     chmod 555 /etc/horde/*.php3 /etc/horde/*.txt /etc/horde/*html >>/dev/null 2>&1
db_stop
@


1.1.2.7
log
@[IEM] one more final tweak to perms and whatnot for the debian build
@
text
@a241 4
    /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/mysql_create.sql > /usr/share/doc/horde/examples/mysql_create.sql.new
    cp /usr/share/doc/horde/examples/mysql_create.sql /usr/share/doc/horde/examples/mysql_create.sql.bak >/dev/null 2>&1
    mv /usr/share/doc/horde/examples/mysql_create.sql.new /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
    chmod go-rwx /usr/share/doc/horde/examples/mysql_create.sql
d342 1
a342 4
     chown -R www-data.root /etc/horde >> /dev/null 2>&1
     chmod 555 `find /etc/horde/ -type f -print ` >/dev/null 2>&1
     chmod o-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1

a343 1

@


1.1.2.8
log
@[IEM] I screwed up the mktemp commands...
@
text
@d26 1
a26 2
p=`basename $0`
TMPFILE=`mktemp /tmp/$p.XXXXXX` || exit 1
d58 1
a58 2
p=`basename $0`
TMPFILE=`mktemp /tmp/$p.XXXXXX` || exit 1
d115 1
a115 2
p=`basename $0`
TMPFILE=`mktemp /tmp/$p.XXXXXX` || exit 1
d140 1
a140 2
p=`basename $0`
TMPFILE=`mktemp /tmp/$p.XXXXXX` || exit 1
@


1.1.2.9
log
@[IEM] more fixes to the debian build stuff.
      Also cleaning out final stuff from horde's default.php3.dist
@
text
@d11 1
a11 1
HOPTIONS_FILE="/etc/horde/horde.options";
d36 1
a36 1
echo "# configure program (horde.php3)" >>$TMPFILE
d39 1
a39 1
for i in `cat $HOPTIONS_FILE | grep -v "#"`; do
d48 30
d105 1
d114 2
d120 1
a120 1
# Now let's create the horde.php3 file needed by HORDE
d124 2
a125 2
echo "\$default->horde_root_url                 = '$horde_root_url';" >>$TMPFILE
echo "\$default->horde_graphics_url             = '$horde_graphics_url';" >>$TMPFILE
d132 1
a132 7
echo "/* Problem Reporting */" >>$TMPFILE
echo "\$default->problem_email             = '$problem_email';" >>$TMPFILE
echo "\$default->problem_reporting         = $problem_reporting;" >>$TMPFILE
echo "" >>$TMPFILE
echo "/* Account Signup */" >>$TMPFILE
echo "\$default->signup_email              = '$signup_email';" >>$TMPFILE
echo "\$default->signup                    = $signup;" >>$TMPFILE
d138 1
a138 1
mv $TMPFILE $HORDE_FILE > /dev/null 2>&1
d140 1
a140 1
### defaults.php3 build
d149 14
d164 7
a170 1
echo "\$default->cache_pages              = true;" >>$TMPFILE
a172 1
                 
d176 1
a176 1
mv $TMPFILE $DEFAULTS_FILE > /dev/null 2>&1
@


1.1.2.10
log
@[IEM] removing defaults.php3 since it's not being used and doesn't need
to be here anymore.
@
text
@d10 4
a13 2
OPTIONS_FILE="/etc/horde/horde.options";
CHOICES_FILE="/etc/horde/horde.choices";
d21 4
d76 3
a78 3
mv $TMPFILE $CHOICES_FILE > /dev/null 2>&1;
chmod 755 $CHOICES_FILE
chmod go-rwx $CHOICES_FILE
d113 20
@


1.1.2.11
log
@[IEM] minor debian fixes dealing with debconf
@
text
@d33 1
a33 1
for i in `cat $OPTIONS_FILE | grep -v "#"`; do
d75 1
a75 1
. $CHOICES_FILE
d113 1
a113 1
  db_input "critical" "horde/database_type"
d119 1
a119 1
  db_input "high" "horde/database_server"
d123 1
a123 1
  db_input "high" "horde/database_name"
d127 1
a127 1
  db_input "high" "horde/database_user"
d131 1
a131 1
  db_input "high" "horde/database_pass"
d206 1
a206 1
  if [ "$RET" = "Apache" ] || [ "$RET" = "Both" ]; then  
d231 1
a231 1
      if (!(grep 'Added for HORDE' /etc/apache/srm.conf >/dev/null 2>&1)); \
d233 4
a236 2
         echo '# Added for HORDE' >> /etc/apache/srm.conf ;\
         echo 'Alias /horde /usr/share/horde' >> /etc/apache/srm.conf ;\
d240 1
a240 1
  if [ "$RET" = "Apache-SSL" ] || [ "$RET" = "Both" ]; then
d265 1
a265 1
      if (!(grep 'Added for HORDE' /etc/apache-ssl/srm.conf >/dev/null 2>&1)); \
d267 4
a270 2
         echo '# Added for HORDE' >> /etc/apache-ssl/srm.conf ;\
         echo 'Alias /horde /usr/share/horde' >> /etc/apache-ssl/srm.conf ;\
@


1.1.2.12
log
@[IEM] more tweaks...fixing some problems with horde_phplib.inc configuration
@
text
@d135 3
a137 1
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.in > /etc/horde/horde_phplib.inc
@


1.1.2.13
log
@[IEM] committing fixed debian build pieces to bring it up for a pre5 release
@
text
@d158 1
a158 1
       db_input "critical" "horde/dbconfigured"
d163 3
a165 3
       su - postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1"
       su - postgres -c '/usr/bin/psql -q template1 < /usr/share/doc/horde/examples/pgsql_create.sql >/dev/null 2>&1'
       su - postgres -c '/usr/bin/psql -q template1 -c "$PSQL2_QUERY" >/dev/null 2>&1'
d184 1
a184 1
       db_input "critical" "horde/dbconfigured"
d200 1
a200 1
  db_input "critical" "horde/webserver_type"
d237 1
a237 1
    /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache-ssl/httpd.conf >/etc/apache-ssl/httpd.conf.tmp
@


1.1.2.14
log
@[IEM] committing final changes which fix all known issues with the debian
package (potato based)...should be happy for the freeze
@
text
@a5 3
# All questions should have been asked via debconf 
# now we just go get those, build a temp file which we read in and
# then build our config files and set everthing up
d14 3
a16 3
# remove choices file if it exists since we will rebuild it from debconf info
if [ -f "$CHOICES_FILE" ]; then
   rm -f $CHOICES_FILE
d32 1
d34 4
d42 2
d46 11
a56 2
db_get "horde/signup_email"
echo "signup_email=\"$RET\";" >>$TMPFILE
d59 9
a67 2
db_get "horde/problem_email"
echo "problem_email=\"$RET\";" >>$TMPFILE
a76 4
if [ -f $CHOICES_FILE ]; then
  rm -f $CHOICES_FILE
fi

d109 2
a110 10
db_get "horde/database_type"
dbtype="$RET"
db_get "horde/database_server"
dbserver="$RET"
db_get "horde/database_name"
dbname="$RET"
db_get "horde/database_user"
dbuser="$RET"
db_get "horde/database_pass"
dbpass="$RET"
a111 1
## Now take care of the phplib include file ##
d113 22
d137 1
a137 1
if [ "$dbtype" = "PostgreSQL" ]; then
d139 41
a179 40
 /bin/sed -e "s#@@dbname@@#$dbname#" /usr/share/doc/horde/examples/pgsql_create.sql > /usr/share/doc/horde/examples/pgsql_create.sql.new
 cp /usr/share/doc/horde/examples/pgsql_create.sql /usr/share/doc/horde/examples/pgsql_create.sql.bak >/dev/null 2>&1
 mv /usr/share/doc/horde/examples/pgsql_create.sql.new /usr/share/doc/horde/examples/pgsql_create.sql >/dev/null 2>&1

 /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
 cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.back > /dev/null 2>&1
 if (grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1); 
 then 
   (mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init > /dev/null 2>&1); 
 fi
 /etc/init.d/postgresql restart > /dev/null 2>&1
 sleep 2
 if (grep 'extension' /etc/php3/apache/php3.ini | grep 'pgsql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=pgsql.so' >> /etc/php3/apache/php3.ini); fi 
 /bin/sed -e 's#@@dbtype@@#pgsql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
 cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back
 mv /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1

 # Now do some database stuff

 db_get "horde/dbconfigured"
 if [ "$RET" = "no" ]; then
   PSQL2_QUERY="GRANT SELECT, INSERT, UPDATE ON active_sessions, auth_user, auth_user_md5 TO $dbuser"
   su - postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1"
   su - postgres -c '/usr/bin/psql -q template1 < /usr/share/doc/horde/examples/pgsql_create.sql >/dev/null 2>&1'
   su - postgres -c '/usr/bin/psql -q template1 -c "$PSQL2_QUERY" >/dev/null 2>&1'
   db_set "horde/dbconfigured" "yes"
 fi
 /etc/init.d/postgresql restart > /dev/null 2>&1
 cd /usr/share/horde/lib/src && ./build.pl --database=postgres >> /dev/null 2>&1
fi

if [ "$dbtype" = "MySql" ]; then
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/mysql_create.sql > /usr/share/doc/horde/examples/mysql_create.sql.new
  cp /usr/share/doc/horde/examples/mysql_create.sql /usr/share/doc/horde/examples/mysql_create.sql.bak >/dev/null 2>&1
  mv /usr/share/doc/horde/examples/mysql_create.sql.new /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
  chmod go-rwx /usr/share/doc/horde/examples/mysql_create.sql

  if (grep 'extension' /etc/php3/apache/php3.ini | grep 'imap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=imap.so' >> /etc/php3/apache/php3.ini); fi
  if (grep 'extension' /etc/php3/apache/php3.ini | grep 'ldap.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=ldap.so' >> /etc/php3/apache/php3.ini ); fi 
  if (grep 'extension' /etc/php3/apache/php3.ini | grep 'mysql.so'>/dev/null 2>&1); then (notsome="1"); else (echo 'extension=mysql.so' >> /etc/php3/apache/php3.ini); fi
d181 17
a197 39
 /bin/sed -e 's#@@dbtype@@#mysql#' /etc/horde/prepend.php3 > /etc/horde/prepend.php3.new
 cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back              
 cp /etc/horde/prepend.php3.new /etc/horde/prepend.php3 > /dev/null 2>&1
 db_get "horde/dbconfigured"
 if [ "$RET" = "no" ] ; then 
   if [ "$db_pass" = "none" ] ; then
     /usr/bin/mysql -f < /usr/share/doc/horde/examples/mysql_create.sql >/dev/null 2>&1
   else
     /usr/bin/mysql -f --password=$db_pass < /usr/share/doc/horde/examples/mysql_create.sql > /dev/null 2>&1
   fi
   db_set "horde/dbconfigured" "yes"
 fi
 /etc/init.d/mysql restart >/dev/null 2>&1
 cd /usr/share/horde/lib/src && ./build.pl --database=mysql >> /dev/null 2>&1
fi

db_get "horde/webserver_type"
webtype="$RET";
if [ "$webtype" = "Apache" ] || [ "$webtype" = "Both" ]; then  
  /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache/httpd.conf >/etc/apache/httpd.conf.tmp
  cp /etc/apache/httpd.conf /etc/apache/httpd.conf.horde.back > /dev/null 2>&1
  if (grep 'php3_module' /etc/apache/httpd.conf.tmp >/dev/null 2>&1);
  then
    (mv /etc/apache/httpd.conf.tmp /etc/apache/httpd.conf);
  fi
  if (!(grep 'Added for HORDE' /etc/apache/access.conf >/dev/null 2>&1));  \
  then \
    echo ' ' >> /etc/apache/access.conf ;\
    echo '# Added for HORDE' >> /etc/apache/access.conf ;\
    echo '<Directory /usr/share/horde>' >> /etc/apache/access.conf ;\
    echo 'Options Indexes FollowSymLinks' >> /etc/apache/access.conf ;\
    echo 'AllowOverride None' >> /etc/apache/access.conf ;\
    echo 'order allow,deny' >> /etc/apache/access.conf ;\
    echo 'allow from all' >> /etc/apache/access.conf ;\
    echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache/access.conf ;\
    echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache/access.conf ;\
    echo 'php3_magic_quotes_gpc Off' >> /etc/apache/access.conf ;\
    echo '</Directory>' >> /etc/apache/access.conf ;\
    echo '# End HORDE Configuration Block' >> /etc/apache/access.conf ;\ 
d200 35
a234 13
  if (!(grep 'Added for HORDE' /etc/apache/srm.conf >/dev/null 2>&1)); \
  then \
    echo '# Added for HORDE' >> /etc/apache/srm.conf ;\
    echo 'Alias /horde /usr/share/horde' >> /etc/apache/srm.conf ;\
  fi
  /etc/init.d/apache reload >/dev/null 2>&1
fi
if [ "$webtype" = "Apache-SSL" ] || [ "$webtype" = "Both" ]; then
  /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache-ssl/httpd.conf >/etc/apache-ssl/httpd.conf.tmp
  cp /etc/apache-ssl/httpd.conf /etc/apache-ssl/httpd.conf.horde.back > /dev/null 2>&1
  if (grep 'php3_module' /etc/apache-ssl/httpd.conf.tmp >/dev/null 2>&1);
  then
    (mv /etc/apache-ssl/httpd.conf.tmp /etc/apache-ssl/httpd.conf);
d236 31
a266 14
  if (!(grep 'Added for HORDE' /etc/apache-ssl/access.conf >/dev/null 2>&1)); \
  then \
    echo ' ' >> /etc/apache-ssl/access.conf ;\
    echo '# Added for HORDE' >> /etc/apache-ssl/access.conf ;\
    echo '<Directory /usr/share/horde>' >> /etc/apache-ssl/access.conf ;\
    echo 'Options Indexes FollowSymLinks' >> /etc/apache-ssl/access.conf ;\
    echo 'AllowOverride None' >> /etc/apache-ssl/access.conf ;\
    echo 'order allow,deny' >> /etc/apache-ssl/access.conf ;\
    echo 'allow from all' >> /etc/apache-ssl/access.conf ;\
    echo 'php3_include_path /etc/horde:/usr/lib/phplib' >> /etc/apache-ssl/access.conf ;\
    echo 'php3_auto_prepend_file /etc/horde/prepend.php3' >> /etc/apache-ssl/access.conf ;\
    echo 'php3_magic_quotes_gpc Off' >> /etc/apache-ssl/access.conf ;\
    echo '</Directory>' >> /etc/apache-ssl/access.conf ;\
    echo '# End HORDE Configuration Block' >> /etc/apache-ssl/access.conf ;\
d269 6
a274 7
  if (!(grep 'Added for HORDE' /etc/apache-ssl/srm.conf >/dev/null 2>&1)); \
  then \
    echo '# Added for HORDE' >> /etc/apache-ssl/srm.conf ;\
    echo 'Alias /horde /usr/share/horde' >> /etc/apache-ssl/srm.conf ;\
  fi
  /etc/init.d/apache-ssl reload >/dev/null 2>&1
fi
d276 1
a276 6
chown -R www-data.root /usr/share/horde >> /dev/null 2>&1
chmod -R 555 /usr/share/horde/lib/*.lib >> /dev/null 2>&1
chmod 000 /usr/share/horde/setup.php3 >> /dev/null 2>&1
chown -R www-data.root /etc/horde >> /dev/null 2>&1
chmod 555 `find /etc/horde/ -type f -print ` >/dev/null 2>&1
chmod o-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1
a279 1
db_stop
@


1.1.2.15
log
@[IEM] upgrading debconf pieces to use newer debconf routines.
@
text
@d10 1
a10 2
. /usr/share/debconf/confmodule
db_version 2.0
d230 1
a230 1
chown -R www-data.www-data /usr/share/horde >> /dev/null 2>&1
d233 1
a233 1
chown -R www-data.www-data /etc/horde >> /dev/null 2>&1
@


1.1.2.16
log
@[IEM] updates to debian pieces,

     migrating in -devel phplib stuff to -pre version to fix phplib 7.2
issues. (well, part of them)
@
text
@d198 1
a198 3
  /etc/init.d/apache stop >/dev/null 2>&1
  sleep 3
  /etc/init.d/apache start >/dev/null 2>&1
@


1.1.2.17
log
@[IEM] fixing broken debconf pre-configure pieces
@
text
@d14 1
d36 5
a40 10
db_get "horde/horde_root_url"
echo "horde_root_url=\"$RET\";" >>$TMPFILE
db_get "horde/horde_graphics_url"
echo "horde_graphics_url=\"$RET\";" >>$TMPFILE
db_get "horde/faq_url"
echo "faq_url=\"$RET\";" >>$TMPFILE  
db_get "horde/horde_include_dir"  
echo "horde_include_dir=\"$RET\";" >>$TMPFILE
db_get "horde/path_to_sendmail"
echo "path_to_sendmail=\"$RET\";" >>$TMPFILE
d93 1
@


1.1.2.18
log
@[IEM] some more updates to the debconf stuff for debian packages
@
text
@d126 1
a126 1
 if (!(grep 'extension' /etc/php3/apache/php3.ini | grep 'pgsql.so'>/dev/null 2>&1)); then (echo 'extension=pgsql.so' >> /etc/php3/apache/php3.ini); fi 
d128 1
a128 1
 cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back >/dev/null 2>&1
d151 3
a153 3
  if (!(grep 'extension' /etc/php3/apache/php3.ini | grep 'imap.so'>/dev/null 2>&1)); then (echo 'extension=imap.so' >> /etc/php3/apache/php3.ini); fi
  if (!(grep 'extension' /etc/php3/apache/php3.ini | grep 'ldap.so'>/dev/null 2>&1)); then (echo 'extension=ldap.so' >> /etc/php3/apache/php3.ini ); fi 
  if (!(grep 'extension' /etc/php3/apache/php3.ini | grep 'mysql.so'>/dev/null 2>&1)); then (echo 'extension=mysql.so' >> /etc/php3/apache/php3.ini); fi
d156 1
a156 1
 cp /etc/horde/prepend.php3 /etc/horde/prepend.php3.back >/dev/null 2>&1
d176 3
a178 3
  if (grep 'php3_module' /etc/apache/httpd.conf.tmp >/dev/null 2>&1); \
  then \
    mv /etc/apache/httpd.conf.tmp /etc/apache/httpd.conf ; \
d201 3
a203 1
  /etc/init.d/apache restart >/dev/null 2>&1
d208 3
a210 3
  if (grep 'php3_module' /etc/apache-ssl/httpd.conf.tmp >/dev/null 2>&1); \
  then \
    mv /etc/apache-ssl/httpd.conf.tmp /etc/apache-ssl/httpd.conf ; \
a235 2
db_stop

a242 1

d245 1
@


1.1.2.19
log
@[IEM] fixing several problems with debian packaging.  Creating templates for
      manual configuration instead of using debconf for those vi users out
      there.
@
text
@a8 1

a15 1
TEMPLATE_FILE="/etc/horde/horde.php3.in";
d19 1
a19 1
   rm -f "$CHOICES_FILE"
a21 3
db_get "horde/autogen"
if [ "$RET" = true ]; then

d23 2
a24 1
TMPFILE=`mktemp /tmp/horde.XXXXXX` || exit 1
d55 3
a57 3
mv $TMPFILE "$CHOICES_FILE" > /dev/null 2>&1;
chmod 755 "$CHOICES_FILE"
chmod go-rwx "$CHOICES_FILE"
d60 1
a60 14
. "$CHOICES_FILE"

if [ -f "$CHOICES_FILE" ]; then
  rm -f "$CHOICES_FILE"
fi

## end auto-generation file

else

  db_get "horde/autogen"
  if [ "$RET" = false ]; then
    . "$TEMPLATE_FILE"
  fi
d62 2
d67 2
a68 1
TMPFILE=`mktemp /tmp/horde.XXXXXX` || exit 1
d94 1
a94 1
mv $TMPFILE "$HORDE_FILE" > /dev/null 2>&1
d110 1
a110 1
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc.in > /etc/horde/horde_phplib.inc
d114 3
a116 1
 /bin/sed -e "s#@@dbname@@#$dbname#" /usr/share/doc/horde/examples/pgsql_create.sql.in > /etc/horde/pgsql_create.sql
d127 3
a129 1
 /bin/sed -e 's#@@dbtype@@#pgsql#' /etc/horde/prepend.php3.in > /etc/horde/prepend.php3
d137 1
a137 1
   su - postgres -c '/usr/bin/psql -q template1 < /etc/horde/pgsql_create.sql >/dev/null 2>&1'
d146 4
a149 1
  /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/mysql_create.sql.in > /etc/horde/mysql_create.sql
d155 3
a157 1
 /bin/sed -e 's#@@dbtype@@#mysql#' /etc/horde/prepend.php3.in > /etc/horde/prepend.php3
d160 2
a161 2
   if [ "$dbpass" = "none" ] ; then
     /usr/bin/mysql -f < /etc/horde/mysql_create.sql >/dev/null 2>&1
d163 1
a163 1
     /usr/bin/mysql -f --password=$dbpass < /etc/horde/mysql_create.sql > /dev/null 2>&1
d234 2
d245 1
a245 1
db_stop
@


1.1.2.20
log
@[IEM] more updates and bug fixes to the debian packaging...mostly typos
 and more fixes to mysql configuration pieces thanks to feedback.
@
text
@a87 3
echo "/*            DO NOT EDIT           */" >>$TMPFILE
echo "/*   AUTOMATICALLY GENERATED FILE   */" >>$TMPFILE
echo "" >>$TMPFILE
a120 2
db_get "horde/mysql_pass"
mysqlpass="$RET"
d168 1
a168 1
     /usr/bin/mysql -f --password=$mysqlpass < /etc/horde/mysql_create.sql > /dev/null 2>&1
a245 1
db_stop
d248 1
a248 1

@


1.1.2.21
log
@[IEM] fixing more debconf bugs
@
text
@d133 1
a133 1
 /bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbuser@@#$dbuser#" /usr/share/doc/horde/examples/pgsql_create.sql.in > /etc/horde/pgsql_create.sql
d152 2
a153 1
   su - postgres -c "/usr/bin/psql -q template1 < /etc/horde/pgsql_create.sql >/dev/null 2>&1"
@


1.1.2.22
log
@[IEM] forgot a couple more fixes to the debconf pieces
@
text
@d150 1
@


1.1.2.23
log
@[IEM] more debconf cleanup. Adding a update-horde script to rebuild config
files after modifying the templates.
@
text
@d15 1
d19 19
a37 2
db_get "horde/configmethod"
if [ "$RET" = "auto" ]; then
d40 1
a40 1
horde_root_url="$RET"
d42 1
a42 1
horde_graphics_url="$RET"
d44 1
a44 1
faq_url="$RET"
d46 1
a46 1
horde_include_dir="$RET"
d48 1
a48 1
path_to_sendmail="$RET"
d50 1
a50 1
signup="$RET"
d52 1
a52 1
signup_email="$RET"
d54 1
a54 1
problem_reporting="$RET"
d56 15
a70 1
problem_email="$RET"
d74 4
a77 2
  # Read in template
  . "$TEMPLATE_FILE"
a89 2
echo "/* Edit /etc/horde/horde.php3.in and then */" >>$TMPFILE
echo "/* use update-horde to generate this file */" >>$TMPFILE
d150 2
a151 2
   su - postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1" 
   su - postgres -c "/usr/bin/psql -q template1 < /etc/horde/pgsql_create.sql >/dev/null 2>&1" 
@


1.1.2.24
log
@[IEM] setting an option to not recheck non-horde config files during each
upgrade.
@
text
@a98 3
db_get "horde/recheck"
hrecheck="$RET"

a102 1
if [ "$hrecheck" = "yes" ]; then
a111 1
fi
a128 1
if [ "$hrecheck" = "yes" ]; then
d132 1
a132 2
fi
       
a146 2
if [ "$hrecheck" = "yes" ]; then

d172 1
a172 1
  if (!(grep 'Added for HORDE' /etc/apache/srm.conf >/dev/null 2>&1));  \
a173 1
    echo ' ' >> /etc/apache/srm.conf ;\
a176 1

a203 1
    echo ' ' >> /etc/apache-ssl/srm.conf ;\
a208 5

fi

db_input "critical" "horde/recheck" || true
db_go
@


1.1.2.25
log
@[IEM] more debian updates
@
text
@d94 1
a94 11
db_get "horde/webserver_type"
webtype="$RET"
if [ "$webtype" = "Apache" ]; then
	webpath="apache";
fi
if [ "$webtype" = "Apache-SSL" ]; then
	webpath="apache-ssl";
fi
if [ "$webtype" = "Both" ]; then
	webpath="apache";
fi
a104 1
 chown postgres /etc/horde/pgsql_create.sql
d156 64
a219 34
	/bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/$webpath/httpd.conf > /etc/$webpath/httpd.conf.tmp
	cp /etc/$webpath/httpd.conf /etc/$webpath/httpd.conf.horde.back > /dev/null 2>&1
	if (grep 'php3_module' /etc/$webpath/httpd.conf.tmp >/dev/null 2>&1); \
	then \
		mv /etc/$webpath/httpd.conf.tmp /etc/$webpath/httpd.conf ; \
	fi
	if (!(grep 'Added for HORDE' /etc/$webpath/access.conf >/dev/null 2>&1));  \
	then \
		cat /usr/share/doc/horde/examples/apache_access.conf.in >> /etc/$webpath/access.conf ;\
	fi
	if (!(grep 'Added for HORDE' /etc/$webpath/srm.conf >/dev/null 2>&1));  \
	then \
		cat /usr/share/doc/horde/examples/apache_srm.conf.in >> /etc/$webpath/srm.conf ;\
	fi
	/etc/init.d/$webpath restart >/dev/null 2>&1

if [ "$webtype" = "Both" ]; then
	/bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache-ssl/httpd.conf >/etc/apache-ssl/httpd.conf.tmp
	cp /etc/apache-ssl/httpd.conf /etc/apache-ssl/httpd.conf.horde.back > /dev/null 2>&1
	if (grep 'php3_module' /etc/apache-ssl/httpd.conf.tmp >/dev/null 2>&1); \
	then \
		mv /etc/apache-ssl/httpd.conf.tmp /etc/apache-ssl/httpd.conf ; \
	fi
        if (!(grep 'Added for HORDE' /etc/apache-ssl/access.conf >/dev/null 2>&1));  \
        then \
                cat /usr/share/doc/horde/examples/apache_access.conf.in >> /etc/
apache-ssl/access.conf ;\
        fi
        if (!(grep 'Added for HORDE' /etc/apache-ssl/srm.conf >/dev/null 2>&1)); \
        then \
                cat /usr/share/doc/horde/examples/apache_srm.conf.in >> /etc/apache-ssl/srm.conf ;\
        fi


a221 1
##end recheck
a223 1

d233 1
a233 3
if [ -f /etc/horde/pgsql_create.sql ]; then
  chown postgres /etc/horde/pgsql_create.sql >>/dev/null 2>&1
fi
@


1.1.2.26
log
@[IEM} more bug fixes for debian packaging
@
text
@d181 1
a217 3
  /etc/init.d/postgresql stop > /dev/null 2>&1
  sleep 1
  /etc/init.d/postgresql start > /dev/null 2>&1
a219 12

if [ "$webtype" = "Apache" ] || [ "$webtype" = "Both" ]; then
  /etc/init.d/apache stop > /dev/null 2>&1
  sleep 1
  /etc/init.d/apache start > /dev/null 2>&1
fi
if [ "$webtype" = "Apache-SSL" ] || [ "$webtype" = "Both" ]; then
  /etc/init.d/apache-ssl stop > /dev/null 2>&1
  sleep 1
  /etc/init.d/apache-ssl start > /dev/null 2>&1
fi

@


1.1.2.27
log
@[IEM] Fixing up index.php3 queries during Apache check. Other minor tweaks
for debian packages
@
text
@a180 8
	if (!(grep 'index.php3' /etc/$webpath/srm.conf >/dev/null 2>&1)); \
	then \
		/bin/sed -e "s# index.html # index.html index.php3 #" /etc/$webpath/srm.conf /etc/$webpath/srm.conf.new ;\
		if (grep 'index.php3' /etc/$webpath/srm.conf.new > /dev/null 2>&1); \
		then \
			cp /etc/$webpath/srm.conf.new /etc/$webpath/srm.conf ;\
		fi
	fi
a196 8
        fi
        if (!(grep 'index.php3' /etc/$webpath/srm.conf >/dev/null 2>&1)); \
        then \
                /bin/sed -e "s# index.html # index.html index.php3 #" /etc/$webpath/srm.conf /etc/$webpath/srm.conf.new ;\
                if (grep 'index.php3' /etc/$webpath/srm.conf.new > /dev/null 2>&1); \
                then \
                        cp /etc/$webpath/srm.conf.new /etc/$webpath/srm.conf ;\
                fi
@


1.1.2.28
log
@[IEM] more debian config pieces and fixes
@
text
@d96 9
a104 1

d167 3
a169 4
if [ "$webtype" = "Apache" ]; then
	/bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/apache/httpd.conf > /etc/apache/httpd.conf.tmp
	cp /etc/apache/httpd.conf /etc/apache/httpd.conf.horde.back > /dev/null 2>&1
	if (grep 'php3_module' /etc/apache/httpd.conf.tmp >/dev/null 2>&1); \
d171 1
a171 1
		mv /etc/apache/httpd.conf.tmp /etc/apache/httpd.conf ; \
d173 1
a173 1
	if (!(grep 'Added for HORDE' /etc/apache/access.conf >/dev/null 2>&1));  \
d175 1
a175 1
		cat /usr/share/doc/horde/examples/apache_access.conf.in >> /etc/apache/access.conf ;\
d177 1
a177 1
	if (!(grep 'Added for HORDE' /etc/apache/srm.conf >/dev/null 2>&1));  \
d179 1
a179 1
		cat /usr/share/doc/horde/examples/apache_srm.conf.in >> /etc/apache/srm.conf ;\
d181 1
a181 1
	if (!(grep 'index.php3' /etc/apache/srm.conf >/dev/null 2>&1)); \
d183 2
a184 2
		/bin/sed -e "s# index.html # index.html index.php3 #" /etc/apache/srm.conf /etc/apache/srm.conf.new ;\
		if (grep 'index.php3' /etc/apache/srm.conf.new > /dev/null 2>&1); \
d186 1
a186 1
			cp /etc/apache/srm.conf.new /etc/apache/srm.conf ;\
d190 1
a190 3
fi

if [ "$webtype" = "Apache-SSL" ] || [ "$webtype" = "Both" ]; then
d206 1
a206 1
        if (!(grep 'index.php3' /etc/apache-ssl/srm.conf >/dev/null 2>&1)); \
d208 2
a209 2
                /bin/sed -e "s# index.html # index.html index.php3 #" /etc/apache-ssl/srm.conf /etc/apache-ssl/srm.conf.new ;\
                if (grep 'index.php3' /etc/apache-ssl/srm.conf.new > /dev/null 2>&1); \
d211 1
a211 1
                        cp /etc/apache-ssl/srm.conf.new /etc/apache-ssl/srm.conf ;\
@


1.1.2.29
log
@[IEM] more debian fixes to the debconf stuff
@
text
@d21 18
a38 18
  db_get "horde/horde_root_url"
  horde_root_url="$RET"
  db_get "horde/horde_graphics_url"
  horde_graphics_url="$RET"
  db_get "horde/faq_url"
  faq_url="$RET"
  db_get "horde/horde_include_dir"  
  horde_include_dir="$RET"
  db_get "horde/path_to_sendmail"
  path_to_sendmail="$RET"
  db_get "horde/signup"
  signup="$RET"
  db_get "horde/signup_email"
  signup_email="$RET"
  db_get "horde/problem_reporting"
  problem_reporting="$RET"
  db_get "horde/problem_email"
  problem_email="$RET"
@


1.1.2.30
log
@[IEM] more debian work...redoing postinst script including a better way
of doing things thanks to another debian guru...fixed up alot of other items
and added more documentation
@
text
@d14 4
a17 1
# Determine automatic or manual configuration
d19 1
a19 1
configmethod="$RET"
a20 2
# If automatic, ask questions, otherwise, read the file
if [ "$configmethod" = "auto" ]; then
d39 1
d41 1
d43 2
a44 1
  . /etc/horde/horde.php3.in
d47 35
a81 1
# FIXME: Other questions, makes manual seem pretty pointless, no?
d96 5
a100 4
db_get "horde/dbconfigured"
dbconfigured="$RET"
db_get "horde/dblocal"
dblocal="$RET"
a102 2
db_get "horde/restart"
restart="$RET"
d104 1
a104 43
# These shortnames allow us to make sed statements common
case $dbtype in
  MySql)
    mydbtype="mysql"
    ;;
  PostgreSQL)
    mydbtype="pgsql"
    ;;
esac

# Translation allows us to use this value on the command line
case $dbpass in
  none)
    mydbpass=
    ;;
  *)
    mydbpass=$dbpass
    ;;
esac

# Allows us to loop and substitute in one pass
case $webtype in
  Apache)
    mywebtype="apache"
    ;;
  Apache-SSL)
    mywebtype="apache-ssl"
    ;;
  Both)
    mywebtype="apache apache-ssl"
    ;;
esac

/bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /etc/horde/horde_phplib.inc.in > /etc/horde/horde_phplib.inc

/bin/sed -e "s#@@dbname@@#$dbname#; s#@@dbserver@@#$dbserver#; s#@@dbuser@@#$dbuser#; s#@@dbpass@@#$dbpass#" /usr/share/doc/horde/examples/${mydbtype}_create.sql.in > /etc/horde/${mydbtype}_create.sql

# FIXME: is this really necessary?  (yes it is)
if [ "$dblocal" = "yes" ]; then
  if [ "$dbtype" = "PostgreSQL" ]; then
    chown postgres /etc/horde/pgsql_create.sql
  fi
fi
d106 2
a107 1
/bin/sed -e "s#@@dbtype@@#${mydbtype}#" /etc/horde/prepend.php3.in > /etc/horde/prepend.php3
d109 24
a132 2
db_input "critical" "horde/recheck" || true
db_go
d134 2
a136 1
# If we're asked to check others' files
d138 17
a154 44
if [ "$dblocal" = "yes" ]; then
  if [ "$dbtype" = "PostgreSQL" ]; then
    /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
    cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.bak > /dev/null 2>&1
    if grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1; then
      mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init >/dev/null 2>&1;
    fi
    # FIXME: You shouldn't go around doing people's databases like this
    if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
      /etc/init.d/postgresql restart >/dev/null 2>&1
      sleep 2
    fi
  fi
fi
  # Make sure all the extensions are being loaded
  for ext in "$mydbtype"; do
    if egrep -v "^[[:space:]]*extension.*${ext}\.so" /etc/php3/apache/php3.ini >/dev/null 2>&1; then
      echo 'extension=${ext}.so' >>/etc/php3/apache/php3.ini
    fi
  done

  # Make sure all our web servers are appropriately configured.
  for server in $mywebtype; do
    /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/$server/httpd.conf > /etc/$server/httpd.conf.tmp
    cp /etc/$server/httpd.conf /etc/$server/httpd.conf.horde.back >/dev/null 2>&1
    if grep 'php3_module' /etc/$server/httpd.conf.tmp >/dev/null 2>&1; then
      mv /etc/$server/httpd.conf.tmp /etc/$server/httpd.conf
    fi
    if grep -v 'Added for HORDE' /etc/$server/access.conf >/dev/null 2>&1; then
      cat /usr/share/doc/horde/examples/apache_access.conf.in >>/etc/$server/access.conf
    fi
    if grep -v 'Added for HORDE' /etc/$server/srm.conf >/dev/null 2>&1; then
      cat /usr/share/doc/horde/examples/apache_srm.conf.in >>/etc/$server/srm.conf
    fi
    if grep -v 'index.php3' /etc/$server/srm.conf >/dev/null 2>&1; then
      /bin/sed -e "s# index.html # index.html index.php3 #" /etc/$server/srm.conf /etc/$server/srm.conf.new
      if grep 'index.php3' /etc/$server/srm.conf.new > /dev/null 2>&1; then
        cp /etc/$server/srm.conf.new /etc/$server/srm.conf
      fi
    fi
    if [ "$restart" = "webserver" ] || [ "$restart" = "both" ]; then
      /etc/init.d/apache restart > /dev/null 2>&1
    fi
  done
d157 1
d159 23
d183 1
d185 24
a208 24
if [ "$dblocal" = "yes" ]; then
if [ "$dbconfigured" = "no" ] ; then 
  case $dbtype in
    PostgreSQL)
      # FIXME: These statements aren't very robust, they should take
      # into account the possibility of the database being on another
      # host, etc.
      su - postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1" 
      su - postgres -c "/usr/bin/psql -q template1 < /etc/horde/pgsql_create.sql >/dev/null 2>&1" 
 
    if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
      /etc/init.d/postgresql restart >/dev/null 2>&1
      sleep 2
    fi
    ;;

    MySql)
      /usr/bin/mysql -f --password=$mydbpass < /etc/horde/mysql_create.sql > /dev/null 2>&1
      /usr/bin/mysql -f --password=$mydbpass -e "flush priveleges" > /dev/null 2>&1
    ;;
  esac
  db_set "horde/dbconfigured" "yes"
fi
fi
d211 1
a211 2
# Build the code
cd /usr/share/horde/lib/src && ./build.pl --database=$altdbtype >> /dev/null 2>&1
d213 2
a214 3
# Now let's create the horde.php3 file needed by HORDE
cat > /etc/horde/horde.php3 <<EOF
<?php
a215 20
/*            DO NOT EDIT           */
/*   AUTOMATICALLY GENERATED FILE   */
/* Edit /etc/horde/horde.php3.in and then */
/* use update-horde to generate this file */

\$default->horde_root_url	= '$horde_root_url';
\$default->horde_graphics_url	= '$horde_graphics_url';
\$default->faq_url		= '$faq_url';
\$default->horde_include_dir	= '$horde_include_dir';

/* Path to sendmail */
\$default->path_to_sendmail	= '$path_to_sendmail';

/* Problem Reporting */
\$default->problem_email	= '$problem_email';
\$default->problem_reporting	= $problem_reporting;

/* Account Signup */
\$default->signup_email		= '$signup_email';
\$default->signup		= $signup;
d217 2
a218 2
?>
EOF
a219 1
# Make sure the perms are right
d227 16
a242 23
  if [ "$dblocal" = "yes" ]; then
    if [ "$dbtype" = "PostgreSQL" ]; then
      chown postgres /etc/horde/pgsql_create.sql
    fi
  fi
fi

if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
  if [ "$dbtype" = "PostgreSQL" ]; then
    echo "Restarting PostgreSQL"
    /etc/init.d/postgresql stop > /dev/null 2>&1
    sleep 2
    /etc/init.d/postgresql start > /dev/null 2>&1
  fi
fi

if [ "$restart" = "webserver" ] || [ "$restart" = "both" ]; then
  for server in $mywebtype; do
    echo "Restarting $mywebtype"
    /etc/init.d/$server stop > /dev/null 2>&1
    sleep 1
    /etc/init.d/$server start > /dev/null 2>&1
  done
a244 1
db_stop
a248 1

@


1.1.2.31
log
@[IEM] more fixes that I overlooked before...debian based stuff...
@
text
@a99 3
# php3 extensions to verify
extensions="$mydbtype"

d118 1
a118 1
if [ "$hrecheck" = "true" ]; then
d134 3
a136 7
  for ext in "$extensions"; do
    echo "checking for $ext php3 extension configuration"
    if egrep "^[[:space:]]*extension.*$ext\.so" /etc/php3/apache/php3.ini >/dev/null 2>&1; then
      echo "php3 extension for $ext found!"
    else
      echo "php3 extension for $ext added!"
      echo "extension=$ext.so" >>/etc/php3/apache/php3.ini
d147 1
a147 4
    if grep 'Added for HORDE' /etc/$server/access.conf >/dev/null 2>&1; then
      echo "HORDE settings in /etc/$server/access.conf found!"
    else
      echo "HORDE settings in /etc/$server/access.conf added"
d150 1
a150 4
    if grep 'Added for HORDE' /etc/$server/srm.conf >/dev/null 2>&1; then
      echo "HORDE settings in /etc/$server/srm.conf found!"
    else
      echo "HORDE settings in /etc/$server/srm.conf added!"
d153 2
a154 5
    if grep 'index.php3' /etc/$server/srm.conf >/dev/null 2>&1; then
      echo "php3 settings in /etc/$server/srm.conf found!"
    else 
      echo "php3 settings in /etc/$server/srm.conf added!"
      /bin/sed -e "s#index.html#index.html index.php3#" /etc/$server/srm.conf > /etc/$server/srm.conf.new
d156 1
a156 1
        mv /etc/$server/srm.conf.new /etc/$server/srm.conf
d176 1
a176 1
      su - postgres -c "/usr/bin/psql -q -f /etc/horde/pgsql_create.sql template1 >/dev/null 2>&1" 
@


1.1.2.32
log
@[IEM] minor fix in postinst for debian package
@
text
@d176 1
a176 6
      for server in $mywebtype; do
        echo "Restarting $mywebtype"
        /etc/init.d/$server stop > /dev/null 2>&1
        sleep 1
        /etc/init.d/$server start > /dev/null 2>&1
      done
@


1.1.2.33
log
@[IEM] typo fixes, cleanup, and whatnot for debian
@
text
@d175 8
d264 3
a266 1
    /etc/init.d/postgresql restart > /dev/null 2>&1
d273 3
a275 1
    /etc/init.d/$server restart > /dev/null 2>&1
@


1.1.2.34
log
@[IEM] more tweaks...adding in more robust configuration options...working
on different types of install options (secure, normal, custom)  all for
debian.
@
text
@d15 2
a16 2
db_get "horde/debconf"
debconf="$RET"
d19 1
a19 1
if [ "$debconf" = "yes" ]; then
d188 2
a189 2
      su postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1" 
      su postgres -c "/usr/bin/psql -q -f /etc/horde/pgsql_create.sql template1 >/dev/null 2>&1" 
@


1.1.2.35
log
@[IEM] trying to keep up...-10 tags for debian stuff...some tweaks to
at least partially allow for php4 use...still need to modify the install
stuff to take php4 into account.
@
text
@a167 4
      /bin/sed -e "s#index.html index.php3#index.html index.php index.php3#" /etc/$server/srm.conf > /etc/$server/srm.conf.new
      if grep 'index.php' /etc/$server/srm.conf.new > /dev/null 2>&1; then
        mv /etc/$server/srm.conf.new /etc/$server/srm.conf
      fi
d170 2
a171 2
      /bin/sed -e "s#index.html#index.html index.php index.php3#" /etc/$server/srm.conf > /etc/$server/srm.conf.new
      if grep 'index.php' /etc/$server/srm.conf.new > /dev/null 2>&1; then
@


1.1.2.36
log
@[IEM] Adding more debian specific docs to horde and cleaning up typos and
whatnot in debian packaging
@
text
@a121 1
  echo "Checking non-HORDE config files"
a179 1
  echo "Finished checking non-HORDE config files"
@


1.1.2.37
log
@[IEM] fixes for update-horde debian script
@
text
@d194 3
a196 7
      if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
        su postgres -c "/usr/share/doc/horde/examples/pgsql_cuser.sh $dbuser $dbpass >/dev/null 2>&1" 
        su postgres -c "/usr/bin/psql -q -f /etc/horde/pgsql_create.sql template1 >/dev/null 2>&1" 
      else
        echo "Can't setup database because we cannot verify that postgres"
        echo "was restarted and configured properly"
      fi
@


1.1.2.38
log
@[IEM] more fixes...mainly with the scripting of the configs
@
text
@d43 1
d62 1
a62 1
db_get "horde/horderecheck"
d107 7
d116 1
a116 1
db_input "critical" "horde/horderecheck" || true
d121 1
a121 1
if [ "$hrecheck" = "yes" ]; then
a124 1
    chown postgres /etc/horde/pgsql_create.sql
a181 3
else
  echo "Not checking non-HORDE config files.  I hope everything is"
  echo "configured properly..."
d185 2
a212 2
else
  echo "Not configuring database at your request..."
a213 2
else
  echo "Not configuring database since it's not local..."
a217 1
echo "Building HORDE libraries "
a248 1
echo "Fixing file permissions"
d278 1
a278 1
echo "All done"
@


1.1.2.39
log
@[IEM] more debian updates...mainly tweaks to coexist with php4
@
text
@d130 10
a140 13
  # Check for php3 files
  if [ -f /etc/php3/apache/php3.ini ]; then
    # Make sure all the extensions are being loaded
    for ext in "$extensions"; do
      echo "checking for $ext php3 extension configuration"
      if egrep "^[[:space:]]*extension.*$ext\.so" /etc/php3/apache/php3.ini >/dev/null 2>&1; then
        echo "php3 extension for $ext found!"
      else
        echo "php3 extension for $ext added!"
        echo "extension=$ext.so" >>/etc/php3/apache/php3.ini
      fi
    done
  fi
@


1.1.2.40
log
@[IEM] more tweaks for php4 interoperability for debian
@
text
@a143 14
  # Check for php4 files
  if [ -f /etc/php4/apache/php.ini ]; then
    # Make sure all the extensions are being loaded
    for ext in "$extensions"; do
      echo "checking for $ext php4 extension configuration"
      if egrep "^[[:space:]]*extension.*$ext\.so" /etc/php4/apache/php.ini >/dev/null 2>&1; then
        echo "php4 extension for $ext found!"
      else
        echo "php4 extension for $ext added!"
        echo "extension=$ext.so" >>/etc/php4/apache/php.ini
      fi
    done
  fi

a187 1
      echo "Trying to configure your PostgreSQL database"
a204 1
      echo "Trying to configure your MySQL database"
@


1.1.2.41
log
@[IEM] some major checks in place to verify that db files exist before trying
to configure them (debian)
@
text
@d118 9
a126 22
    if [ -f /etc/postgresql/postmaster.init ]; then
      /bin/sed -e 's#\# PGALLOWTCPIP=no#PGALLOWTCPIP=yes#; s#\# PGALLOWTCPIP=yes#PGALLOWTCPIP=yes#' /etc/postgresql/postmaster.init >/etc/postgresql/postmaster.init.tmp
      cp /etc/postgresql/postmaster.init /etc/postgresql/postmaster.init.horde.bak > /dev/null 2>&1
      if grep 'PGALLOWTCPIP=yes' /etc/postgresql/postmaster.init.tmp >/dev/null 2>&1; then
        mv /etc/postgresql/postmaster.init.tmp /etc/postgresql/postmaster.init >/dev/null 2>&1;
      fi
      # FIXME: You shouldn't go around doing people's databases like this
      if [ "$restart" = "database" ] || [ "$restart" = "both" ]; then
        /etc/init.d/postgresql restart >/dev/null 2>&1
        sleep 2
      fi
    else
      echo "      **** WARNING ****  "
      echo "You stated your using PostgreSQL as a database and"
      echo "that it is local yet the install program cannot seem"
      echo "to find the config files for it.  The install program"
      echo "will NOT confiugre your database for use with HORDE"
      echo "and thus will not function properly until you get this"
      echo "fixed.  "
      echo " "
      echo "Please press ENTER"
      read q
a201 1
    if [ -f /etc/postgresql/postmaster.init ]; then
a208 1
        db_set "horde/dbconfigured" "yes"
d210 1
a210 1
        echo "Can't setup database because we cannot verify that postgresql"
a216 1
    fi
a219 1
    if [ -f /usr/bin/mysql ]; then
a222 5
      db_set "horde/dbconfigured" "yes"
    else 
      echo "Not configuring MySQL database because we cannot locate"
      echo "the mysql executable"
    fi
d225 1
a283 1
    if [ -f /etc/postgresql/postmaster.init ]; then
a285 1
    fi
@


1.1.2.42
log
@[IEM] fixing a typo in the mysql command line
@
text
@d239 1
a239 1
      /usr/bin/mysql -f --password=$mydbpass -e "flush privileges" > /dev/null 2>&1
@


1.1.2.43
log
@[IEM] small fix in how mysql passwords are stored for debian conf
@
text
@a44 6
if [ "$RET" = "MySql" ]; then  
  db_input "critical" "horde/mysql_pass" || true
  db_go
  mysqlpass="$RET"
  db_reset "horde/mysql_pass"
fi
d53 2
@


1.1.2.44
log
@[IEM] fixing up some mysql setup issues for debian
@
text
@a49 9
  case $mysqlpass in
  none)
    mydbpass=
    ;;
  *)
    mydbpass=$mysqlpass
    ;;
esac

d77 10
@


1.1.2.45
log
@[IEM] fixing typo
@
text
@d50 9
d241 2
a242 7
      if [ "$mysqlpass" = "none" ] ; then
        /usr/bin/mysql -f < /etc/horde/mysql_create.sql > /dev/null 2>&1
        /usr/bin/mysql -f -e "flush privileges" > /dev/null 2>&1
      else
        /usr/bin/mysql -f --password=$mysqlpass < /etc/horde/mysql_create.sql > /dev/null 2>&1
        /usr/bin/mysql -f --password=$mysqlpass -e "flush privileges" > /dev/null 2>&1         
      fi
@


1.1.2.46
log
@[IEM] syncing in my latest debian changes
@
text
@a47 1
  db_get "horde/mysql_pass"
@


1.1.2.47
log
@[IEM] minor tweak to fix a bug when the username the webserver is run as
isn't the default debian one
@
text
@a42 3
db_get "horde/web_user"
webuser="$RET"

d289 1
a289 1
chown -R $webuser.$webuser /usr/share/horde >> /dev/null 2>&1
d292 1
a292 1
chown -R $webuser.$webuser /etc/horde >> /dev/null 2>&1
@


1.1.2.48
log
@[IEM] fixing configuration issues with php4.  Debian package now works with
php3 or php4.
@
text
@a44 2
db_get "horde/phpversion"
phpver="$RET"
d97 1
a97 1
# php extensions to verify
a141 1
if [ "$phpver" = "php3" ]; then
a154 2
fi
if [ "$phpver" = "php4" ]; then
a167 1
fi
a170 1
if [ "$phpver" = "php3" ]; then
a171 4
fi
if [ "$phpver" = "php4" ]; then
    /bin/sed -e 's#\# LoadModule php4_module#LoadModule php4_module#' /etc/$server/httpd.conf > /etc/$server/httpd.conf.tmp
fi
a172 1
if [ "$phpver" = "php3" ]; then
a175 7
fi
if [ "$phpver" = "php4" ]; then 
    if grep 'php4_module' /etc/$server/httpd.conf.tmp >/dev/null 2>&1; then
      mv /etc/$server/httpd.conf.tmp /etc/$server/httpd.conf
    fi
fi

a177 7
      if grep 'php3_auto_prepend_file /etc/horde/prepend.php3' /etc/$server/access.conf >/dev/null 2>&1; then
        echo "Fixing HORDE settings in /etc/$server/access.conf for php4."
        /bin/sed -e "s#php3_include_path#php_value include_path#; s#php3_auto_prepend_file#php_value auto_prepend_file#; s#php3_magic_quotes_gpc#php_value magic_quotes_gpc#" /etc/$server/access.conf >/etc/$server/access.conf.temp
        if grep 'php_value auto_prepend_file' /etc/$server/access.conf.temp >/dev/null 2>&1; then
          mv /etc/$server/access.conf.temp /etc/$server/access.conf >/dev/null 2>&1;
        fi
      fi
d179 2
a180 8
      if [ "$phpver" = "php3" ]; then
        echo "HORDE settings in /etc/$server/access.conf added"
        cat /usr/share/doc/horde/examples/apache_access.conf.in >>/etc/$server/access.conf
      fi
      if [ "$phpver" = "php4" ]; then
        echo "HORDE settings in /etc/$server/access.conf added"
        cat /usr/share/doc/horde/examples/apache_access.php4.conf.in >>/etc/$server/access.conf
      fi
@


1.1.2.49
log
@[IEM] forgot an if statement for the php4 config options
@
text
@d197 5
a201 7
      if [ "$phpver" = "php4" ]; then
        if grep 'php3_auto_prepend_file /etc/horde/prepend.php3' /etc/$server/access.conf >/dev/null 2>&1; then
          echo "Fixing HORDE settings in /etc/$server/access.conf for php4."
          /bin/sed -e "s#php3_include_path#php_value include_path#; s#php3_auto_prepend_file#php_value auto_prepend_file#; s#php3_magic_quotes_gpc#php_value magic_quotes_gpc#" /etc/$server/access.conf >/etc/$server/access.conf.temp
          if grep 'php_value auto_prepend_file' /etc/$server/access.conf.temp >/dev/null 2>&1; then
            mv /etc/$server/access.conf.temp /etc/$server/access.conf >/dev/null 2>&1;
          fi
@


1.1.2.50
log
@[IEM] updating to reflect new pre-release version plus fixing a duplication
in the changelog.
@
text
@d213 1
a213 1
        cat /usr/share/doc/horde/examples/apache_access.conf.php4.in >>/etc/$server/access.conf
@


1.1.2.51
log
@[IEM] one more minor typo cleanup
@
text
@d223 1
a223 1
      echo "php settings in /etc/$server/srm.conf found!"
d229 1
a229 1
      echo "php settings in /etc/$server/srm.conf added!"
@


1.1.2.52
log
@[IEM] debian changes to support new internal phplib files and recent layout
changes (such as prebuilt libs)
@
text
@a96 3
  *)
    mywebtype="none"
    ;;
d176 21
a196 7
  if [ "$mywebtype" = "none" ]; then
    echo "Not configuring web server"
  else 
    for server in $mywebtype; do
      if [ "$phpver" = "php3" ]; then
      /bin/sed -e 's#\# LoadModule php3_module#LoadModule php3_module#' /etc/$server/httpd.conf > /etc/$server/httpd.conf.tmp
      fi
d198 7
a204 1
        /bin/sed -e 's#\# LoadModule php4_module#LoadModule php4_module#' /etc/$server/httpd.conf > /etc/$server/httpd.conf.tmp
d206 1
a206 1
      cp /etc/$server/httpd.conf /etc/$server/httpd.conf.horde.back >/dev/null 2>&1
d208 2
a209 3
        if grep 'php3_module' /etc/$server/httpd.conf.tmp >/dev/null 2>&1; then
          mv /etc/$server/httpd.conf.tmp /etc/$server/httpd.conf
        fi
d211 3
a213 4
      if [ "$phpver" = "php4" ]; then 
        if grep 'php4_module' /etc/$server/httpd.conf.tmp >/dev/null 2>&1; then
          mv /etc/$server/httpd.conf.tmp /etc/$server/httpd.conf
        fi
d215 12
a226 21

      if grep 'Added for HORDE' /etc/$server/access.conf >/dev/null 2>&1; then
        echo "HORDE settings in /etc/$server/access.conf found!"
        if [ "$phpver" = "php4" ]; then
          if grep 'php3_auto_prepend_file /etc/horde/prepend.php3' /etc/$server/access.conf >/dev/null 2>&1; then
            echo "Fixing HORDE settings in /etc/$server/access.conf for php4."
            /bin/sed -e "s#php3_include_path#php_value include_path#; s#php3_auto_prepend_file#php_value auto_prepend_file#; s#php3_magic_quotes_gpc#php_value magic_quotes_gpc#" /etc/$server/access.conf >/etc/$server/access.conf.temp
            if grep 'php_value auto_prepend_file' /etc/$server/access.conf.temp >/dev/null 2>&1; then
              mv /etc/$server/access.conf.temp /etc/$server/access.conf >/dev/null 2>&1;
            fi
          fi
        fi
      else
        if [ "$phpver" = "php3" ]; then
          echo "HORDE settings in /etc/$server/access.conf added"
          cat /usr/share/doc/horde/examples/apache_access.conf.in >>/etc/$server/access.conf
        fi
        if [ "$phpver" = "php4" ]; then
          echo "HORDE settings in /etc/$server/access.conf added"
          cat /usr/share/doc/horde/examples/apache_access.conf.php4.in >>/etc/$server/access.conf
        fi
d228 5
a232 5
      if grep 'Added for HORDE' /etc/$server/srm.conf >/dev/null 2>&1; then
        echo "HORDE settings in /etc/$server/srm.conf found!"
      else
        echo "HORDE settings in /etc/$server/srm.conf added!"
        cat /usr/share/doc/horde/examples/apache_srm.conf.in >>/etc/$server/srm.conf
d234 2
a235 15
      if grep 'index.php3' /etc/$server/srm.conf >/dev/null 2>&1; then
        echo "php settings in /etc/$server/srm.conf found!"
        /bin/sed -e "s#index.html index.php3#index.html index.php index.php3#" /etc/$server/srm.conf > /etc/$server/srm.conf.new
        if grep 'index.php' /etc/$server/srm.conf.new > /dev/null 2>&1; then
          mv /etc/$server/srm.conf.new /etc/$server/srm.conf
        fi
      else 
        echo "php settings in /etc/$server/srm.conf added!"
        /bin/sed -e "s#index.html#index.html index.php index.php3#" /etc/$server/srm.conf > /etc/$server/srm.conf.new
        if grep 'index.php' /etc/$server/srm.conf.new > /dev/null 2>&1; then
          mv /etc/$server/srm.conf.new /etc/$server/srm.conf
        fi
      fi
    done
  fi
d293 2
a294 2
# echo "Building HORDE libraries "
# cd /usr/share/horde/lib/src && ./build.pl --database=$altdbtype >> /dev/null 2>&1
@


1.1.2.53
log
@[IEM] new hacks to debian install process:

    no longer hack apache's access.conf file to set php prepend and libdir
       settings
    no longer use ./config for conf files, instead point directly to
       /etc/horde which increases security since files in that dir will no
       longer be accessable via the web
@
text
@a202 13
      cat /etc/$server/access.conf | grep -v "auto_prepend_file /etc/horde/prepend.php3" | grep -v "include_path /etc/horde" >/etc/$server/access.conf.new
      if grep 'Added for HORDE' /etc/$server/access.conf >/dev/null 2>&1; then
        mv /etc/$server/access.conf.new /etc/$server/access.conf
      fi

        if [ "$phpver" = "php3" ]; then
          if grep 'php3_include_path /etc/horde;/usr/lib/phplib' /etc/$server/access.conf >/dev/null 2>&1; then
            /bin/sed -e "s#/etc/horde;/usr/lib/phplib#/etc/horde#" /etc/$server/access.conf >/etc/$server/access.conf.temp
            if grep 'php3_include_path /etc/horde' /etc/$server/access.conf.temp >/dev/null 2>&1; then 
              mv /etc/$server/access.conf.temp /etc/$server/access.conf >/dev/null 2>&1; 
            fi
          fi
        fi
d204 5
a208 4
          if grep 'php_value include_path /etc/horde;/usr/lib/phplib' /etc/$server/access.conf >/dev/null 2>&1; then
            /bin/sed -e "s#/etc/horde;/usr/lib/phplib#/etc/horde#" /etc/$server/access.conf >/etc/$server/access.conf.temp
            if grep 'php_value include_path /etc/horde' /etc/$server/access.conf.temp >/dev/null 2>&1; then
              mv /etc/$server/access.conf.temp /etc/$server/access.conf >/dev/null 2>&1; 
d298 4
@


1.1.2.54
log
@[IEM] adding in a fix for exim support.  the web user needs to be in the
trusted user list in order to modify the sending users header.
@
text
@a371 10

if [ -e /etc/exim.conf ]; then 
  echo "Modifying /etc/exim.conf to allow IMP to send mail properly";
  /bin/sed -e 's#trusted_users = #trusted_users = www-data:#' /etc/exim.conf > /etc/exim.conf.tmp
  cp /etc/exim.conf /etc/exim.conf.bak >/dev/null 2>&1
  if grep 'trusted_users = www-data:' /etc/exim.conf.tmp >/dev/null 2>&1; then
    mv /etc/exim.conf.tmp /etc/exim.conf >/dev/null 2>&1;     
  fi
fi

@


1.1.2.55
log
@[IEM] updating horde with some more perm fixes and whatnot
@
text
@d346 1
a346 1
chmod go-rwx `find /etc/horde/ -type f -print ` >/dev/null 2>&1
@


1.1.2.56
log
@[IEM] better handling of exim
@
text
@d373 9
@


1.1.2.57
log
@[IEM] verify that php/apache versions haven't change since last install
@
text
@a44 1

a46 1
db_reset "horde/phpversion"
a66 1
db_reset "horde/webserver_type"
@


1.1.2.58
log
@[IEM] some cleanup with the debconf pieces
@
text
@a104 8
for server in $mywebtype; do   
 if [ -f /etc/$server/httpd.conf ]; then
   echo "Web installation seems ok..."
 else 
   mywebtype="none"
 fi
done

@


1.1.2.59
log
@[[IEM] oops...a couple quick fixes to my last fixes that were fixes of other
fixes
@
text
@a45 3
db_reset "horde/phpversion"
db_input "critical" "horde/phpversion" || true
db_go
d48 1
a52 1
  db_reset "horde/mysql_pass"
a66 3
db_reset "horde/webserver_type"
db_input "critical" "horde/webserver_type" || true
db_go
@


1.1.2.60
log
@[IEM] minor updates, typo fixes, etc for debian
@
text
@d158 2
a159 3
      echo "...sleeping for 5 seconds..."
      echo " "
      sleep 5
@


1.1.2.61
log
@[IEM] updating debian files..fixing typos in update-horde and other scripts
@
text
@a44 2
db_get "horde/web_group"
webgroup="$RET"
d359 1
a359 1
chown -R $webuser.$webgroup /usr/share/horde >> /dev/null 2>&1
d362 1
a362 1
chown -R $webuser.$webgroup /etc/horde >> /dev/null 2>&1
@


1.1.2.62
log
@[IEM] updating debian stuff
@
text
@d18 24
a41 2
# Read in template
. /etc/horde/horde.php3.in
d47 4
d53 1
d72 3
d77 1
@


1.1.2.63
log
@[IEM] more debian fixes, mainly bug fixes and typo cleanup
@
text
@d14 4
d220 1
a220 1
          cat /usr/share/doc/horde/examples/apache_access.conf.in >>/etc/$server/access.conf
@


1.1.2.64
log
@[IEM] updating changlog and versions for debian
@
text
@d351 2
a352 2
    echo "Reloading $mywebtype"
    /etc/init.d/$server reload > /dev/null 2>&1
@


1.1.2.65
log
@[IEM] updating debian build pieces
@
text
@d351 2
a352 6
    if [ "$server" = "none" ]; then
      echo "Not reloading web server"
    else
      echo "Reloading $mywebtype"
      /etc/init.d/$server reload > /dev/null 2>&1
    fi
@


1.1.2.66
log
@[IEM] more cleanup to mysql configs
@
text
@d25 8
a272 6
      db_reset "horde/mysql_pass"
      db_input "critical" "horde/mysql_pass" || true
      db_go
      db_get "horde/mysql_pass"
      mysqlpass="$RET"
      db_reset "horde/mysql_pass"
@


1.1.2.67
log
@About to release debian version 1.2.4-1. Quite a lot of changes now.
@
text
@d1 1
a1 1
#! /bin/sh
a4 2
# Modified and modernized by Ola Lundqvist <opal@@debian.org> to allow
# better configuration. Install and deinstall.
d10 43
a52 1
set -e
d54 15
a68 16
# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see /usr/share/doc/packaging-manual/
#
# quoting from the policy:
#     Any necessary prompting should almost always be confined to the
#     post-installation script, and should be protected with a conditional
#     so that unnecessary prompting doesn't happen if a package's
#     installation fails and the `postinst' is called with `abort-upgrade',
#     `abort-remove' or `abort-deconfigure'.
d70 106
a175 11
case "$1" in
    configure)
      # New feature, allowing patches to be applied automaticly.
      if [ -d /usr/share/doc/horde/patches ]; then
	WWD=$PWD
	cd $PWD
	for A in /usr/share/doc/horde/patches/*.patch; do
	  echo "Autopatching horde, using $A"
	  patch -p0 < $A
	done
	cd $WWD
d178 6
a183 1
      . /usr/sbin/update-horde
d185 76
d263 21
a283 7
    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 0
d285 72
a356 1
esac
d358 1
a358 2
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
a360 1

@


1.1.2.68
log
@Relased version 1.2.4-1.
@
text
@d34 1
a34 1
      if [ -d /etc/horde/patches ]; then
d37 1
a37 1
	for A in /etc/horde/patches/*.patch; do
d44 1
a44 1
      /usr/sbin/update-horde
d60 2
@


1.1.2.69
log
@Major changes, next version of horde.
@
text
@d3 4
a6 1
# Written by Ola Lundqvist <opal@@debian.org>
d33 10
a42 5
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
. /usr/share/debconf/confmodule
db_version 2.0
d44 1
a44 1
extensions=
a45 249
db_get "horde/webserver_type"
webtype="$RET"
# Type of the databasemgr to use.
db_get "horde/databasemgr_type"
dbtype="$RET"
if [ "$dbtype" != "none" ] ; then
    # Where it is located.
    db_get "horde/databasemgr_server"
    dbserver="$RET"
    # Name of the database
    db_get "horde/database_name"
    dbname="$RET"
    # Name of the user to have access.
    db_get "horde/database_user"
    dbuser="$RET"
    # Its password.
    db_get "horde/database_pass"
    dbpass="$RET"
fi

# These shortnames allow us to make sed statements common
case $dbtype in
    MySql)
	mydbtype="mysql"
    ;;
    PostgreSQL)
	mydbtype="pgsql"
    ;;
    none)
	mydbtype="none"
    ;;
esac

if [ "$dbtype" != "none" ] ; then
    extensions="$extensions $mydbtype"
fi

# Allows us to loop and substitute in one pass
case $webtype in
    Apache)
	mywebtype="apache"
    ;;
    Apache-SSL)
	mywebtype="apache-ssl"
    ;;
    Both)
	mywebtype="apache apache-ssl"
    ;;
    *)
	mywebtype=""
    ;;
esac

###############################################################################
######################### Non HORDE stuff, checking ###########################
###############################################################################

###############################################################################
################################ Php3/4 #######################################
###############################################################################
. /usr/share/wwwconfig-common/php-extensions.sh

for server in $mywebtype ; do
    ###########################################################################
    ################### First get the apache user and group ###################
    ###########################################################################
    . /usr/share/wwwconfig-common/apache-run.get

    ###########################################################################
    ################################# Exim ####################################
    ###########################################################################
    trustuser=$webuser
    . /usr/share/wwwconfig-common/exim-trust.sh
    if [ "$status" = "trust" ] ; then
	restart="exim $restart"
    fi

    ###########################################################################
    ################################ Apache ###################################
    ###########################################################################
    # Make sure all our web servers are appropriately configured.
    . /usr/share/wwwconfig-common/apache-php.sh
    if [ "$status" = "uncomment" ] ; then
	restart="$server $restart"
    fi

    ###########################################################################
    ###################### New style config in apache #########################
    ###########################################################################
    includefile=/etc/horde/apache.conf
    . /usr/share/wwwconfig-common/apache-include_all.sh
    if [ "$status" = "uncomment" -o "$status" = "include" ] ; then
	restart="$server $restart"
    fi

    ###########################################################################
    ######################## Php indexing in apache. ##########################
    ###########################################################################
    for index in index.php index.php3; do
	. /usr/share/wwwconfig-common/apache-index_all.sh
	if [ "$status" = "added" ] ; then
	    restart="$server $restart"
	fi
    done
    ###########################################################################
    ######################## Removing old HORDE configs #######################
    ###########################################################################
    if grep 'Added for HORDE' /etc/$server/access.conf >/dev/null 2>&1; then
        echo "HORDE settings in /etc/$server/access.conf found, removing old style."
	cat /etc/$server/access.conf | /etc/scripts/remove-oldaccessconfig \
	    > /etc/$server/access.conf.new
        if ! grep 'Added for HORDE' /etc/$server/access.conf.new \
		>/dev/null 2>&1; then
	    mv /etc/$server/access.conf.new /etc/$server/access.conf
	else
	    echo "Unable to remove the old style, you have to fix this manually."
        fi
    fi
    if grep 'Added for HORDE' /etc/$server/srm.conf >/dev/null 2>&1; then
        MATCH='[[:space:]]*Alias[[:space:]][[:space:]]*/horde/*[[:space:]][[:space:]]*/usr/share/horde/*'
        echo "HORDE settings in /etc/$server/srm.conf found, removing old style."
	    cat /etc/$server/srm.conf | grep -v 'Added for HORDE' \
		| grep -v "$MATCH" > \
	    /etc/$server/srm.conf.new
	mv /etc/$server/srm.conf /etc/$server/srm.conf.back
	mv /etc/$server/srm.conf.new /etc/$server/srm.conf
	if grep -e "$MATCH" /etc/$server/srm.conf; then
	    cat /etc/$server/srm.conf | grep -v "$MATCH" > \
		/etc/$server/srm.conf.new
	    mv /etc/$server/srm.conf /etc/$server/srm.conf.back
	    mv /etc/$server/srm.conf.new /etc/$server/srm.conf
	fi
    fi
done

###############################################################################
########################## Fixing permissions #################################
###############################################################################

chmod 000 /usr/share/horde/setup.php3 >> /dev/null 2>&1

###############################################################################
############################### Configure database ############################
###############################################################################

if [ "$dbtype" != "none" ] ; then
    ###########################################################################
    ########################### Phplib update #################################
    ###########################################################################
    /bin/sed -e \
	"
	s#@@dbname@@#$dbname#;
	s#@@dbserver@@#$dbserver#;
	s#@@dbuser@@#$dbuser#;
	s#@@dbpass@@#$dbpass#" \
	/etc/horde/horde_phplib.inc.in > /etc/horde/horde_phplib.inc

    /bin/sed -e \
	"
	s#@@dbname@@#$dbname#;
	s#@@dbserver@@#$dbserver#;
	s#@@dbuser@@#$dbuser#;
	s#@@dbpass@@#$dbpass#" \
	/usr/share/doc/horde/examples/${mydbtype}_create.sql.in \
	> /etc/horde/${mydbtype}_create.sql

    /bin/sed -e \
	"s#@@dbtype@@#$mydbtype#" \
	/etc/horde/prepend.php3.in > /etc/horde/prepend.php3
fi

case $dbtype in
    PostgreSQL)
	#######################################################################
	########################## PostgreSQL #################################
	#######################################################################
	if [ "$dbserver" != "localhost" ] ; then
	    echo "You have to modify the postgres server manually to allow"
	    echo "network requests!"
	else
	    . /usr/share/wwwconfig-common/pgsql-allowip.sh
	    if [ "$status" = "error" ] ; then
		echo "      **** WARNING ****  "
		echo "You stated your using PostgreSQL as a database and"
		echo "that it is local yet the install program cannot seem"
		echo "to set up the config files for it."
	    fi
	fi
	if [ -x $(which psql) ]; then
	    db_get "horde/dbpgadmin"
	    dbadmin="$RET"
	    . /usr/share/wwwconfig-common/pgsql-createdb.sh
	    if [ "$status" = "create" ] ; then
		sqlfile=/etc/horde/pgsql_create.sql
		. /usr/share/wwwconfig-common/pgsql-exec.sh
	    fi
	    . /usr/share/wwwconfig-common/pgsql-createuser.sh
        else 
	    echo "Not configuring PostgreSQL database because we cannot locate"
	    echo "the psql client executable (postgresql-client package missing)."
        fi
      ;;

    MySql)
	if [ -x $(which mysql) ]; then
	    db_get "horde/dbmyadmin"
	    dbadmin="$RET"
	    # Just for safety.
	    db_input "horde/dbadmpass" || true
	    db_go
	    db_get "horde/dbadmpass"
	    dbadmpass="$RET"
	    db_reset "horde/dbadmpass"

	    . /usr/share/wwwconfig-common/mysql-createdb.sh
	    if [ "$status" = "create" ] ; then
		sqlfile=/etc/horde/mysql_create.sql
		. /usr/share/wwwconfig-common/mysql-exec.sh
	    fi
	    . /usr/share/wwwconfig-common/mysql-createuser.sh
        else 
	    echo "Not configuring MySQL database because we cannot locate"
	    echo "the mysql client executable (mysql-client package missing)."
        fi
    ;;
    none)
	echo "Not configuring a database, at your request."
    ;;
esac

########################################################################################
################################# Horde.php3 ###########################################
########################################################################################

###############################################################################
############################# Servers restart #################################
###############################################################################
servers="exim apache-ssl apache"
. /usr/share/wwwconfig-common/restart.sh

# New feature, allowing patches to be applied automaticly.
patchdir=/etc/horde/patches
. /usr/share/wwwconfig-common/autopatch_all.sh

db_stop

#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
a61 2

echo Done
@


1.1.2.70
log
@Fixing bashism.
@
text
@d147 1
a147 1
	cat /etc/$server/access.conf | /etc/horde/scripts/remove-oldaccessconfig \
a177 12
if [ ! -z "$webuser" ] ; then
    if [ ! -z "$webgroup" ] ; then
	if [ -f /etc/horde/local.inc ] ; then
	    chgrp $webgroup /etc/horde/local.inc*
	    chmod o-rwx /etc/horde/local.inc*
	fi
	if [ -f /etc/horde/horde_phplib.inc ] ; then
	    chgrp $webgroup /etc/horde/horde_phplib.inc*
	    chmod o-rwx /etc/horde/horde_phplib.inc*
	fi
    fi
fi
d268 3
a270 3
###############################################################################
################################# Horde.php3 ##################################
###############################################################################
d303 2
@


1.1.2.71
log
@Next debian version.
@
text
@d255 8
a262 17
	    if [ -e /usr/share/wwwconfig-common/mysql-localadmpass.get ] ; then
		. /usr/share/wwwconfig-common/mysql-localadmpass.get
	    fi
	    if [ -z "$dbadmin" ] ; then
		db_input "high" "horde/dbadmin" || true
		db_go
		db_get "horde/dbmyadmin"
		dbadmin="$RET"
            fi
	    if [ -z "$dbadmpass" ] ; then
		# Just for safety.
		db_input "critical" "horde/dbadmpass" || true
		db_go
		db_get "horde/dbadmpass"
		dbadmpass="$RET"
		db_reset "horde/dbadmpass"
	    fi
@


