|
Line 0
Link Here
|
| 0 |
-- |
1 |
# Copyright 1999-2017 Gentoo Foundation |
|
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Id$ |
| 4 |
|
| 5 |
EAPI=6 |
| 6 |
|
| 7 |
PYTHON_COMPAT=( python{2_7,3_4,3_5} ) |
| 8 |
|
| 9 |
MY_PN="curator" |
| 10 |
ES_VERSION="5.1.1" |
| 11 |
|
| 12 |
inherit distutils-r1 |
| 13 |
|
| 14 |
DESCRIPTION="Tending time-series indices in Elasticsearch" |
| 15 |
HOMEPAGE="https://github.com/elasticsearch/curator" |
| 16 |
SRC_URI="https://github.com/elasticsearch/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz |
| 17 |
test? ( https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz )" |
| 18 |
|
| 19 |
LICENSE="Apache-2.0" |
| 20 |
SLOT="0" |
| 21 |
KEYWORDS="~amd64 ~x86" |
| 22 |
IUSE="doc test" |
| 23 |
|
| 24 |
RDEPEND=" |
| 25 |
>=dev-python/elasticsearch-py-2.4.0[${PYTHON_USEDEP}] |
| 26 |
<dev-python/elasticsearch-py-3.0.0[${PYTHON_USEDEP}] |
| 27 |
>=dev-python/click-6.0[${PYTHON_USEDEP}] |
| 28 |
>=dev-python/certifi-2016.9.26[${PYTHON_USEDEP}] |
| 29 |
>=dev-python/urllib3-1.8.3[${PYTHON_USEDEP}] |
| 30 |
>=dev-python/voluptuous-0.9.3[${PYTHON_USEDEP}]" |
| 31 |
DEPEND="dev-python/setuptools[${PYTHON_USEDEP}] |
| 32 |
dev-python/sphinx[${PYTHON_USEDEP}] |
| 33 |
>=dev-python/pyyaml-3.10[${PYTHON_USEDEP}] |
| 34 |
test? ( ${RDEPEND} |
| 35 |
|| ( virtual/jre:1.8 virtual/jre:1.7 ) |
| 36 |
dev-python/mock[${PYTHON_USEDEP}] |
| 37 |
dev-python/nose[${PYTHON_USEDEP}] |
| 38 |
dev-python/coverage[${PYTHON_USEDEP}] |
| 39 |
dev-python/nosexcover[${PYTHON_USEDEP}] |
| 40 |
dev-python/six[${PYTHON_USEDEP}] )" |
| 41 |
|
| 42 |
S="${WORKDIR}/${MY_PN}-${PV}" |
| 43 |
|
| 44 |
python_test() { |
| 45 |
ES="${WORKDIR}/elasticsearch-${ES_VERSION}" |
| 46 |
ES_PORT="25123" |
| 47 |
ES_INSTANCE="gentoo-es-curator-test" |
| 48 |
ES_LOG="${ES}/logs/${ES_INSTANCE}.log" |
| 49 |
PID="${ES}/elasticsearch.pid" |
| 50 |
|
| 51 |
# run Elasticsearch instance on custom port |
| 52 |
sed -i "s/#http.port: 9200/http.port: ${ES_PORT}/g; \ |
| 53 |
s/#cluster.name: my-application/cluster.name: ${ES_INSTANCE}/g" \ |
| 54 |
"${ES}/config/elasticsearch.yml" || die |
| 55 |
|
| 56 |
# start local instance of elasticsearch |
| 57 |
"${ES}/bin/elasticsearch" -d -p "${PID}" -Edefault.path.repo=/ || die |
| 58 |
|
| 59 |
local i |
| 60 |
for i in {1..15}; do |
| 61 |
grep -q "started" "${ES_LOG}" 2> /dev/null |
| 62 |
if [[ $? -eq 0 ]]; then |
| 63 |
einfo "Elasticsearch started" |
| 64 |
eend 0 |
| 65 |
break |
| 66 |
elif grep -q 'BindException\[Address already in use\]' "${ES_LOG}" 2>/dev/null; then |
| 67 |
eend 1 |
| 68 |
eerror "Elasticsearch already running" |
| 69 |
die "Cannot start Elasticsearch for tests" |
| 70 |
else |
| 71 |
einfo "Waiting for Elasticsearch" |
| 72 |
eend 1 |
| 73 |
sleep 2 |
| 74 |
continue |
| 75 |
fi |
| 76 |
done |
| 77 |
|
| 78 |
export TEST_ES_SERVER="localhost:${ES_PORT}" |
| 79 |
esetup.py test || die |
| 80 |
|
| 81 |
pkill -F ${PID} |
| 82 |
} |
| 83 |
|
| 84 |
python_prepare_all() { |
| 85 |
# avoid downloading from net |
| 86 |
sed -e '/^intersphinx_mapping/,+3d' -i docs/conf.py || die |
| 87 |
|
| 88 |
# remove test TestCLIFixFor687 as it is only to be run on older versions |
| 89 |
# and the call to curator.get_version(global_client) sometimes |
| 90 |
# fails with Connection refused |
| 91 |
sed -e '122,205d' -i test/integration/test_delete_indices.py || die |
| 92 |
|
| 93 |
distutils-r1_python_prepare_all |
| 94 |
} |
| 95 |
|
| 96 |
python_compile_all() { |
| 97 |
cd docs || die |
| 98 |
emake man $(usex doc html "") |
| 99 |
} |
| 100 |
|
| 101 |
python_install_all() { |
| 102 |
use doc && local HTML_DOCS=( docs/_build/html/. ) |
| 103 |
doman docs/_build/man/* |
| 104 |
distutils-r1_python_install_all |
| 105 |
} |
| 106 |
|
| 107 |
pkg_postinst() { |
| 108 |
ewarn "" |
| 109 |
ewarn "For Python 3 support information please read: http://click.pocoo.org/3/python3/" |
| 110 |
ewarn "" |
| 111 |
ewarn "Example usage on Python 3:" |
| 112 |
ewarn "export LC_ALL=en_US.UTF-8" |
| 113 |
ewarn "export LANG=en_US.UTF-8" |
| 114 |
ewarn "curator ..." |
| 115 |
} |
| 1 |
dev-python/elasticsearch-curator/Manifest | 1 - |
116 |
dev-python/elasticsearch-curator/Manifest | 1 - |
| 2 |
.../elasticsearch-curator-4.0.6.ebuild | 113 --------------------- |
117 |
.../elasticsearch-curator-4.0.6.ebuild | 113 --------------------- |
| 3 |
2 files changed, 114 deletions(-) |
118 |
2 files changed, 114 deletions(-) |
| 4 |
delete mode 100644 dev-python/elasticsearch-curator/elasticsearch-curator-4.0.6.ebuild |
119 |
delete mode 100644 dev-python/elasticsearch-curator/elasticsearch-curator-4.0.6.ebuild |