# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/www-apps/phpBB/phpBB-3.0.4.ebuild,v 1.1 2008/12/28 21:12:39 wrobel Exp $ EAPI="2" inherit webapp depend.php DESCRIPTION="phpBB is an open-source bulletin board package." HOMEPAGE="http://www.phpbb.com/" DIST_FILE="${P}.tar.bz2" SRC_URI="http://www.phpbb.com/files/releases/$DIST_FILE mirror://sourceforge/phpbb/$DIST_FILE" LICENSE="GPL-2" KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" LANGS="en-GB en-US ru" NOSHORTLANGS="en en-GB en-US" need_httpd_cgi need_php_httpd S="${WORKDIR}"/${PN}3 # linguas code shamelessly stolen from mozilla-firefox ebuild :) # some patches were added though... for X in ${LANGS} ; do # english is handled internally if has ${X} ${NOSHORTLANGS}; then IUSE="${IUSE} linguas_${X%%-*}" else # customized language urls LINGUA_URL="" case "${X}" in ru) LINGUA_URL="http://bb3x.ru/files/${P}-lang_russian.zip" ;; esac [[ "x$LINGUA_URL" != "x" ]] && \ SRC_URI="${SRC_URI} linguas_${X/-/_}? ( ${LINGUA_URL} -> ${P}-lang-${X}.zip )" && \ IUSE="${IUSE} linguas_${X/-/_}" fi done src_unpack() { unpack "$DIST_FILE" for X in ${LINGUAS}; do if ! has ${X} ${NOSHORTLANGS}; then if ! has ${X} ${LANGS}; then einfo "Language pack is not supported: ${X}" else unpack "${P}-lang-${X}.zip" case "${X}" in ru) #move lang-pack to phpBB3 directory cp -rf "${WORKDIR}/${P}-lang_russian/"* "${WORKDIR}/phpBB3/" rm -rf "${WORKDIR}/${P}-lang_russian/" ;; esac einfo "Unpacked language pack: ${X}" fi fi done } src_install() { webapp_src_preinst dodoc docs/* rm -rf docs insinto "${MY_HTDOCSDIR}" doins -r . webapp_serverowned "${MY_HTDOCSDIR}"/cache webapp_serverowned "${MY_HTDOCSDIR}"/files webapp_serverowned "${MY_HTDOCSDIR}"/images/avatars/upload webapp_serverowned "${MY_HTDOCSDIR}"/store webapp_serverowned "${MY_HTDOCSDIR}"/config.php webapp_configfile "${MY_HTDOCSDIR}"/config.php webapp_postinst_txt en "${FILESDIR}"/postinstall-en.txt webapp_src_install }