# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit webapp eutils # BUG: # naming rule is insane MY_PV_DATE=${PV/#[[:digit:]].[[:digit:]]./} MY_PV=${PV/%.${MY_PV_DATE}/-${MY_PV_DATE}} MY_P="${PN}_${MY_PV}" MY_PN=${PN/_web/} DESCRIPTION="a browser-based multilingual IMAP client using AJAX" HOMEPAGE="http://www.roundcube.net" SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.tar.gz" LICENSE="GPL-2" KEYWORDS="~x86" S=${WORKDIR}/${MY_PN}-${MY_PV} IUSE="mysql sqlite" RDEPEND="mysql? (>=dev-db/mysql-4) sqlite? (dev-db/sqlite) !mysql? ((!sqlite(dev-db/mysql))) virtual/httpd-php dev-php/PEAR-DB" pkg_setup() { if use mysql ; then if ! built_with_use virtual/httpd-php mysql ; then eerror "PHP is missing MySQL support." eerror "Please add 'mysql' to your USE flags, and re-emerge PHP." die "PHP needs mysql support" fi fi webapp_pkg_setup } src_install () { webapp_src_preinst cd "${S}" local docs="CHANGELOG README UPGRADING" # handle documentation files # # NOTE that doc files go into /usr/share/doc as normal; they do NOT # get installed per vhost! dodoc ${docs} for foo in ${docs} INSTALL; do rm -f ${foo} done # copy the app's main files # einfo "Installing main files" cp -R . ${D}/${MY_HTDOCSDIR} rm -rf ${D}/${MY_HTDOCSDIR}/SQL # Directories needed to be owned by web server # webapp_serverowned ${MY_HTDOCSDIR}/logs webapp_serverowned ${MY_HTDOCSDIR}/temp # add the post-installation instructions # webapp_postinst_txt en ${FILESDIR}/postinstall-en.txt # install the SQL scripts available to us # NOTE: We support all the differend SQL backends # if use mysql ; then webapp_sqlscript mysql SQL/mysql.initial.sql cp SQL/mysql.update.sql ${T}/mysql.update-0.1-20051007-to-${PV}.sql webapp_sqlscript mysql ${T}/mysql.update-0.1-20051007-to-${PV}.sql 0.1-20051007 fi if use sqlite ; then webapp_sqlscript sqlite SQL/sqlite.initial.sql fi # Identify the configuration files that this app uses # webapp_configfile ${MY_HTDOCSDIR}/config/db.inc.php webapp_configfile ${MY_HTDOCSDIR}/config/main.inc.php # all done # # now we let the eclass strut its stuff ;-) # webapp_src_install } pkg_postinst () { webapp_pkg_postinst }