# 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="app-i18n/translate-toolkit app-text/iso-codes >=dev-lang/python-2.5 dev-libs/xapian || ( >=dev-python/django-1.1[mysql] >=dev-python/django-1.1[postgres] >=dev-python/django-1.1[sqlite] ) 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} pkg_setup() { enewgroup ${PN} || die enewuser ${PN} -1 -1 -1 ${PN} || die } src_install() { newinitd "${FILESDIR}/init" ${PN} || die newconfd "${FILESDIR}/conf" ${PN} || die 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 || die fowners -R pootle:pootle /var/lib/pootle /etc/pootle || die fperms 660 /etc/pootle/localsettings.py || die } pkg_postinst() { distutils_pkg_postinst einfo einfo "To use specific database backends," einfo "enable corresponding USEflags for \"dev-python/django\"" einfo einfo "For speed and responsiveness, consider installing \"net-misc/memcached\"" einfo "and \"dev-python/python-memcached\" packages." einfo einfo "The following packages could possibly speed up handling of ZIP files" einfo "for large projects: \"app-arch/unzip\", \"app-arch/zip\"" einfo if use apache2; then einfo "You can find info on setting Pootle under Apache at:" einfo "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 }