# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 PYTHON_DEPEND="2:2.5" inherit distutils eutils python MY_P=Pootle-${PV} DESCRIPTION="Web-based translation management system" HOMEPAGE="http://translate.sourceforge.net" SRC_URI="mirror://sourceforge/translate/${MY_P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64" IUSE="apache2" RDEPEND="|| ( >=dev-lang/python-2.5[sqlite] >=dev-python/pysqlite-2 ) app-i18n/translate-toolkit app-text/iso-codes dev-libs/xapian || ( dev-python/django[sqlite] dev-python/django[mysql] dev-python/django[postgres] ) dev-python/lxml dev-python/python-levenshtein apache2? ( || ( www-apache/mod_wsgi www-apache/mod_python ) www-servers/apache )" # dev-python/pylucene is not in tree yet S=${WORKDIR}/${MY_P} DOCS="INSTALL" pkg_setup() { enewgroup ${PN} enewuser ${PN} -1 -1 -1 ${PN} } src_install() { newinitd "${FILESDIR}/init" ${PN} newconfd "${FILESDIR}/conf" ${PN} distutils_src_install mv "${D}"/usr/share/doc/${PN}/wsgi.py "${D}"/usr/share/doc/"${P}" || die rm -Rf "${D}"/usr/share/doc/${PN} || die rm -Rf "${D}"/usr/share/doc/"${P}"/MANIFEST.* || die keepdir /var/run/pootle fowners -R pootle:pootle /var/lib/pootle fowners -R pootle:pootle /etc/pootle fperms 660 /etc/pootle/localsettings.py } pkg_postinst() { distutils_pkg_postinst elog "Enable the mysql, postgres or sqlite USEflag on dev-python/django" elog "to use the corresponding database backend." elog elog "For speed and responsiveness, consider installing net-misc/memcached" elog "and dev-python/python-memcached" elog if use apache2; then elog "You can find info on setting Pootle under Apache at:" elog "http://translate.sourceforge.net/wiki/pootle/apache" else ewarn "It's highly recommended to run Pootle under Apache control." ewarn "For this, emerge ${PN} with apache2 USEflag enabled." fi }