# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # TODO: patching issue (see doc/Upgrade*, spandsp and modules subdirs) # TODO: automatically snarf user/pass from asterisk manager.conf DST="/var/lib/asterfax" ETCDIR="/etc/asterfax" LOGDIR="/var/log/asterfax" SPOOLDIR="/var/spool/asterfax" SLOT="0" LICENSE="asterfax" KEYWORDS="x86" DESCRIPTION="Email to fax (and fax to email) gateway for Asterisk." HOMEPAGE="http://asterfax.sourceforge.net/" SRC_URI="mirror://sourceforge/asterfax/AsterFax-1.0-free.zip" DEPEND="dev-java/sun-jdk net-misc/efax net-misc/asterisk net-misc/asterisk-app_rtxfax" RDEPEND="${DEPEND}" src_install() { # configuration dodir ${ETCDIR} keepdir ${ETCDIR} mkdir -p ${ETCDIR} cp config/* ${ETCDIR} # main dest dir mkdir -p ${D}/${DST} # java bytecode cp AsterFax.jar ${D}/${DST} # misc binaries, java libraries cp -R bin lib ${D}/${DST} # optional documentation if use doc; then # release notes (this version only) dodoc doc/Release\ Notes/Version\ 1.0.html mkdir -p # ... cp #... fi # init script newinitd "${FILESDIR}/${PN}-1.0.init" asterfax } pkg_postinst() { # Add asterfax user + group enewgroup asterfax enewuser asterfax "" "" "" asterfax # Secure config dir chmod -R go-rwx ${ETCDIR} # Create log dir dodir ${LOGDIR} mkdir -p ${LOGDIR} chown -R root.asterfax {$LOGDIR} chmod -R g+w ${LOGDIR} # Create spool dirs mkdir -p ${SPOOLDIR} mkdir -p ${SPOOLDIR}/fax mkdir -p ${SPOOLDIR}/spool mkdir -p ${SPOOLDIR}/tmp chown -R root.asterfax {$SPOOLDIR} chmod -R g+w ${SPOOLDIR} # FIXTHIS: Should automatically copy the user/pass combo from # /etc/asterisk/manager.conf to /etc/asterfax/AsterFax.xml einfo "To get started, configure /etc/asterfax/AsterFax.xml with the username" einfo "and password from /etc/asterisk/manager.conf and restart asterisk." }