#!/bin/sh

set -e

PECL_NAME=idn

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

if [ "$DPKG_DEBUG" = "developer" ]; then
  set -x
fi

if [ "$1" != "configure" ]; then
	exit 0
fi

for SAPI in apache apache2 cgi cli
do
	if [ -f /etc/php4/$SAPI/php.ini ]; then
		db_get php4/extension_${PECL_NAME}_$SAPI
		if [ "$RET" = "true" ] \
		   && ! grep -q "^[[:space:]]*extension[[:space:]]*=[[:space:]]*${PECL_NAME}.so" /etc/php4/$SAPI/php.ini
		then
			echo "extension=${PECL_NAME}.so" >> /etc/php4/$SAPI/php.ini
		fi
	fi
done

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

#DEBHELPER#

exit 0
