# SliTaz package receipt.

PACKAGE="squirrelmail-html"
VERSION="3.7a-1.4.x"
CATEGORY="network"
SHORT_DESC="HTML viewer plugin for Web mail."
MAINTAINER="pascal.bellard@slitaz.org"
SOURCE="view_as_html"
TARBALL="$SOURCE-$VERSION.tar.gz"
WEB_SITE="http://www.squirrelmail.org/"
DEPENDS="squirrelmail"
WGET_URL="${WEB_SITE}plugins/$TARBALL"

# Rules to configure and make the package.
compile_rules()
{
	mkdir -p $DESTDIR
	cp -a $src $DESTDIR/$SOURCE
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/share/squirrelmail/plugins
	cp -a $_pkg/$SOURCE $fs/usr/share/squirrelmail/plugins
	chown -R 80 $fs/usr/share/squirrelmail
}

post_install()
{
	echo "\$plugins[] = '$SOURCE';" >> $1/etc/squirrelmail/config_local.php
}

pre_remove()
{
	sed -i "/\$plugins.. = '$SOURCE';/d" /etc/squirrelmail/config_local.php
}