#!/bin/sh
#
case $2 in
	PRE-DEINSTALL)
		#including any pre-deinstall content and @preunexec commands...
		if cmp -s /usr/local/www/apache24/data/index.html /usr/local/share/apache24/misc/index.html; then rm -f /usr/local/www/apache24/data/index.html; fi
		rm -f /usr/local/etc/apache24/httpd.conf.bak 2> /dev/null || true
		;;
	POST-DEINSTALL)
		#including any @postunexec commands...
		;;
esac
# 
# Including the existing pkg-deinstall script..
# 
#!/bin/sh
#
# $FreeBSD: head/www/apache24/files/pkg-deinstall.in 378215 2015-01-31 15:22:51Z ohauer $
#

MPM_FALLBACK="/usr/local/etc/apache24/modules.d/000_mpm_prefork_fallback.conf"

_cleanup(){
	if [ -f ${MPM_FALLBACK} ]; then
		echo -n "remove fallback MPM : "
		/bin/rm -vf ${MPM_FALLBACK}
	fi
}

# run only if build with modular MPM
if [ "x$2" = "xDEINSTALL" ]; then
	_cleanup
fi

# 
# Done including the existing script.
exit 0
