# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit webapp DESCRIPTION="Web based administration and user controls for dspam" HOMEPAGE="http://dspam.nuclearelephant.com/" SRC_URI="mirror://sourceforge/dspam/dspam-${PV}.tar.gz" LICENSE="GPL-2" KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" IUSE="apache2" RDEPEND="apache2? ( www-servers/apache[+suexec] ) >=mail-filter/dspam-${PV}[-user-homedirs] dev-perl/GD[png] dev-perl/GD-Graph3d dev-perl/GDGraph dev-perl/GDTextUtil sys-apps/sed" DEPEND="" # some FHS-like structure HOMEDIR="/var/spool/dspam" CONFDIR="/etc/mail/dspam" S="${WORKDIR}/dspam-${PV}" need_httpd_cgi src_configure() { econf \ --with-dspam-home=${HOMEDIR} \ --sysconfdir=${CONFDIR} || die "econf failed" } src_compile() { cd "${S}/webui" default } src_install() { webapp_src_preinst cd "${S}/webui" # Cleanup install files find . -type f -name "Makefile*" -or -name "*.in" -delete || die "failed to remove unneeded files" insinto "${MY_HTDOCSDIR}" insopts -m644 doins -r htdocs/* || die "doins failed for htdocs" insinto "${MY_CGIBINDIR}" doins -r cgi-bin/* || die "doins failed for cgi-bin" webapp_configfile "${MY_CGIBINDIR}"/{admins,configure.pl,default.prefs,rgb.txt} 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 don't have any other cgi scripts." webapp_pkg_postinst }