1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_4 pypy )
7 PYTHON_REQ_USE='sqlite?,threads(+)'
8 WEBAPP_NO_AUTO_INSTALL="yes"
10 inherit bash-completion-r1 distutils-r1 eutils versionator webapp
14 DESCRIPTION="High-level Python web framework"
15 HOMEPAGE="https://www.djangoproject.com/ https://pypi.python.org/pypi/Django"
16 SRC_URI="https://www.djangoproject.com/m/releases/$(get_version_component_range 1-2)/${MY_P}.tar.gz"
21 IUSE="doc sqlite test"
25 dev-python/setuptools[${PYTHON_USEDEP}]
26 doc? ( >=dev-python/sphinx-1.0.7[${PYTHON_USEDEP}] )
28 $(python_gen_impl_dep sqlite)
29 dev-python/docutils[${PYTHON_USEDEP}]
30 dev-python/numpy[$(python_gen_usedep 'python*')]
31 dev-python/pillow[${PYTHON_USEDEP}]
32 dev-python/pytz[${PYTHON_USEDEP}]
33 dev-python/pyyaml[${PYTHON_USEDEP}]
36 # dev-python/python-sqlparse[${PYTHON_USEDEP}]
37 # dev-python/bcrypt[${PYTHON_USEDEP}]
38 # dev-python/selenium[${PYTHON_USEDEP}]
39 # sci-libs/gdal[geos,${PYTHON_USEDEP}]
41 S="${WORKDIR}/${MY_P}"
43 WEBAPP_MANUAL_SLOT="yes"
46 "${FILESDIR}"/${PN}-1.7.6-bashcomp.patch
53 python_prepare_all() {
54 # Prevent d'loading in the doc build
55 sed -e '/^ "sphinx.ext.intersphinx",/d' -i docs/conf.py || die
57 distutils-r1_python_prepare_all
60 python_compile_all() {
61 use doc && emake -C docs html
65 # Tests have non-standard assumptions about PYTHONPATH,
66 # and don't work with ${BUILD_DIR}/lib.
67 PYTHONPATH=. "${PYTHON}" tests/runtests.py --settings=test_sqlite -v2 \
68 || die "Tests fail with ${EPYTHON}"
72 distutils-r1_src_install
75 elog "Additional Backend support can be enabled via"
76 optfeature "MySQL backend support in python 2.7 only" dev-python/mysql-python
77 optfeature "MySQL backend support in python 2.7 - 3.4" dev-python/mysqlclient
78 optfeature "PostgreSQL backend support" dev-python/psycopg:2
79 optfeature "GEO Django" sci-libs/gdal[geos]
80 optfeature "Memcached support" dev-python/pylibmc dev-python/python-memcached
81 optfeature "ImageField Support" dev-python/pillow
85 python_install_all() {
86 newbashcomp extras/django_bash_completion ${PN}-admin
87 bashcomp_alias ${PN}-admin django-admin.py
90 rm -fr docs/_build/html/_sources || die
91 local HTML_DOCS=( docs/_build/html/. )
94 insinto "${MY_HTDOCSDIR#${EPREFIX}}"
95 doins -r django/contrib/admin/static/admin/.
96 distutils-r1_python_install_all
100 elog "A copy of the admin media is available to webapp-config for installation in a"
101 elog "webroot, as well as the traditional location in python's site-packages dir"
102 elog "for easy development."