# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils webapp DESCRIPTION="Maia Mailguard is a Web based frontend to control virus scanners and spam filters" HOMEPAGE="http://www.renaissoft.com/projects/maia/" SRC_URI="http://www.maiamailguard.com/files/${PN}-${PV}.tar.gz" SLOT="0" LICENSE="GPL-2" KEYWORDS="~x86 ~amd64" IUSE="apache crypt mysql postgres" RDEPEND=" >=sys-apps/coreutils-5.0-r3 mail-filter/spamassassin virtual/mta virtual/antivirus dev-perl/Archive-Tar >=dev-perl/Archive-Zip-1.14 >=dev-perl/Compress-Zlib-1.35 dev-perl/Convert-TNEF >=dev-perl/Convert-UUlib-1.06 >=dev-perl/DBI-1.40 dev-perl/IO-stringy virtual/perl-MIME-Base64 dev-perl/MIME-tools >=dev-perl/net-server-0.93 dev-perl/Template-Toolkit >=virtual/perl-Time-HiRes-1.49 dev-perl/Unix-Syslog crypt? ( dev-perl/Crypt-Blowfish dev-perl/crypt-cbc ) apache? ( net-www/apache virtual/php dev-php/PEAR-Net_POP3 dev-php/PEAR-Net_IMAP dev-php/PEAR-DB dev-php/PEAR-Mail_Mime dev-php/PEAR-Image_Graph dev-libs/libmcrypt ) mysql? ( >=dev-db/mysql-4.0.1 >=dev-perl/DBD-mysql ) postgres? ( >=dev-db/postgresql-8.0 dev-perl/DBD-Pg >=dev-perl/DBD-Pg-1.31 )" pkg_setup() { webapp_pkg_setup enewgroup amavis enewuser amavis -1 /bin/false /var/lib/amavis amavis } src_unpack() { unpack ${A} && cd "${S}" } src_install() { webapp_src_preinst # Install maia scripts cd ${S}/scripts exeinto /usr/bin exeopts -oamavis -gamavis -m0700 doexe *.pl cd ${S} exeinto /usr/sbin exeopts -oamavis -gamavis -m0700 doexe amavisd-maia # Config files cd ${S} insinto /etc cp maia.conf.dist maia.conf doins maia.conf dosed "s:^\$script_dir = [^;]*;:\$script_dir = \"/usr/bin\";: "\ /etc/maia.conf cp amavisd.conf.dist amavisd.conf doins amavisd.conf cd ${S} dodoc LICENSE README maia-mysql.sql maia-pgsql.sql # webapp-config is not yet ready to deal with this # webapp_sqlscript mysql maia-mysql.sql # webapp_sqlscript postgres maia-pgsql.sql # Also install full amavisd-new source as documentation tar cvf amavisd-new-2.2.1.tgz reference/amavisd-new-2.2.1/ dodoc amavisd-new-2.2.1.tgz if use apache then cd ${S}/templates cp -R *.tpl ${D}/${MY_HTDOCSDIR} cd ${S}/php cp -R * ${D}/${MY_HTDOCSDIR} webapp_postinst_txt en ${FILESDIR}/postinstall-en.txt fi webapp_src_install } pkg_postinst() { einfo "The first stage of the installation is done. Now you need to setup " einfo "your virtual hosts via webapp-config" einfo "Please read man webapp-config for a detailed description of the" einfo "process and some examples" }