libthumbor-9999.ebuild: Add ebuild dev-python/libthumbor
authorW. Trevor King <wking@tremily.us>
Fri, 12 Aug 2016 20:50:30 +0000 (13:50 -0700)
committerW. Trevor King <wking@tremily.us>
Fri, 12 Aug 2016 20:50:30 +0000 (13:50 -0700)
I've submitted the setup.py sed upstream [1].

[1]: https://github.com/thumbor/libthumbor/pull/31
     Subject: Cleanup tests/ packaging

libthumbor-9999.ebuild [new file with mode: 0644]

diff --git a/libthumbor-9999.ebuild b/libthumbor-9999.ebuild
new file mode 100644 (file)
index 0000000..b220b43
--- /dev/null
@@ -0,0 +1,47 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 )
+
+inherit distutils-r1
+
+if [[ "${PV}" == "9999" ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="git://github.com/heynemann/${PN}.git"
+       SRC_URI=""
+else
+       SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
+fi
+
+DESCRIPTION="Generate Thumbor URLs from Python"
+HOMEPAGE="https://github.com/thumbor/libthumbor https://pypi.python.org/pypi/libthumbor"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+
+RDEPEND="
+       dev-python/six[${PYTHON_USEDEP}]
+       "
+
+DEPEND="
+       test? (
+               ${RDEPEND}
+               dev-python/coverage[${PYTHON_USEDEP}]
+               dev-python/flake8[${PYTHON_USEDEP}]
+               dev-python/nose[${PYTHON_USEDEP}]
+               dev-python/preggy[${PYTHON_USEDEP}]
+       )"
+
+python_prepare_all() {
+       sed -i "s/packages=find_packages()/packages=find_packages(exclude=['tests', 'tests.*'])/" setup.py || die
+       distutils-r1_python_prepare_all
+}
+
+python_test() {
+       "${EPYTHON}" -c 'import coverage; coverage.main()' run --branch $(command -v nosetests) --nocapture tests ||
+               die "tests failed with ${EPYTHON}"
+}