# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 inherit webapp DESCRIPTION="Web based administration and user controls for dspam" HOMEPAGE="http://dspam.sourceforge.net/" SRC_URI="mirror://sourceforge/dspam/dspam-${PV}.tar.gz" LICENSE="AGPL-3" KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" IUSE="apache2" RDEPEND="apache2? ( www-servers/apache[suexec] ) >=mail-filter/dspam-3.8.0[-user-homedirs] dev-perl/GD[png] dev-perl/GD-Graph3d dev-perl/GDGraph dev-perl/GDTextUtil sys-apps/sed" DEPEND="" # same defaults as mail-filter/dspam DSPAM_HOME=/var/spool/dspam DSPAM_CONF=/etc/dspam S="${WORKDIR}/dspam-${PV}" need_httpd_cgi src_configure() { econf \ --with-dspam-home=${DSPAM_HOME} \ --sysconfdir=${DSPAM_CONF} } src_compile() { cd "${S}/webui" default } src_install() { webapp_src_preinst cd "${S}/webui" # Cleanup install files find . -type f -name "Makefile*" -delete -or -name "*.in" -delete || die "failed to remove Makefiles" insinto "${MY_HTDOCSDIR}" insopts -m644 doins -r htdocs/* insinto "${MY_CGIBINDIR}" doins -r cgi-bin/* webapp_configfile "${MY_CGIBINDIR}"/{admins,subadmins,configure.pl,default.prefs} webapp_hook_script "${FILESDIR}/setperms" webapp_postinst_txt en "${FILESDIR}/postinst-en.txt" webapp_src_install } pkg_postinst() { if use apache2; then ewarn "If you're using Apache, dspam-web's config requires the scripts in the cgi-bin" ewarn "to be run as dspam:dspam. You will have to put a global SuexecUserGroup" ewarn "declaration in the main server config which will force everything in cgi-bin" ewarn "to run as dspam:dspam." fi ewarn "You should use a dedicated virtual host for this application or at least" ewarn "one that doesn't have any other cgi scripts." webapp_pkg_postinst }