head	1.40;
access;
symbols
	caudium_1_4_9:1.38.2.6
	caudium_1_4_8:1.38.2.6
	caudium_1_4_7:1.38.2.3
	caudium_1_4_6:1.38.2.3
	caudium_1_2_35:1.29.2.9
	caudium_1_2_34:1.29.2.9
	caudium_1_4_5:1.38
	caudium_1_4_4:1.38
	caudium_1_4_3:1.38
	caudium_1_4_2:1.38
	caudium_1_5_1:1.38
	caudium_1_4_1:1.38
	stable_1_4:1.38.0.2
	caudium_1_3_33:1.38
	caudium_1_3_32:1.38
	caudium_1_3_31:1.38
	caudium_1_3_30:1.38
	caudium_1_3_29:1.38
	caudium_1_2_33:1.29.2.9
	caudium_1_2_32:1.29.2.9
	caudium_1_3_23:1.37
	caudium_1_3_22:1.37
	caudium_1_3_21:1.37
	caudium_1_3_20:1.37
	caudium_1_3_19:1.37
	caudium_1_3_18:1.37
	caudium_1_2_31:1.29.2.8
	caudium_1_2_30:1.29.2.8
	caudium_1_2_29:1.29.2.8
	caudium_1_2_28:1.29.2.8
	caudium_1_3_17:1.37
	caudium_1_3_16:1.37
	caudium_1_2_27:1.29.2.8
	caudium_1_2_26:1.29.2.8
	caudium_1_2_25:1.29.2.8
	caudium_1_2_24:1.29.2.8
	caudium_1_0_57:1.15.2.5
	caudium_1_0_56:1.15.2.5
	caudium_1_3_15:1.37
	caudium_1_3_14:1.37
	caudium_1_2_23:1.29.2.6
	caudium_1_2_22:1.29.2.6
	caudium_1_2_21:1.29.2.6
	caudium_1_2_20:1.29.2.6
	caudium_1_0_55:1.15.2.5
	caudium_1_0_54:1.15.2.5
	caudium_1_3_13:1.36
	caudium_1_3_12:1.36
	caudium_1_3_11:1.36
	caudium_1_3_10:1.36
	caudium_1_2_19:1.29.2.5
	caudium_1_2_18:1.29.2.5
	caudium_1_3_9:1.36
	caudium_1_3_8:1.36
	caudium_1_3_7:1.36
	caudium_1_3_6:1.36
	caudium_1_2_17:1.29.2.5
	caudium_1_2_16:1.29.2.5
	caudium_1_2_15:1.29.2.5
	caudium_1_2_14:1.29.2.5
	caudium_1_2_12:1.29.2.5
	caudium_1_2_10:1.29.2.5
	caudium_1_3_5:1.36
	caudium_1_3_4:1.36
	caudium_1_2_9:1.29.2.5
	caudium_1_2_8:1.29.2.5
	caudium_1_3_3:1.31
	caudium_1_2_7:1.29.2.3
	caudium_1_2_6:1.29.2.3
	caudium_1_0_53:1.15.2.5
	caudium_1_0_52:1.15.2.5
	caudium_1_0_51:1.15.2.5
	caudium_1_0_50:1.15.2.5
	caudium_1_0_45:1.15.2.5
	caudium_1_0_44:1.15.2.5
	caudium_1_0_43:1.15.2.5
	caudium_1_0_42:1.15.2.5
	Caudium_1_3_2:1.31
	caudium_1_2_5:1.29.2.1
	caudium_1_2_4:1.29.2.1
	caudium_1_0_41:1.15.2.5
	caudium_1_0_40:1.15.2.5
	caudium_1_0_39:1.15.2.5
	Caudium_1_0_38:1.15.2.5
	caudium_1_2_3:1.29
	caudium_1_2_2:1.29
	caudium_1_3_1:1.29
	caudium_1_2_1:1.29
	stable_1_2:1.29.0.2
	caudium_1_0_37:1.15.2.4
	caudium_1_0_36:1.15.2.4
	caudium_1_1_5:1.26
	caudium_1_1_4:1.26
	caudium_1_1_3:1.25
	caudium_1_1_2:1.25
	caudium_1_0_32:1.15.2.2
	caudium_1_0_30:1.15.2.2
	caudium_1_0_28:1.15.2.2
	caudium_1_0_24:1.15.2.2
	caudium_1_0_22:1.15.2.2
	caudium_1_0_20:1.15.2.2
	caudium_1_0_18:1.15.2.2
	caudium_1_0_17:1.15.2.2
	caudium_1_0_16:1.15.2.2
	caudium_1_0_15:1.15.2.2
	caudium_1_0_14:1.15.2.2
	caudium_1_0_13:1.15.2.2
	caudium_1_0_12:1.15.2.2
	caudium_1_0_11:1.15
	caudium_1_0_10:1.15
	stable_1_0:1.15.0.2
	caudium_1_0_9:1.14
	caudium_1_0_8:1.13
	caudium_1_0_7:1.13
	caudium_1_0_6:1.13
	caudium_1_0_5:1.13
	caudium_1_0_4:1.13
	caudium_1_0_3:1.13
	caudium_1_0_2:1.13;
locks; strict;
comment	@# @;


1.40
date	2005.11.29.20.46.56;	author grendel;	state Exp;
branches;
next	1.39;

1.39
date	2005.06.14.00.12.46;	author grendel;	state Exp;
branches;
next	1.38;

1.38
date	2003.12.02.02.52.14;	author grendel;	state Exp;
branches
	1.38.2.1;
next	1.37;

1.37
date	2002.12.18.00.18.28;	author grendel;	state Exp;
branches;
next	1.36;

1.36
date	2002.07.16.18.40.57;	author grendel;	state Exp;
branches;
next	1.35;

1.35
date	2002.07.16.18.18.14;	author grendel;	state Exp;
branches;
next	1.34;

1.34
date	2002.07.16.18.00.19;	author grendel;	state Exp;
branches;
next	1.33;

1.33
date	2002.07.08.17.28.12;	author grendel;	state Exp;
branches;
next	1.32;

1.32
date	2002.06.29.16.20.13;	author grendel;	state Exp;
branches;
next	1.31;

1.31
date	2002.04.25.15.45.06;	author grendel;	state Exp;
branches;
next	1.30;

1.30
date	2002.04.17.18.23.48;	author grendel;	state Exp;
branches;
next	1.29;

1.29
date	2002.01.09.15.25.32;	author grendel;	state Exp;
branches
	1.29.2.1;
next	1.28;

1.28
date	2002.01.08.11.46.25;	author grendel;	state Exp;
branches;
next	1.27;

1.27
date	2002.01.03.17.05.36;	author grendel;	state Exp;
branches;
next	1.26;

1.26
date	2001.07.17.15.50.47;	author grendel;	state Exp;
branches;
next	1.25;

1.25
date	2001.06.08.09.28.53;	author grendel;	state Exp;
branches;
next	1.24;

1.24
date	2001.06.07.13.43.06;	author grendel;	state Exp;
branches;
next	1.23;

1.23
date	2001.06.05.14.26.57;	author grendel;	state Exp;
branches;
next	1.22;

1.22
date	2001.05.28.12.26.40;	author grendel;	state Exp;
branches;
next	1.21;

1.21
date	2001.02.08.20.11.52;	author underley;	state Exp;
branches;
next	1.20;

1.20
date	2001.01.31.18.43.11;	author grendel;	state Exp;
branches;
next	1.19;

1.19
date	2001.01.08.16.52.15;	author grendel;	state Exp;
branches;
next	1.18;

1.18
date	2000.12.29.20.47.26;	author grendel;	state Exp;
branches;
next	1.17;

1.17
date	2000.12.29.20.45.42;	author grendel;	state Exp;
branches;
next	1.16;

1.16
date	2000.12.29.16.01.01;	author grendel;	state Exp;
branches;
next	1.15;

1.15
date	2000.12.08.16.05.20;	author grendel;	state Exp;
branches
	1.15.2.1;
next	1.14;

1.14
date	2000.11.27.16.05.59;	author grendel;	state Exp;
branches;
next	1.13;

1.13
date	2000.11.03.19.36.12;	author grendel;	state Exp;
branches;
next	1.12;

1.12
date	2000.10.09.10.29.59;	author grendel;	state Exp;
branches;
next	1.11;

1.11
date	2000.10.09.09.52.28;	author grendel;	state Exp;
branches;
next	1.10;

1.10
date	2000.10.07.19.24.09;	author grendel;	state Exp;
branches;
next	1.9;

1.9
date	2000.09.25.14.20.57;	author grendel;	state Exp;
branches;
next	1.8;

1.8
date	2000.09.17.16.00.02;	author grendel;	state Exp;
branches;
next	1.7;

1.7
date	2000.08.26.11.21.22;	author grendel;	state Exp;
branches;
next	1.6;

1.6
date	2000.08.26.09.44.47;	author grendel;	state Exp;
branches;
next	1.5;

1.5
date	2000.08.23.14.55.00;	author grendel;	state Exp;
branches;
next	1.4;

1.4
date	2000.08.22.09.46.55;	author grendel;	state Exp;
branches;
next	1.3;

1.3
date	2000.08.21.17.30.02;	author grendel;	state Exp;
branches;
next	1.2;

1.2
date	2000.08.21.17.22.03;	author grendel;	state Exp;
branches;
next	1.1;

1.1
date	2000.08.16.19.30.47;	author grendel;	state Exp;
branches;
next	;

1.15.2.1
date	2000.12.29.15.56.16;	author grendel;	state Exp;
branches;
next	1.15.2.2;

1.15.2.2
date	2001.01.31.18.47.03;	author grendel;	state Exp;
branches;
next	1.15.2.3;

1.15.2.3
date	2001.06.07.14.06.35;	author grendel;	state Exp;
branches;
next	1.15.2.4;

1.15.2.4
date	2001.06.08.09.28.32;	author grendel;	state Exp;
branches;
next	1.15.2.5;

1.15.2.5
date	2002.02.11.15.16.57;	author grendel;	state Exp;
branches;
next	;

1.29.2.1
date	2002.01.30.13.03.01;	author grendel;	state Exp;
branches;
next	1.29.2.2;

1.29.2.2
date	2002.04.17.18.30.19;	author grendel;	state Exp;
branches;
next	1.29.2.3;

1.29.2.3
date	2002.04.25.15.51.18;	author grendel;	state Exp;
branches;
next	1.29.2.4;

1.29.2.4
date	2002.06.29.16.30.02;	author grendel;	state Exp;
branches;
next	1.29.2.5;

1.29.2.5
date	2002.07.08.17.32.22;	author grendel;	state Exp;
branches;
next	1.29.2.6;

1.29.2.6
date	2002.12.13.14.36.20;	author grendel;	state Exp;
branches;
next	1.29.2.7;

1.29.2.7
date	2002.12.17.23.12.47;	author grendel;	state Exp;
branches;
next	1.29.2.8;

1.29.2.8
date	2003.02.27.18.53.32;	author grendel;	state Exp;
branches;
next	1.29.2.9;

1.29.2.9
date	2003.11.20.17.49.39;	author grendel;	state Exp;
branches;
next	1.29.2.10;

1.29.2.10
date	2005.04.03.22.45.18;	author grendel;	state Exp;
branches;
next	1.29.2.11;

1.29.2.11
date	2005.04.03.23.45.17;	author grendel;	state Exp;
branches;
next	;

1.38.2.1
date	2005.04.21.23.32.37;	author grendel;	state Exp;
branches;
next	1.38.2.2;

1.38.2.2
date	2005.04.22.01.12.02;	author grendel;	state Exp;
branches;
next	1.38.2.3;

1.38.2.3
date	2005.06.14.00.22.25;	author grendel;	state Exp;
branches;
next	1.38.2.4;

1.38.2.4
date	2005.10.05.07.04.33;	author grendel;	state Exp;
branches;
next	1.38.2.5;

1.38.2.5
date	2005.10.30.01.35.47;	author grendel;	state Exp;
branches;
next	1.38.2.6;

1.38.2.6
date	2006.10.16.06.51.53;	author grendel;	state Exp;
branches;
next	1.38.2.7;

1.38.2.7
date	2006.10.16.10.06.54;	author grendel;	state Exp;
branches;
next	;


desc
@@


1.40
log
@debian mods
@
text
@#! /bin/sh
# postinst script for caudium
# 
# $Id: postinst,v 1.38.2.5 2005/10/30 01:35:47 grendel Exp $
#
# see: dh_installdeb(1)
EXTVER=

set -e
#set -x

. /usr/share/debconf/confmodule

db_version 2.0
db_capb

# 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'.
CAUDIUM_PIKE=/usr/lib/caudium${EXTVER}/base_server/caudium.pike
PIKE=/usr/lib/caudium${EXTVER}/bin/caudium

case "$1" in
    configure)

      db_get caudium${EXTVER}/config_port
      CFGPORTNO="$RET"
      if [ -n "$RET" -a "$RET" != "22202" ]; then
	  CONFIG_PORT="$RET"
	  sed -e "s/\(ConfigPorts.*\)\(22202\)\(.*\)/\1$RET\3/" $CAUDIUM_PIKE > $CAUDIUM_PIKE.new && \
	  mv $CAUDIUM_PIKE.new $CAUDIUM_PIKE
      fi
      
      db_get caudium${EXTVER}/listen_on
      PORTNO="$RET"

      if [ ! -f /etc/caudium${EXTVER}/servers/Global_Variables ]; then    
       touch /var/state/caudium${EXTVER}/virgin.install
       db_get caudium${EXTVER}/config_login
       CONFIGADMIN="$RET"

       db_get caudium${EXTVER}/config_password
       
       CONFIGPASS="`echo $RET | $PIKE -e 'string p; p=Stdio.stdin->gets(); write(crypt(p));'`"

       cat <<EOF | sed -f - /etc/caudium${EXTVER}/Global_Variables.sample > \
         /etc/caudium${EXTVER}/servers/Global_Variables.new && mv /etc/caudium${EXTVER}/servers/Global_Variables.new \
         /etc/caudium${EXTVER}/servers/Global_Variables
s@@CFGPORT@@$CFGPORTNOg
s@@CONFIGADMIN@@$CONFIGADMINg
s@@CONFIGPASS@@$CONFIGPASSg
EOF
#     sed -e "s;@@CFGPORT@@;$CFGPORTNO;" /etc/caudium${EXTVER}/Global_Variables.sample > \
#         /etc/caudium${EXTVER}/servers/Global_Variables.new && mv /etc/caudium${EXTVER}/servers/Global_Variables.new \
#         /etc/caudium${EXTVER}/servers/Global_Variables

       sed -e "s;@@PORTNUM@@;$PORTNO;" /etc/caudium${EXTVER}/localhost.sample > \
	   /etc/caudium${EXTVER}/servers/localhost.new && mv /etc/caudium${EXTVER}/servers/localhost.new \
	   /etc/caudium${EXTVER}/servers/localhost
      elif [ -f /var/state/caudium${EXTVER}/virgin.install ]; then
       rm /var/state/caudium${EXTVER}/virgin.install
      fi
      
      if head -1 /etc/caudium${EXTVER}/servers/Global_Variables|grep "^6.*Do not remove" > /dev/null 2>&1; then
	# Old caudium format, make sure to DISABLE the watchdog
	sed -r -e "s#(<region name='Variables'>)#\1<var name='watchdog_enable'><int>0</int></var>#" < \
	  /etc/caudium${EXTVER}/servers/Global_Variables > \
	  /etc/caudium${EXTVER}/servers/Global_Variables.new
	  
	  if [ -f /etc/caudium${EXTVER}/servers/Global_Variables.new ]; then
	    if [ $(eval ls -s /etc/caudium${EXTVER}/servers/Global_Variables.new | cut -d ' ' -f 1) -gt 0 ]; then
	      mv /etc/caudium${EXTVER}/servers/Global_Variables.new \
		 /etc/caudium${EXTVER}/servers/Global_Variables
	      chown www-data:www-data /etc/caudium${EXTVER}/servers/Global_Variables
	      chmod 660 /etc/caudium${EXTVER}/servers/Global_Variables
	    fi
	  fi
      fi
      db_get caudium${EXTVER}/start_options
      START_OPTIONS=

      for o in `echo $RET | sed -e 's/,//g'`; do
	  case $o in
	      threads) START_OPTIONS="$START_OPTIONS --with-threads" ;;
	      debug) START_OPTIONS="$START_OPTIONS --with-debug" ;;
	      once) START_OPTIONS="$START_OPTIONS --once" ;;
	      profile) START_OPTIONS="$START_OPTIONS --with-profile" ;;
	      fd-debug) START_OPTIONS="$START_OPTIONS --with-fd-debug" ;;
	      keep-alive) START_OPTIONS="$START_OPTIONS --with-keep-alive" ;;
	  esac
      done
      db_get caudium${EXTVER}/performance
      if [ "$RET" = "true" ]; then
	  START_OPTIONS="$START_OPTIONS -DMAX_PERFORMANCE"
      fi

      if [ ! -f /etc/default/caudium${EXTVER} ]; then
	  cat <<EOF > /etc/default/caudium${EXTVER}
#
# This variable will be joined with the default
# Caudium startup options in the init script
#
# This file has been generated automatically the first
# time Caudium was installed on this machine. You can
# modify the START_OPTIONS variable below at your will
# as this file won't ever be modified by the Caudium
# package.
#
# For available options type
# /usr/lib/caudium${EXTVER}/start --help
#
START_OPTIONS="$START_OPTIONS"

#
# Stuff for caudiumctl(1)
#
caudiumhome=/usr/lib/caudium${EXTVER}
pidfile=/var/run/caudium${EXTVER}/caudium.pid
killallwww=no
wwwuser=www-data
flags="$START_OPTIONS"
EOF
    fi

##
## HTTP2 is the default now
##

#    db_get caudium/experimental_http
#    if test "$RET" = "true"; then
#	PROTOCOL=http2
#    else
#	PROTOCOL=http
#    fi
#    
#    if [ -f /etc/caudium/servers/localhost ]; then
#	sed -e "s;@@PROTOCOL@@;$PROTOCOL;" /etc/caudium/servers/localhost > \
#         /etc/caudium/servers/localhost.new && mv /etc/caudium/servers/localhost.new \
# 	 /etc/caudium/servers/localhost
#    fi

    
# -----------------------
      if [ ! -f /var/www/index.html ]; then
	  ln -sf ../../usr/share/doc/caudium/www/index.html /var/www/index.html
      fi
      db_stop

      # Now let's take care of permissions
      # if it is the first time we run Caudium
      #if [ -f /var/state/caudium${EXTVER}/virgin.install ]; then    
      #	DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /etc/caudium/servers${EXTVER} /var/log/caudium${EXTVER}"
      #	for d in $DIRS; do
      #	    if test -d $d; then
      #		chown -R www-data.www-data $d
      #	    fi
      #	done
      rm -f /var/state/caudium${EXTVER}/virgin.install
      #fi

      DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /var/cache/caudium${EXTVER}/args /var/cache/caudium${EXTVER}/cache /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
      for d in $DIRS; do
	  dpkg-statoverride --remove $d > /dev/null 2>&1 || true
	  dpkg-statoverride --update --add www-data www-data 0751 $d
      done
      
      if [ -d /usr/lib/caudium/caudium-images -a ! -L /usr/lib/caudium/caudium-images ]; then
	  rm -r /usr/lib/caudium/caudium-images
      fi
      ln -sf ../../share/caudium/caudium-images /usr/lib/caudium/caudium-images
      
      if [ ! -d /usr/local/share/caudium/modules/ ]; then
	  install -d -m 755 -o root -g root /usr/local/share/caudium/modules/
      fi
      
      # Link in the bitstream fonts
      if [ -d /usr/share/fonts/truetype/ttf-bitstream-vera ]; then
	for f in /usr/share/fonts/truetype/ttf-bitstream-vera/*.ttf; do
	  ln -sf $f /usr/lib/caudium/fonts/ttf/${f##*/}
	done
      fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
	db_stop
	exit 0
    ;;

    *)
        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.

#DEBHELPER#

exit 0


@


1.39
log
@cosmetic changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.38.2.2 2005/04/22 01:12:02 grendel Exp $
d87 1
a87 1
	      chown www-data.www-data /etc/caudium${EXTVER}/servers/Global_Variables
d174 1
a174 1
      DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /var/cache/caudium${EXTVER}/args /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
@


1.38
log
@and a few more changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.37 2002/12/18 00:18:28 grendel Exp $
d10 1
d39 19
a57 15
    update-alternatives --install /usr/bin/htpasswd  htpasswd \
				  /usr/bin/htpasswd-caudium 10 \
			--slave /usr/share/man/man1/htpasswd.1.gz \
			        htpasswd.1.gz /usr/share/man/man1/htpasswd-caudium.1.gz

    db_get caudium${EXTVER}/config_port
    CFGPORTNO="$RET"
    if [ -n "$RET" -a "$RET" != "22202" ]; then
        CONFIG_PORT="$RET"
	sed -e "s/\(ConfigPorts.*\)\(22202\)\(.*\)/\1$RET\3/" $CAUDIUM_PIKE > $CAUDIUM_PIKE.new && \
	mv $CAUDIUM_PIKE.new $CAUDIUM_PIKE
    fi
    
    db_get caudium${EXTVER}/listen_on
    PORTNO="$RET"
d59 1
a59 9
    if [ ! -f /etc/caudium${EXTVER}/servers/Global_Variables ]; then    
     touch /var/state/caudium${EXTVER}/virgin.install
     db_get caudium${EXTVER}/config_login
     CONFIGADMIN="$RET"

     db_get caudium${EXTVER}/config_password
     CONFIGPASS="`echo $RET | $PIKE -e 'string p; p=Stdio.stdin->gets(); write(crypt(p));'`"
     
     cat <<EOF | sed -f - /etc/caudium${EXTVER}/Global_Variables.sample > \
d70 39
a108 30
     sed -e "s;@@PORTNUM@@;$PORTNO;" /etc/caudium${EXTVER}/localhost.sample > \
         /etc/caudium${EXTVER}/servers/localhost.new && mv /etc/caudium${EXTVER}/servers/localhost.new \
         /etc/caudium${EXTVER}/servers/localhost
    elif [ -f /var/state/caudium${EXTVER}/virgin.install ]; then
     rm /var/state/caudium${EXTVER}/virgin.install
    fi
    
    db_get caudium${EXTVER}/start_options
    START_OPTIONS=
    NOTHREADS=y
    
    for o in `echo $RET | sed -e 's/,//g'`; do
	case $o in
	    threads) START_OPTIONS="$START_OPTIONS --with-threads" 
	             NOTHREADS=n ;;
	    debug) START_OPTIONS="$START_OPTIONS --with-debug" ;;
	    once) START_OPTIONS="$START_OPTIONS --once" ;;
	    profile) START_OPTIONS="$START_OPTIONS --with-profile" ;;
	    fd-debug) START_OPTIONS="$START_OPTIONS --with-fd-debug" ;;
	    keep-alive) START_OPTIONS="$START_OPTIONS --with-keep-alive" ;;
	esac
    done
    if [ "x$NOTHREADS" = "xy" ]; then
       START_OPTIONS="$START_OPTIONS --without-threads"
    fi
    
    db_get caudium${EXTVER}/performance
    if [ "$RET" = "true" ]; then
        START_OPTIONS="$START_OPTIONS -DMAX_PERFORMANCE"
    fi
d110 2
a111 2
    if [ ! -f /etc/default/caudium${EXTVER} ]; then
	cat <<EOF > /etc/default/caudium${EXTVER}
d157 38
a194 30
if [ ! -f /var/www/index.html ]; then
    ln -sf ../../usr/share/doc/caudium/www/index.html /var/www/index.html
fi
    db_stop

    # Now let's take care of permissions
    # if it is the first time we run Caudium
    #if [ -f /var/state/caudium${EXTVER}/virgin.install ]; then    
    #	DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /etc/caudium/servers${EXTVER} /var/log/caudium${EXTVER}"
    #	for d in $DIRS; do
    #	    if test -d $d; then
    #		chown -R www-data.www-data $d
    #	    fi
    #	done
    rm -f /var/state/caudium${EXTVER}/virgin.install
    #fi

    DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /var/cache/caudium${EXTVER}/args /var/cache/caudium${EXTVER}/cache /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
    for d in $DIRS; do
	dpkg-statoverride --remove $d > /dev/null 2>&1 || true
	dpkg-statoverride --update --add www-data www-data 0751 $d
    done

    if [ -d /usr/lib/caudium/caudium-images -a ! -L /usr/lib/caudium/caudium-images ]; then
	rm -r /usr/lib/caudium/caudium-images
    fi
    ln -sf ../../share/caudium/caudium-images /usr/lib/caudium/caudium-images
    if [ ! -d /usr/local/share/caudium/modules/ ]; then
	install -d -m 755 -o root -g root /usr/local/share/caudium/modules/
    fi
d203 1
a203 1
        echo "postinst called with unknown argument \`$1'" >&2
@


1.38.2.1
log
@debian stuff
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.11 2005/04/03 23:45:17 grendel Exp $
d38 5
d60 1
a61 2
     CONFIGPASS="`echo $RET | $PIKE -e 'string p; p=Stdio.stdin->gets(); write(crypt(p));'`"

d82 2
a83 1

d86 2
a87 1
	    threads) START_OPTIONS="$START_OPTIONS --with-threads" ;;
d95 4
d151 3
a153 3
    if [ ! -f /var/www/index.html ]; then
	ln -sf ../../usr/share/doc/caudium/www/index.html /var/www/index.html
    fi
d168 1
a168 1
    DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /var/cache/caudium${EXTVER}/args /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
d173 1
a173 1
    
a177 1
    
a180 7
    
    # Link in the bitstream fonts
    if [ -d /usr/share/fonts/truetype/ttf-bitstream-vera ]; then
      for f in /usr/share/fonts/truetype/ttf-bitstream-vera/*.ttf; do
        ln -sf $f /usr/lib/caudium/fonts/ttf/${f##*/}
      done
    fi
@


1.38.2.2
log
@some more stuff
@
text
@d4 1
a4 1
# $Id: postinst,v 1.38.2.1 2005/04/21 23:32:37 grendel Exp $
a75 15
    if head -1 /etc/caudium${EXTVER}/servers/Global_Variables|grep "^6.*Do not remove" > /dev/null 2>&1; then
      # Old caudium format, make sure to DISABLE the watchdog
      sed -r -e "s#(<region name='Variables'>)#\1<var name='watchdog_enable'><int>0</int></var>#" < \
        /etc/caudium${EXTVER}/servers/Global_Variables > \
	/etc/caudium${EXTVER}/servers/Global_Variables.new
	
	if [ -f /etc/caudium${EXTVER}/servers/Global_Variables.new ]; then
	  if `ls -s /etc/caudium${EXTVER}/servers/Global_Variables.new | cut -d ' ' -f 1` -gt 0 ]; then
	    mv /etc/caudium${EXTVER}/servers/Global_Variables.new \
	       /etc/caudium${EXTVER}/servers/Global_Variables
	    chown www-data.www-data /etc/caudium${EXTVER}/servers/Global_Variables
	    chmod 660 /etc/caudium${EXTVER}/servers/Global_Variables
	  fi
	fi
    fi
@


1.38.2.3
log
@Czech translation added
@
text
@d4 1
a4 1
# $Id: postinst,v 1.38.2.2 2005/04/22 01:12:02 grendel Exp $
a9 1
#set -x
d38 19
a56 19
      db_get caudium${EXTVER}/config_port
      CFGPORTNO="$RET"
      if [ -n "$RET" -a "$RET" != "22202" ]; then
	  CONFIG_PORT="$RET"
	  sed -e "s/\(ConfigPorts.*\)\(22202\)\(.*\)/\1$RET\3/" $CAUDIUM_PIKE > $CAUDIUM_PIKE.new && \
	  mv $CAUDIUM_PIKE.new $CAUDIUM_PIKE
      fi
      
      db_get caudium${EXTVER}/listen_on
      PORTNO="$RET"

      if [ ! -f /etc/caudium${EXTVER}/servers/Global_Variables ]; then    
       touch /var/state/caudium${EXTVER}/virgin.install
       db_get caudium${EXTVER}/config_login
       CONFIGADMIN="$RET"

       db_get caudium${EXTVER}/config_password
       
       CONFIGPASS="`echo $RET | $PIKE -e 'string p; p=Stdio.stdin->gets(); write(crypt(p));'`"
d58 1
a58 1
       cat <<EOF | sed -f - /etc/caudium${EXTVER}/Global_Variables.sample > \
d69 19
a87 20
       sed -e "s;@@PORTNUM@@;$PORTNO;" /etc/caudium${EXTVER}/localhost.sample > \
	   /etc/caudium${EXTVER}/servers/localhost.new && mv /etc/caudium${EXTVER}/servers/localhost.new \
	   /etc/caudium${EXTVER}/servers/localhost
      elif [ -f /var/state/caudium${EXTVER}/virgin.install ]; then
       rm /var/state/caudium${EXTVER}/virgin.install
      fi
      
      if head -1 /etc/caudium${EXTVER}/servers/Global_Variables|grep "^6.*Do not remove" > /dev/null 2>&1; then
	# Old caudium format, make sure to DISABLE the watchdog
	sed -r -e "s#(<region name='Variables'>)#\1<var name='watchdog_enable'><int>0</int></var>#" < \
	  /etc/caudium${EXTVER}/servers/Global_Variables > \
	  /etc/caudium${EXTVER}/servers/Global_Variables.new
	  
	  if [ -f /etc/caudium${EXTVER}/servers/Global_Variables.new ]; then
	    if [ $(eval ls -s /etc/caudium${EXTVER}/servers/Global_Variables.new | cut -d ' ' -f 1) -gt 0 ]; then
	      mv /etc/caudium${EXTVER}/servers/Global_Variables.new \
		 /etc/caudium${EXTVER}/servers/Global_Variables
	      chown www-data.www-data /etc/caudium${EXTVER}/servers/Global_Variables
	      chmod 660 /etc/caudium${EXTVER}/servers/Global_Variables
	    fi
d89 19
a107 18
      fi
      db_get caudium${EXTVER}/start_options
      START_OPTIONS=

      for o in `echo $RET | sed -e 's/,//g'`; do
	  case $o in
	      threads) START_OPTIONS="$START_OPTIONS --with-threads" ;;
	      debug) START_OPTIONS="$START_OPTIONS --with-debug" ;;
	      once) START_OPTIONS="$START_OPTIONS --once" ;;
	      profile) START_OPTIONS="$START_OPTIONS --with-profile" ;;
	      fd-debug) START_OPTIONS="$START_OPTIONS --with-fd-debug" ;;
	      keep-alive) START_OPTIONS="$START_OPTIONS --with-keep-alive" ;;
	  esac
      done
      db_get caudium${EXTVER}/performance
      if [ "$RET" = "true" ]; then
	  START_OPTIONS="$START_OPTIONS -DMAX_PERFORMANCE"
      fi
d109 2
a110 2
      if [ ! -f /etc/default/caudium${EXTVER} ]; then
	  cat <<EOF > /etc/default/caudium${EXTVER}
d156 36
a191 21
      if [ ! -f /var/www/index.html ]; then
	  ln -sf ../../usr/share/doc/caudium/www/index.html /var/www/index.html
      fi
      db_stop

      # Now let's take care of permissions
      # if it is the first time we run Caudium
      #if [ -f /var/state/caudium${EXTVER}/virgin.install ]; then    
      #	DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /etc/caudium/servers${EXTVER} /var/log/caudium${EXTVER}"
      #	for d in $DIRS; do
      #	    if test -d $d; then
      #		chown -R www-data.www-data $d
      #	    fi
      #	done
      rm -f /var/state/caudium${EXTVER}/virgin.install
      #fi

      DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /var/cache/caudium${EXTVER}/args /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
      for d in $DIRS; do
	  dpkg-statoverride --remove $d > /dev/null 2>&1 || true
	  dpkg-statoverride --update --add www-data www-data 0751 $d
d193 1
a193 16
      
      if [ -d /usr/lib/caudium/caudium-images -a ! -L /usr/lib/caudium/caudium-images ]; then
	  rm -r /usr/lib/caudium/caudium-images
      fi
      ln -sf ../../share/caudium/caudium-images /usr/lib/caudium/caudium-images
      
      if [ ! -d /usr/local/share/caudium/modules/ ]; then
	  install -d -m 755 -o root -g root /usr/local/share/caudium/modules/
      fi
      
      # Link in the bitstream fonts
      if [ -d /usr/share/fonts/truetype/ttf-bitstream-vera ]; then
	for f in /usr/share/fonts/truetype/ttf-bitstream-vera/*.ttf; do
	  ln -sf $f /usr/lib/caudium/fonts/ttf/${f##*/}
	done
      fi
d202 1
a202 1
        echo "postinst called with unknown argument : '$1'" >&2
@


1.38.2.4
log
@and some more debian
@
text
@d4 1
a4 1
# $Id: postinst,v 1.38.2.3 2005/06/14 00:22:25 grendel Exp $
d87 1
a87 1
	      chown www-data:www-data /etc/caudium${EXTVER}/servers/Global_Variables
@


1.38.2.5
log
@debian changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.38.2.4 2005/10/05 07:04:33 grendel Exp $
d174 1
a174 1
      DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /var/cache/caudium${EXTVER}/args /var/cache/caudium${EXTVER}/cache /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
@


1.38.2.6
log
@Debian NMU
@
text
@d4 1
a4 1
# $Id: postinst,v 1.38.2.5 2005/10/30 01:35:47 grendel Exp $
d186 1
a186 1
	  install -d -m 755 -o root -g root /usr/local/share/caudium/modules/ 2>/dev/null || true
@


1.38.2.7
log
@Preparing for Debian release
@
text
@d4 1
a4 1
# $Id: postinst,v 1.38.2.6 2006/10/16 06:51:53 grendel Exp $
d137 18
@


1.37
log
@same as for 1.2
@
text
@d4 1
a4 1
# $Id: postinst,v 1.36 2002/07/16 18:40:57 grendel Exp $
d178 3
@


1.36
log
@more
@
text
@d4 1
a4 1
# $Id: postinst,v 1.35 2002/07/16 18:18:14 grendel Exp $
d77 1
a77 1
     rm -f /var/state/caudium${EXTVER}/virgin.install
d173 5
@


1.35
log
@more deb
@
text
@d4 1
a4 1
# $Id: postinst,v 1.34 2002/07/16 18:00:19 grendel Exp $
d82 2
a83 1

d86 2
a87 1
	    threads) START_OPTIONS="$START_OPTIONS --with-threads" ;;
d95 4
@


1.34
log
@a few debian changes and in addition a change that makes Caudium run
correctly with the current Pike 7.3.49 - the latest pike changed the way it
handles the main() function from the master program. It now enforces a
strict synopsis on the function, otherwise things might go wrong. I have
chosen the simpler (new) synopsis that breaks backwards Pike compatibility.
That makes Caudium 1.3 a Pike 7.3+ program. It can be changed to use the
other, older, synopsis, of course, but I'd vote we don't do that.
@
text
@d4 1
a4 1
# $Id: postinst,v 1.33 2002/07/08 17:28:12 grendel Exp $
d162 1
a162 1
    DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /var/cache/caudium${EXTVER}/args /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
@


1.33
log
@fix
@
text
@d4 1
a4 1
# $Id: postinst,v 1.32 2002/06/29 16:20:13 grendel Exp $
d60 2
a61 2
     CONFIGPASS="`echo $RET | $PIKE -e 'string p; p=Stdio.stdin->gets(); write(replace(crypt(p), "/", "\/"));'`"

d65 3
a67 3
s/@@CFGPORT@@/$CFGPORTNO/g
s/@@CONFIGADMIN@@/$CONFIGADMIN/g
s/@@CONFIGPASS@@/$CONFIGPASS/g
@


1.32
log
@moved the images elsewhere, they are installed with the package now, build
process is easier
@
text
@d4 1
a4 1
# $Id: postinst,v 1.31 2002/04/25 15:45:06 grendel Exp $
d33 1
a33 1
PIKE=/usr/lib/caudium${EXTVER}/bin/pike
@


1.31
log
@debian stuff (not tested yet)
@
text
@d4 1
a4 1
# $Id: postinst,v 1.30 2002/04/17 18:23:48 grendel Exp $
a146 4
    cd /var/www/images/
    for f in ../../../usr/share/doc/caudium/www/*.png; do
        ln -sf $f /var/www/images/
    done
@


1.30
log
@new Debian default Caudium page
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29 2002/01/09 15:25:32 grendel Exp $
d93 5
@


1.29
log
@many debian changes - please update the translations when you have some
time, thanks
@
text
@d4 1
a4 1
# $Id: postinst,v 1.28 2002/01/08 11:46:25 grendel Exp $
d141 5
a145 43
    cat<<EOT > /var/www/index.html
<html>
<head><title>Welcome to Your New Home Page!</title></head>

<body>
<h1>Welcome to Your New Home Page!</h1>

<!-- Most of the text is stolen from the Apache package (and then from the Roxen package :) -->

  <p>This is the default web page installed by the Debian package of the Caudium Webserver.
  It is the responsibility of the administrator of the machine to replace it with
  a local page.

  <p><strong>If you encounter this page when you were expecting some other content, you
  should report it to the administrator of the machine.</strong> Please note that
  this machine is not affiliated with Debian. Debian is software installed on the
  machine. Do not report problems with this site to Debian.

  <p>Debian is a free operating system for your computer.
  See our <a href="http://www.debian.org/"> web page</a> for more information.
  Information about the Caudium Webserver can be found on
  <a href="http://caudium.net/">their home page</a>.
<!--  For information and downloading The Debian package of Roxen please take a look at the
  <a href="http://www.debian.org/Packages/stable/web/roxen.html">Roxen package page</a>. -->

Unless you changed its configuration, the server is configured as follows:<p>

<ul>
<li> Configuration files can be found in /etc/caudium and /etc/caudium/servers .
<li> The DocumentRoot, which is the directory under which all your HTML files should exist, is set to /var/www.
<li> CGI scripts are looked for in /usr/lib/cgi-bin, which is where Debian packages will place their scripts.
<li> Log files are placed in /var/log/caudium, and will be rotated monthly.
<li> The default directory index is index.html, meaning that requests for a directory /foo/bar/ will give the contents of
       the file /var/www/foo/bar/index.html if it exists (assuming that /var/www is your DocumentRoot).
<li> User directories are enabled, and user documents will be looked for in the public_html directory of the user homes.
</ul>
<hr width="75%">
<center>
<pr size="medium" color="blue">
</center>
</body>
</html>
EOT
@


1.29.2.1
log
@modified the debian stuff a bit:

  - smooth upgrade from caudium 1.0 (symlinks were stray)
  - postinstall uses /usr/lib/caudium/bin/caudium now instead of pike
  - minor debian/control cleanups
  - fixed the sed run for modifying the scripts in bin/ and friends
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29 2002/01/09 15:25:32 grendel Exp $
d33 1
a33 1
PIKE=/usr/lib/caudium${EXTVER}/bin/caudium
@


1.29.2.2
log
@same as for 1.3
@
text
@d4 1
a4 1
# $Id: postinst,v 1.30 2002/04/17 18:23:48 grendel Exp $
d33 1
a33 1
PIKE=/usr/lib/caudium${EXTVER}/bin/pike
d141 43
a183 5
    ln -sf ../../usr/share/doc/caudium/www/index.html /var/www/index.html
    cd /var/www/images/
    for f in ../../../usr/share/doc/caudium/www/*.png; do
        ln -sf $f /var/www/images/
    done
@


1.29.2.3
log
@same as for 1.3
@
text
@d4 1
a4 1
# $Id: postinst,v 1.31 2002/04/25 15:45:06 grendel Exp $
a92 5
    db_get caudium${EXTVER}/performance
    if [ "$RET" = "true" ]; then
        START_OPTIONS="$START_OPTIONS -DMAX_PERFORMANCE"
    fi

@


1.29.2.4
log
@same changes as for 1.3
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.3 2002/04/25 15:51:18 grendel Exp $
d147 4
@


1.29.2.5
log
@fixes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.4 2002/06/29 16:30:02 grendel Exp $
d33 1
a33 1
PIKE=/usr/lib/caudium${EXTVER}/bin/caudium
@


1.29.2.6
log
@debian fixes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.5 2002/07/08 17:32:22 grendel Exp $
d37 5
@


1.29.2.7
log
@some minor modifications
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.6 2002/12/13 14:36:20 grendel Exp $
d72 1
a72 1
     rm /var/state/caudium${EXTVER}/virgin.install
d140 3
a142 3
    if [ ! -f /var/www/index.html ]; then
	ln -sf ../../usr/share/doc/caudium/www/index.html /var/www/index.html
    fi
a161 5
    
    if [ -d /usr/lib/caudium/caudium-images -a ! -L /usr/lib/caudium/caudium-images ]; then
	rm -r /usr/lib/caudium/caudium-images
    fi
    ln -sf ../../share/caudium/caudium-images /usr/lib/caudium/caudium-images
@


1.29.2.8
log
@lintian frowns on the directory being in deb
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.7 2002/12/17 23:12:47 grendel Exp $
a166 4
    
    if [ ! -d /usr/local/share/caudium/modules/ ]; then
	install -d -m 755 -o root -g root /usr/local/share/caudium/modules/
    fi
@


1.29.2.9
log
@some changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.8 2003/02/27 18:53:32 grendel Exp $
d55 1
a55 2
     
     CONFIGPASS="`echo $RET | $PIKE -e 'string p; p=Stdio.stdin->gets(); write(crypt(p));'`"
d60 3
a62 3
s@@CFGPORT@@$CFGPORTNOg
s@@CONFIGADMIN@@$CONFIGADMINg
s@@CONFIGPASS@@$CONFIGPASSg
@


1.29.2.10
log
@Fixing a Debian RC bug
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.9 2003/11/20 17:49:39 grendel Exp $
a171 7
    
    # Link in the bitstream fonts
    if [ -d /usr/share/fonts/truetype/ttf-bitstream-vera ]; then
      for f /usr/share/fonts/truetype/ttf-bitstream-vera/*.ttf; do
        ln -sf $f /usr/lib/caudium/fonts/ttf/${f##*/}
      done
    fi
@


1.29.2.11
log
@some more changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.29.2.10 2005/04/03 22:45:18 grendel Exp $
d175 1
a175 1
      for f in /usr/share/fonts/truetype/ttf-bitstream-vera/*.ttf; do
@


1.28
log
@more changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.27 2002/01/03 17:05:36 grendel Exp $
d33 1
d45 1
a45 1
    if [ -n "$RET" -a "$RET" != "22203" ]; then
d56 7
a62 1
     sed -e "s;@@CFGPORT@@;$CFGPORTNO;" /etc/caudium${EXTVER}/Global_Variables.sample > \
d64 8
a71 1
	 /etc/caudium${EXTVER}/servers/Global_Variables
d75 1
a75 1
  	 /etc/caudium${EXTVER}/servers/localhost
@


1.27
log
@preparation for the official release
@
text
@d4 1
a4 1
# $Id: postinst,v 1.26 2001/07/17 15:50:47 grendel Exp $
d95 9
@


1.26
log
@fixes for debian
@
text
@d4 1
a4 1
# $Id: postinst,v 1.25 2001/06/08 09:28:53 grendel Exp $
d7 1
a7 1
EXTVER=-1.1
@


1.25
log
@definitely an idiot
@
text
@d4 1
a4 1
# $Id: postinst,v 1.24 2001/06/07 13:43:06 grendel Exp $
d176 1
a176 1
    DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /etc/caudium${EXTVER}/servers /var/log/caudium${EXTVER}"
@


1.24
log
@this will work for Debian/{Sid,Woody} only (or if you install dpkg
1.9.x)
@
text
@d4 1
a4 1
# $Id: postinst,v 1.23 2001/06/05 14:26:57 grendel Exp $
d179 1
a179 1
	dpkg-statoverride --update --add www-data www-data 0664 $d
@


1.23
log
@New Debian packaging scheme - new package name, new directories, new
config. Also modified some of Makefiles - the install_alt target (used
and meant for package maintainers) now uses one extra variable to put
caudium in "versioned" directories. This is done to enable developers
using Debian machines to run both stable and unstable Caudium
installed from debs (rpms etc.). The changes don't affect anything
else but the Debian config and the install_alt target.
@
text
@d4 1
a4 1
# $Id: postinst,v 1.22 2001/05/28 12:26:40 grendel Exp $
d166 15
a180 9
    if [ -f /var/state/caudium${EXTVER}/virgin.install ]; then    
	DIRS="/var/run/caudium${EXTVER} /var/state/caudium${EXTVER} /var/cache/caudium${EXTVER} /etc/caudium/servers${EXTVER} /var/log/caudium${EXTVER}"
	for d in $DIRS; do
	    if test -d $d; then
		chown -R www-data.www-data $d
	    fi
	done
	rm -f /var/state/caudium${EXTVER}/virgin.install
    fi
@


1.22
log
@debian changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.21 2001/02/08 20:11:52 underley Exp $
d7 1
d32 1
a32 1
CAUDIUM_PIKE=/usr/lib/caudium/base_server/caudium.pike
d42 1
a42 1
    db_get caudium/config_port
d44 1
a44 1
    if [ -n "$RET" -a "$RET" != "22202" ]; then
d50 1
a50 1
    db_get caudium/listen_on
d53 11
a63 11
    if [ ! -f /etc/caudium/servers/Global_Variables ]; then    
     touch /var/state/caudium/virgin.install
     sed -e "s;@@CFGPORT@@;$CFGPORTNO;" /etc/caudium/Global_Variables.sample > \
         /etc/caudium/servers/Global_Variables.new && mv /etc/caudium/servers/Global_Variables.new \
	 /etc/caudium/servers/Global_Variables

     sed -e "s;@@PORTNUM@@;$PORTNO;" /etc/caudium/localhost.sample > \
         /etc/caudium/servers/localhost.new && mv /etc/caudium/servers/localhost.new \
  	 /etc/caudium/servers/localhost
    elif [ -f /var/state/caudium/virgin.install ]; then
     rm -f /var/state/caudium/virgin.install
d66 1
a66 1
    db_get caudium/start_options
d79 2
a80 2
    if [ ! -f /etc/default/caudium ]; then
	cat <<EOF > /etc/default/caudium
d92 1
a92 1
# /usr/lib/caudium/start --help
d166 2
a167 2
    if [ -f /var/state/caudium/virgin.install ]; then    
	DIRS="/var/run/caudium /var/state/caudium /var/cache/caudium /etc/caudium/servers /var/log/caudium"
d173 1
a173 1
	rm -f /var/state/caudium/virgin.install
@


1.21
log
@
fixed typo in postinstall script
@
text
@d4 1
a4 1
# $Id: postinst,v 1.20 2001/01/31 18:43:11 grendel Exp $
d42 1
d48 1
a48 1

d53 5
d61 2
d97 16
a112 12
    db_get caudium/experimental_http
    if test "$RET" = "true"; then
	PROTOCOL=http2
    else
	PROTOCOL=http
    fi
    
    if [ -f /etc/caudium/servers/localhost ]; then
	sed -e "s;@@PROTOCOL@@;$PROTOCOL;" /etc/caudium/servers/localhost > \
         /etc/caudium/servers/localhost.new && mv /etc/caudium/servers/localhost.new \
  	 /etc/caudium/servers/localhost
    fi
d165 1
a165 1
    if [ ! -f /etc/caudium/servers/Global_Variables ]; then    
d172 1
@


1.20
log
@debian policy change
@
text
@d4 1
a4 1
# $Id: postinst,v 1.19 2001/01/08 16:52:15 grendel Exp $
d70 1
a70 1
    if [! -f /etc/default/caudium ]; then
@


1.19
log
@OK, I'm trying not to break things too much, but it can happen :))

- Makefile.in uses the -p flag to cp as some cp versions don't preserve time
  stamps when this flag isn't used
- The install_alt target doesn't install modules in the ${prefix}/share
  directory - they are installed in the ${prefix}/lib along with the core.
- Debian changes - version bump and adaptation to the above
- Added two cif options to configure request settings when http2.pike is used:
    - RequestBufSize  - sets the request buffer size as used by the Caudium
      cmod. Note, it broke requests for me at home - at work it seems to
      function correctly, though... The breakage was that on every requests
      the 'Indexing NULL...' error was happening 3 times in row - then the
      request was handled ok. The problem was reported to happen at line
      1393 or http2.pike - but the real error ocurred somewhere inside
      f_buf_append in caudium.c ... This might be a consequence of
      dynamically allocating the request buffer (buffer->data) in class init
      and reallocating it (if needed) in create.
    - RequestCacheTimeout - sets the http2 cache request timeout.
@
text
@d4 1
a4 1
# $Id: postinst,v 1.18 2000/12/29 20:47:26 grendel Exp $
d70 2
a71 2
    if [ -n "$START_OPTIONS" ]; then
	cat <<EOF > /etc/caudium/start_options
d75 6
@


1.18
log
@another test
@
text
@d4 1
a4 1
# $Id: postinst,v 1.17 2000/12/29 20:45:42 grendel Exp $
a143 8

    #
    # Some modules inherit other with relative paths
    #
    cd /usr/lib/caudium/
    for d in ../../share/caudium/*; do
	ln -sf ${d} /usr/lib/caudium/
    done
@


1.17
log
@test
@
text
@d4 1
a4 1
# $Id: postinst,v 1.16 2000/12/29 16:01:01 grendel Exp $
d166 2
a167 2
    db_stop
    
@


1.16
log
@fixed a problem with debconf
@
text
@d4 1
a4 1
# $Id: postinst,v 1.15 2000/12/08 16:05:20 grendel Exp $
d11 1
d13 1
@


1.15
log
@One more change - requested by James :-)
@
text
@d4 1
a4 1
# $Id: postinst,v 1.14 2000/11/27 16:05:59 grendel Exp $
d11 1
@


1.15.2.1
log
@fixed a problem with debconf
@
text
@d4 1
a4 1
# $Id: postinst,v 1.15 2000/12/08 16:05:20 grendel Exp $
a10 2
db_version 2.0
db_capb
@


1.15.2.2
log
@debian policy change
@
text
@d4 1
a4 1
# $Id: postinst,v 1.15.2.1 2000/12/29 15:56:16 grendel Exp $
d69 2
a70 2
    if [ ! -f /etc/default/caudium ]; then
	cat <<EOF > /etc/default/caudium
a73 6
#
# This file has been generated automatically the first
# time Caudium was installed on this machine. You can
# modify the START_OPTIONS variable below at your will
# as this file won't ever be modified by the Caudium
# package.
@


1.15.2.3
log
@boo
@
text
@d4 1
a4 1
# $Id: postinst,v 1.15.2.2 2001/01/31 18:47:03 grendel Exp $
d158 4
a161 12
    DIRS="/var/run/caudium /var/state/caudium /var/cache/caudium /etc/caudium/servers /var/log/caudium"
    if [ ! -x /usr/sbin/dpkg-statoverride ]; then
	# Now let's take care of permissions
	# if it is the first time we run Caudium
	if [ ! -f /etc/caudium/servers/Global_Variables ]; then    	    
	    for d in $DIRS; do
		if test -d $d; then
		    chown -R www-data.www-data $d
		fi
	    done
	fi
    else
d163 3
a165 2
	    dpkg-statoverride --remove $d > /dev/null 2>&1 || true
	    dpkg-statoverride --update --add www-data www-data 0664 $d
@


1.15.2.4
log
@I'm an idiot
@
text
@d4 1
a4 1
# $Id: postinst,v 1.15.2.3 2001/06/07 14:06:35 grendel Exp $
d172 1
a172 1
	    dpkg-statoverride --update --add www-data www-data 0751 $d
@


1.15.2.5
log
@debian stuff
@
text
@d4 1
a4 1
# $Id: postinst,v 1.15.2.4 2001/06/08 09:28:32 grendel Exp $
d158 1
a158 2
    DIRS="/var/run/caudium /var/state/caudium /var/cache/caudium /etc/caudium/servers /var/log/caudium /etc/caudium"

@


1.14
log
@Bugfix in the postinst phase and therefore a version bump
@
text
@d4 1
a4 1
# $Id: postinst,v 1.13 2000/11/03 19:36:12 grendel Exp $
d87 2
a88 1
    sed -e "s;@@PROTOCOL@@;$PROTOCOL;" /etc/caudium/servers/localhost > \
d91 1
@


1.13
log
@Fixed debian packaging
@
text
@d4 1
a4 1
# $Id: postinst,v 1.12 2000/10/09 10:29:59 grendel Exp $
d143 1
@


1.12
log
@bummer
@
text
@d4 1
a4 1
# $Id: postinst,v 1.11 2000/10/09 09:52:28 grendel Exp $
d49 1
a49 1
     sed -e "s;@@PORTNUM@@;$PORTNO;" /etc/caudium/servers/localhost > \
@


1.11
log
@- Changed buggy paths in Debian packages
@
text
@d4 1
a4 1
# $Id: postinst,v 1.10 2000/10/07 19:24:09 grendel Exp $
d144 1
a144 1
	ln -sf ../../share/caudium/modules /usr/lib/caudium/
@


1.10
log
@- corrected some Debian errors
@
text
@d4 1
a4 1
# $Id: postinst,v 1.9 2000/09/25 14:20:57 grendel Exp $
d139 7
@


1.9
log
@Split modules into separate packages - -modules -ultralog -pixsl. Caudium
depends only on the first one now, the other are recommended. Fixed most of
the lintian-reported bugs. Caudium starts now as www-data.www-data by
default.
@
text
@d4 1
a4 1
# $Id: postinst,v 1.8 2000/09/17 16:00:02 grendel Exp $
d143 1
a143 1
	DIRS="/var/run/caudium /var/state/caudium /var/cache/caudium /etc/caudium/servers"
@


1.8
log
@some minor changes
@
text
@d4 1
a4 1
# $Id: postinst,v 1.7 2000/08/26 11:21:22 grendel Exp $
d39 1
a39 1
    if test -n "$RET" -a "$RET" != "22202"; then
d48 1
a48 1
    if [ ! -f /etc/caudium/Global_Variables ]; then    
d67 1
a67 1
    if test -n "$START_OPTIONS"; then
d82 3
a84 3
	mv /usr/lib/caudium/protocols/http2.pike /usr/lib/caudium/protocols/http.new
	mv /usr/lib/caudium/protocols/http.pike /usr/lib/caudium/protocols/http2.pike
	mv /usr/lib/caudium/protocols/http.new /usr/lib/caudium/protocols/http.pike
d86 4
a89 1
        
d139 11
a149 1
    
@


1.7
log
@keep polishing it up
@
text
@d4 1
a4 1
# $Id$
d125 1
a125 1
<li> User directories are enabled, and user documents will be looked for in the public_html directory of the users' homes.
@


1.6
log
@Further Debian changes
@
text
@d3 2
d33 5
d41 2
a42 2
	$(sed -e "s/\(ConfigPorts.*\)\(22202\)\(.*\)/\1$RET\3/" $CAUDIUM_PIKE > $CAUDIUM_PIKE.new) \
	  && mv $CAUDIUM_PIKE.new $CAUDIUM_PIKE
d68 1
a68 1
	cat <<EOF > /etc/caudium
d76 1
a76 1
START_OPTIONS=$START_OPTIONS
d87 48
d136 1
a141 4
    update-alternatives --install /usr/bin/htpasswd  htpasswd \
				  /usr/bin/htpasswd-caudium 1 \
			--slave /usr/share/man/man1/htpasswd.1.gz \
			        htpasswd.1.gz /usr/share/man/man1/htpasswd-caudium.1.gz
@


1.5
log
@- latest version of Debian stuff
- smartlink modified to support sans -rpath and sans -R compiles on Debian
  (it is forbidden by the Debian policy to use these flags)
@
text
@d57 1
d61 10
a70 1
	echo $START_OPTIONS > /etc/caudium/start_options
d85 5
a89 1
    db_purge
@


1.4
log
@further debian changes
@
text
@d62 8
a69 1
    
@


1.3
log
@yep, I blew it again. Now it's OK.
@
text
@d30 1
a30 7
    set -x
    db_get caudium/reconfig_localhost
    if test "$RET" = "false"; then
	db_stop
	exit 0
    fi
    
d39 6
a44 11
    if test -z "$RET"; then
	LISTEN_IF="`hostname -f`"
	PORTNO=80
    else
	LISTEN_IF="$RET"
	PORTNO="`echo $RET | cut -s -d ':' -f 2`"
        if test -z "$PORTNO"; then
    	    PORTNO=80
        else
	    RET="`echo $RET | cut -s -d ':' -f 1`"
	fi
a46 5
    CAUDIUM_IF="<a><str>$PORTNO</str><str>http</str><str>$RET</str><str></str></a>"
    sed -e "s;@@PLACEHOLDER@@;$CAUDIUM_IF;" /etc/caudium/servers/localhost > \
        /etc/caudium/servers/localhost.new && mv /etc/caudium/servers/localhost.new \
	/etc/caudium/servers/localhost

@


1.2
log
@Some more Debian-related changes. It's not perfect yet, but getting close :)
@
text
@a100 80
#! /bin/sh
# postinst script for caudium
#
# see: dh_installdeb(1)

set -e

. /usr/share/debconf/confmodule

# 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'.

case "$1" in
    configure)
    db_get caudium/config_port
    if test -z "$RET"; then
	CONFIG_PORT=22202
    else
	CONFIG_PORT="$RET"
    fi

    echo -e Config port: $CONFIG_PORT

    db_get caudium/listen_on
    if test -z "$RET"; then
	LISTEN_IF="`hostname -f`"
    else
	LISTEN_IF="$RET"
    fi
    echo Listen on interface: $LISTEN_IF

    db_get caudium/start_options
    START_OPTIONS=

    for o in `echo $RET | sed -e 's/,//g'`; do
	case $o in
	    threads) START_OPTIONS="$START_OPTIONS --with-threads" ;;
	    debug) START_OPTIONS="$START_OPTIONS --with-debug" ;;
	    once) START_OPTIONS="$START_OPTIONS --once" ;;
	    profile) START_OPTIONS="$START_OPTIONS --with-profile" ;;
	    fd-debug) START_OPTIONS="$START_OPTIONS --with-fd-debug" ;;
	esac
    done
    echo Start options: $START_OPTIONS
    db_stop
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    db_stop
    db_purge
    ;;

    *)
        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.

#DEBHELPER#

exit 0


@


1.1
log
@Added Debian GNU/Linux package stuff
@
text
@d26 100
@

