X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpostinst;h=f15b8a68b493bfac901765651ac608977341e023;hb=e5918b19b1cb2efa40d801c6643ea44dc0eefc4d;hp=196c904337cddf8011327f384e1b0f34f52b62f8;hpb=b6fae24fa516d341fce82b9fd04b7b82172677a6;p=php5-cn.git diff --git a/debian/postinst b/debian/postinst index 196c904..f15b8a6 100755 --- a/debian/postinst +++ b/debian/postinst @@ -4,9 +4,6 @@ set -e [ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx -# Source debconf library. -. /usr/share/debconf/confmodule - case "$1" in configure) # continue below @@ -28,7 +25,7 @@ esac PKG="php5-cn" A2MODEDIR="/etc/apache2/mods-enabled" -EXTENSIONS="mysql ldap gd" +EXTENSIONS="mysql" PHP5DIR="/etc/php5" PHP5CONFD="/etc/php5/conf.d" @@ -51,7 +48,7 @@ if [ -e /etc/apache2/apache2.conf ]; then fi -# Check if PHP5 extensions (MySQL, LDAP, GD) are enabled. +# Check if PHP5 extensions are enabled. # for php5ext in $EXTENSIONS; do @@ -61,18 +58,27 @@ for php5ext in $EXTENSIONS; do # configuration files. for SAPI in apache apache2 cgi cli; do - ini_file="$PHP5DIR/$SAPI/php.ini" + if [ -d "$PHP5DIR/$SAPI" ]; then + + ini_file="$PHP5DIR/$SAPI/php.ini" - if [ -f "$ini_file" ]; then + if [ -f "$ini_file" ]; then cp_echo "CN: Removing $php5ext extension from file $ini_file" cp_check_and_sed "$php5ext_re" \ "/$php5ext_re/d" \ "$ini_file" && need_restart=1 || true - fi + fi + fi done + # Check $PHP5CONFD directory. + if [ ! -d "$PHP5CONFD" ]; then + cp_echo "CN: Creating configuration directory $PHP5CONFD" + mkdir $PHP5CONFD + fi + # Check extension configuration in /etc/php5/conf.d/ directory. if [ ! -f "$PHP5CONFD/$php5ext.ini" ]; then @@ -122,15 +128,15 @@ for SAPI in apache apache2 cgi cli; do if [ -f "$ini_file" ]; then - cp_check_and_sed "^[[:space:]]*upload_max_filesize[[:space:]]*=[[:space:]]*2M$" \ + cp_check_and_sed "^[[:space:]]*upload_max_filesize[[:space:]]*=[[:space:]]*2M" \ 's/^[[:space:]]*upload_max_filesize[[:space:]]*=.*/upload_max_filesize = 256M/' \ "$ini_file" && need_restart=1 || true - cp_check_and_sed "^[[:space:]]*post_max_size[[:space:]]*=[[:space:]]*8M$" \ + cp_check_and_sed "^[[:space:]]*post_max_size[[:space:]]*=[[:space:]]*8M" \ 's/^[[:space:]]*post_max_size[[:space:]]*=.*/post_max_size = 256M/' \ "$ini_file" && need_restart=1 || true - cp_check_and_sed "^[[:space:]]*memory_limit[[:space:]]*=[[:space:]]*16M$" \ + cp_check_and_sed "^[[:space:]]*memory_limit[[:space:]]*=[[:space:]]*16M" \ 's/^[[:space:]]*memory_limit[[:space:]]*=.*/memory_limit = 256M/' \ "$ini_file" && need_restart=1 || true fi