thumbor-9999.ebuild: Patch 'argparse' dependency out of setup.py
[wtk-overlay.git] / thumbor-9999.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=6
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit distutils-r1 user
9
10 if [[ "${PV}" == "9999" ]]; then
11         inherit git-r3
12         EGIT_REPO_URI="git://github.com/thumbor/thumbor.git"
13         SRC_URI=""
14 else
15         SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
16 fi
17
18 DESCRIPTION="An an open-source photo thumbnail service"
19 HOMEPAGE="https://github.com/thumbor/thumbor https://pypi.python.org/pypi/thumbor"
20
21 LICENSE="MIT"
22 SLOT="0"
23 KEYWORDS="~amd64 ~x86"
24 IUSE="test"
25
26 RDEPEND="
27         >=dev-python/derpconf-0.2.0[${PYTHON_USEDEP}]
28         dev-python/futures[${PYTHON_USEDEP}]
29         >=dev-python/libthumbor-1.3.2[${PYTHON_USEDEP}]
30         >=dev-python/pexif-0.15[${PYTHON_USEDEP}]
31         <dev-python/pexif-1.0[${PYTHON_USEDEP}]
32         >=dev-python/pillow-3.0.0[${PYTHON_USEDEP}]
33         <dev-python/pillow-4.0.0[${PYTHON_USEDEP}]
34         >=dev-python/pycrypto-2.1.0[${PYTHON_USEDEP}]
35         >=dev-python/pycurl-7.19.0[${PYTHON_USEDEP}]
36         <dev-python/pycurl-7.44.0[${PYTHON_USEDEP}]
37         dev-python/pytz[${PYTHON_USEDEP}]
38         >=dev-python/statsd-3.0.1[${PYTHON_USEDEP}]
39         media-libs/opencv[python_single_target_python2_7]
40         >=www-servers/tornado-4.1.0[${PYTHON_USEDEP}]
41         <www-servers/tornado-5.0.0[${PYTHON_USEDEP}]
42         "
43 DEPEND="
44         dev-python/setuptools[${PYTHON_USEDEP}]
45         test? (
46                 ${RDEPEND}
47                 dev-python/colorama[${PYTHON_USEDEP}]
48                 dev-python/coverage[${PYTHON_USEDEP}]
49                 dev-python/flake8[${PYTHON_USEDEP}]
50                 >=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
51                 <dev-python/mock-3.0.0[${PYTHON_USEDEP}]
52                 dev-python/nose[${PYTHON_USEDEP}]
53                 dev-python/numpy[${PYTHON_USEDEP}]
54                 >=dev-python/preggy-1.3.0[${PYTHON_USEDEP}]
55                 dev-python/pyssim[${PYTHON_USEDEP}]
56                 dev-python/raven[${PYTHON_USEDEP}]
57                 >=dev-python/redis-py-2.4.9[${PYTHON_USEDEP}]
58                 <dev-python/redis-py-3.0.0[${PYTHON_USEDEP}]
59                 >=dev-python/scipy-0.16.1[${PYTHON_USEDEP}]
60                 <dev-python/scipy-1.0.0[${PYTHON_USEDEP}]
61                 media-gfx/cairosvg[${PYTHON_USEDEP}]
62         )
63         "
64
65 PATCHES=( "${FILESDIR}/${PV}-0001-setup.py-Remove-argparse-dependency.patch" )
66
67 pkg_setup() {
68         P_HOME="${EPREFIX}/var/lib/${PN}"
69         ebegin "Creating ${PN} user and group"
70         enewgroup "${PN}"
71         enewuser "${PN}" -1 -1 "${P_HOME}" "${PN}"
72         eend $?
73 }
74
75 python_test() {
76         make test || die "Testsuite failed under ${EPYTHON}"
77 }
78
79 python_install_all() {
80         distutils-r1_python_install_all
81         doinitd "${FILESDIR}/init.d/${PN}"
82         mkdir "${ED}etc/${PN}" || die "Failed to make ${EPREFIX}/etc/${PN}"
83         PYTHONPATH="${ED}/usr/lib64/python2.7/site-packages" "${ED}/usr/lib/python-exec/python2.7/thumbor-config" \
84                 > "${ED}etc/${PN}/${PN}.conf" ||
85                 die "Failed to run thumbor-config"
86         mkdir -p "${ED}var/lib/${PN}" || die "Failed to make ${EPREFIX}/var/lib/${PN}"
87         chown -R "${PN}:${PN}" "${ED}etc/${PN}" "${ED}var/lib/${PN}" || die "Failed to chown ${PN}:${PN}"
88 }