summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-mail/postfixadmin/postfixadmin-2.1.0-r2.ebuild')
-rw-r--r--net-mail/postfixadmin/postfixadmin-2.1.0-r2.ebuild113
1 files changed, 113 insertions, 0 deletions
diff --git a/net-mail/postfixadmin/postfixadmin-2.1.0-r2.ebuild b/net-mail/postfixadmin/postfixadmin-2.1.0-r2.ebuild
new file mode 100644
index 0000000..8827390
--- /dev/null
+++ b/net-mail/postfixadmin/postfixadmin-2.1.0-r2.ebuild
@@ -0,0 +1,113 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Source: http://bugs.gentoo.org/show_bug.cgi?id=50035
+# Submitted-By: SteveB <tp22a@softhome.net>
+# Reviewed-By: wrobel 2005-12-14
+
+inherit eutils webapp depend.php depend.apache
+
+DESCRIPTION="Web Based Management tool for Postfix for dealing with Postfix Style Virtual Domains
+and Virtual Users that are stored in MySQL."
+HOMEPAGE="http://sourceforge.net/projects/postfixadmin/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tgz"
+
+LICENSE="MPL-1.1"
+KEYWORDS="~x86 ~amd64"
+IUSE="mysql postgres"
+
+RDEPEND="virtual/httpd-php
+ >=mail-mta/postfix-2.0.0
+ mysql? ( dev-perl/DBI dev-perl/DBD-mysql )"
+
+need_apache
+
+pkg_setup() {
+ webapp_pkg_setup
+ if use mysql; then
+ enewgroup vacation
+ enewuser vacation -1 -1 /dev/null vacation
+ fi
+
+ local flags="pcre session"
+ use mysql && flags="${flags} mysql"
+ use postgres && flags="${flags} postgres"
+ require_php_with_use ${flags}
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Remove .cvs* files and CVS directories
+ find ${S} -name .cvs\* -or \( -type d -name CVS -prune \) -exec rm -rf {} \;
+
+ # Database support (we don't care wich one is used. Allow both of them!)
+ if use mysql; then
+ cp ./DATABASE_MYSQL.TXT ${T}/mysql-setup.sql || die "Creating MySQL setup script failed!"
+ cp ./TABLE_CHANGES.TXT ${T}/mysql-update.sql || die "Creating MySQL update script failed!"
+ cp ./VIRTUAL_VACATION/INSTALL.TXT ${T}/VIRTUAL_VACATION_INSTALL.TXT
+ fi
+ if use postgres ; then
+ cp ./DATABASE_PGSQL.TXT ${T}/pgsql-setup.sql || die "Creating PostgreSQL setup script failed!"
+ epatch "${FILESDIR}"/${P}-postgres-1.patch || die "Patching for postgres failed."
+ epatch "${FILESDIR}"/${P}-postgres-2.patch || die "Patching for postgres failed."
+ epatch "${FILESDIR}"/${P}-postgres-3.patch || die "Patching for postgres failed."
+ fi
+
+ # Rename config.inc.php
+ cp ./config.inc.php.sample ${T}/config.inc.php || die "Creating config file failed!"
+}
+
+src_install() {
+ webapp_src_preinst
+
+ # Virtual Vacation only works with MySQL
+ if use mysql; then
+ diropts -m0770 -o vacation -g vacation
+ keepdir /var/spool/vacation
+ insinto /var/spool/vacation
+ insopts -m770 -o vacation -g vacation
+ doins "${S}"/VIRTUAL_VACATION/vacation.pl
+ fi
+
+ # install the SQL scripts available to us
+ # unfortunately, we do not have scripts to upgrade from older versions
+ # these are things we need to add at a later date
+ #
+ if use mysql; then
+ webapp_sqlscript mysql ${T}/mysql-setup.sql
+ webapp_sqlscript mysql ${T}/mysql-update.sql 2.0.x
+ webapp_sqlscript mysql ${T}/mysql-update.sql 1.5x
+ fi
+ if use postgres ; then
+ webapp_sqlscript pgsql ${T}/pgsql-setup.sql
+ fi
+
+
+ einfo "Installing main files"
+ dodir ${MY_HTDOCSDIR}
+ cp -r . "${D}"${MY_HTDOCSDIR} || die "cp failed"
+ cp ${T}/config.inc.php "${D}"${MY_HTDOCSDIR} || die "cp failed"
+
+ # handle documentation files
+ local docs="{BACKUP_MX,CHANGELOG,INSTALL,LANGUAGE,LICENSE.TXT,TABLE_BACKUP_MX,TABLE_CHANGES,UPGRADE}.TXT"
+ use mysql && docs="${docs} DATABASE_MYSQL.TXT ${T}/VIRTUAL_VACATION_INSTALL.TXT"
+ use postgres && docs="${docs} DATABASE_PGSQL.TXT"
+
+ dodoc ${docs}
+ for foo in ${docs} DATABASE_MYSQL.TXT DATABASE_PGSQL.TXT ADDITIONS VIRTUAL_VACATION ; do
+ rm -rf "${D}"${MY_HTDOCSDIR}/${foo}
+ done
+
+ webapp_configfile ${MY_HTDOCSDIR}/config.inc.php
+ webapp_configfile ${MY_HTDOCSDIR}/admin/.htpasswd
+
+ # Add the hook file to fix the .htaccess file
+ webapp_hook_script "${FILESDIR}"/config-hook.sh
+
+ webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt
+
+ webapp_src_install
+}