diff options
author | Tomas Mozes <hydrapolic@gmail.com> | 2019-04-19 20:42:38 +0000 |
---|---|---|
committer | Manuel Rüger <mrueg@gentoo.org> | 2019-04-25 14:00:15 +0200 |
commit | 8b07ac17061c70d9a1c6df61d97fb0856ece72ce (patch) | |
tree | bf69b3cfe6b2389c6fd9d6bddeb6acc3380efa39 /app-misc/elasticsearch | |
parent | app-misc/elasticsearch: bump to 6.7.1 (diff) | |
download | gentoo-8b07ac17061c70d9a1c6df61d97fb0856ece72ce.tar.gz gentoo-8b07ac17061c70d9a1c6df61d97fb0856ece72ce.tar.bz2 gentoo-8b07ac17061c70d9a1c6df61d97fb0856ece72ce.zip |
app-misc/elasticsearch: bump to 7.0.0
Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
Signed-off-by: Manuel Rüger <mrueg@gentoo.org>
Diffstat (limited to 'app-misc/elasticsearch')
-rw-r--r-- | app-misc/elasticsearch/Manifest | 2 | ||||
-rw-r--r-- | app-misc/elasticsearch/elasticsearch-7.0.0.ebuild | 91 | ||||
-rw-r--r-- | app-misc/elasticsearch/files/elasticsearch.init.6 | 69 |
3 files changed, 162 insertions, 0 deletions
diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest index aa6f687ec432..46e8bcb6b0f0 100644 --- a/app-misc/elasticsearch/Manifest +++ b/app-misc/elasticsearch/Manifest @@ -1,5 +1,7 @@ DIST elasticsearch-5.6.16.tar.gz 33894983 BLAKE2B f96e78f1f28d8106948c91a0d31ea3d41b538fb0fd8534e2f52be651cf22986c76eae67c58c8ef10fef218d1646b1b4b5aa0a3625520e62e482063420775e92e SHA512 cc831e50ce311366484c47cf9fead9bd6562035132e6fd29508e78776dd71846c713d8d1e7a0a99338df46cad124149fb5d767e0ae0bbbed0b50153e234f2631 DIST elasticsearch-6.6.1.tar.gz 114126547 BLAKE2B b335b224af0c241cbdf83f81feec103274d9cdd9ee7f9c3c5a788cbfc4d7a24b3a345aa14853e378796f733c151f7f21b5b081b2071b56f40f0f068ef6b07939 SHA512 3f8619ae6a10a34c57d8bc0c2ba3851b79a494ea05a3d02119a6e12d2c6cb6a651e73b43adfd674b7fb16664b709b643d4be9ba0785dbcc6d7a7cc41da7b669f DIST elasticsearch-6.7.1.tar.gz 148542786 BLAKE2B 4a9acd16788e6d84acfac09ee2434135fdef85d0bec5baa873f7bfd7cb6d340932d6b67b13a8f5095dc04d1981a029ab7f87d90c2b4a796eb198e9b8c531db9d SHA512 dcd3a6beae8b4a2322144058871074f193974565341da5703ec991947c2749ee67e87202e937148f653594f5fd33fdbb8adc891a200d4e03d8363575992eb9ec +DIST elasticsearch-7.0.0-no-jdk-linux-x86_64.tar.gz 149074223 BLAKE2B 3c210b81de8882f99be45adc811c3867acb276978d3c788db5cb00ec0eacd0f096933849dfa066160ca2ec05e3fa2962329b200614db9927e4424602da53508f SHA512 b499aeab6a3f883547974b36221fd808a9da70ae0622856582287dcf729c3a2acfb1faef2727b17be97f64d8bb56ac5cdbae6d63f2a146027153f170ae6d91fc DIST elasticsearch-oss-6.6.1.tar.gz 34492424 BLAKE2B 9a63aeb86ec3bebbe685804b262316726cb93b42693f9ba8937cac65c7ec186f0bb470893568234a0b7cc8b58f0c91d2af94eb16c3d016e7533231eba32fdbb0 SHA512 0e536ff760673dd740f790f1b0c01d984bf989a4a9ad3c4fe998de4f824330ce0d5ea18f04421a8648af719aabd25a4393f90182079186e48cef539b5621914c DIST elasticsearch-oss-6.7.1.tar.gz 68421385 BLAKE2B cf14f3babfc5dbe9de4c9e47c15b797ab7c73236936257043c435751a0d86348e34ee73d2a6785a9e1391edc1e00f9a56f922c368ef72a5d349175ee4735d43b SHA512 4865ebd3403593048b3f922769d6d09eb1d53a42cf206cdcba7c30e330b39d9bd57f9f0979a23fcf0ca7636d84ce85de210fdf655447fab7ecebb35bffdd3323 +DIST elasticsearch-oss-7.0.0-no-jdk-linux-x86_64.tar.gz 68788144 BLAKE2B 29206b277dc9997b155b54217f485c314a7efa35777bcb81908ce900e134e62d7ef14629cfeebcd3ebb724b76fe5380085ae6b50df46bdfddf5f657a0d2da3eb SHA512 ec9381d9310145b80fb2b8cdd7b7953ea7b2b45a66bf8435d8a982aed0eeb59f734f3936b4b40ec4530e106878d25c2f63d4ea7a734b12f1c8d86b39f7894963 diff --git a/app-misc/elasticsearch/elasticsearch-7.0.0.ebuild b/app-misc/elasticsearch/elasticsearch-7.0.0.ebuild new file mode 100644 index 000000000000..1d757551fca1 --- /dev/null +++ b/app-misc/elasticsearch/elasticsearch-7.0.0.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit systemd user + +DESCRIPTION="Open Source, Distributed, RESTful, Search Engine" +HOMEPAGE="https://www.elastic.co/products/elasticsearch" +SRC_URI="x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${P}-no-jdk-linux-x86_64.tar.gz ) + !x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${PN}-oss-${PV}-no-jdk-linux-x86_64.tar.gz )" +LICENSE="Apache-2.0 BSD-2 LGPL-3 MIT public-domain x-pack? ( Elastic )" +SLOT="0" +KEYWORDS="~amd64" +IUSE="x-pack" + +RDEPEND="virtual/jre" + +QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN} +} + +src_prepare() { + default + + rm LICENSE.txt NOTICE.txt || die + rmdir logs || die + + if use x-pack; then + rm bin/x-pack/*.bat || die + rm -r modules/x-pack-ml/platform/{darwin,windows}-x86_64 || die + fi +} + +src_install() { + keepdir /etc/${PN} + keepdir /etc/${PN}/scripts + + insinto /etc/${PN} + doins -r config/. + rm -r config || die + + fowners root:${PN} /etc/${PN} + fperms 2750 /etc/${PN} + + insinto /usr/share/${PN} + doins -r . + + exeinto /usr/share/${PN}/bin + doexe "${FILESDIR}/elasticsearch-systemd-pre-exec" + + chmod +x "${ED}"/usr/share/${PN}/bin/* || die + + if use x-pack; then + chmod +x "${ED}"/usr/share/${PN}/modules/x-pack-ml/platform/linux-x86_64/bin/* || die + fi + + keepdir /var/{lib,log}/${PN} + fowners ${PN}:${PN} /var/{lib,log}/${PN} + fperms 0750 /var/{lib,log}/${PN} + dodir /usr/share/${PN}/plugins + + insinto /etc/sysctl.d + newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf + + newconfd "${FILESDIR}/${PN}.conf.3" ${PN} + newinitd "${FILESDIR}/${PN}.init.6" ${PN} + + systemd_install_serviced "${FILESDIR}/${PN}.service.conf" + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" ${PN}.conf + systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service +} + +pkg_postinst() { + elog + elog "You may create multiple instances of ${PN} by" + elog "symlinking the init script:" + elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance" + elog + elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts" + elog "from /etc/${PN} into the configuration directory of the instance:" + elog "/etc/${PN}/instance" + elog + ewarn "Please make sure you have proper permissions on /etc/${PN}" + ewarn "prior to keystore generation or you may experience startup fails." + ewarn "chown root:${PN} /etc/${PN} && chmod 2750 /etc/${PN}" + ewarn "chown root:${PN} /etc/${PN}/${PN}.keystore && chmod 0660 /etc/${PN}/${PN}.keystore" +} diff --git a/app-misc/elasticsearch/files/elasticsearch.init.6 b/app-misc/elasticsearch/files/elasticsearch.init.6 new file mode 100644 index 000000000000..046941d407e5 --- /dev/null +++ b/app-misc/elasticsearch/files/elasticsearch.init.6 @@ -0,0 +1,69 @@ +#!/sbin/openrc-run + +name="Elasticsearch" +description="Elasticsearch Server" + +ES_INSTANCE=${RC_SVCNAME#*.} + +if [ -n "${ES_INSTANCE}" ] && [ ${RC_SVCNAME} != "elasticsearch" ]; then + ES_BASE_PATH="/var/lib/elasticsearch/${ES_INSTANCE}" + CONF_DIR="/etc/elasticsearch/${ES_INSTANCE}" + DEFAULT_LOG_DIR="/var/log/elasticsearch/${ES_INSTANCE}" +else + ES_BASE_PATH="/var/lib/elasticsearch/_default" + CONF_DIR="/etc/elasticsearch" + DEFAULT_LOG_DIR="/var/log/elasticsearch/_default" +fi + +ES_HOME=${ES_HOME:="/usr/share/elasticsearch"} +ES_USER=${ES_USER:="elasticsearch"} +ES_GROUP=${ES_GROUP:="elasticsearch"} +ES_STARTUP_SLEEP_TIME=${ES_STARTUP_TIME:=5} +JAVA_HOME=${JAVA_HOME:=$(java-config -g JAVA_HOME)} +MAX_OPEN_FILES=${MAX_OPEN_FILES:=65536} +MAX_MAP_COUNT=${MAX_MAP_COUNT:=262144} + +DATA_DIR=${DATA_DIR:="${ES_BASE_PATH}/data"} +LOG_DIR=${LOG_DIR:="${DEFAULT_LOG_DIR}"} + +if [ -f "${CONF_DIR}/elasticsearch.in.sh" ]; then + ES_INCLUDE="${CONF_DIR}/elasticsearch.in.sh" +fi + +export ES_INCLUDE +export JAVA_HOME +export JAVA_OPTS +export ES_JVM_OPTIONS +export ES_JAVA_OPTS +export ES_STARTUP_SLEEP_TIME +export ES_PATH_CONF="${CONF_DIR}" + +pidfile="/run/elasticsearch/${RC_SVCNAME}.pid" + +command="/usr/share/elasticsearch/bin/elasticsearch" +command_args="-Epath.logs=${LOG_DIR} -Epath.data=${DATA_DIR}" +command_args_background="--daemonize --pidfile=${pidfile}" +command_user="${ES_USER}:${ES_GROUP}" +required_files="${CONF_DIR}/elasticsearch.yml" +retry="TERM/30/KILL/30" + +depend() { + use net +} + +start_pre() { + if [ -n "${MAX_MAP_COUNT}" -a -f /proc/sys/vm/max_map_count ]; then + sysctl -q -w vm.max_map_count=${MAX_MAP_COUNT} + fi + + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/lib/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/log/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/run/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${ES_BASE_PATH}" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${LOG_DIR}" + + # fails to start without keystore + if [ ! -f "${CONF_DIR}/elasticsearch.keystore" ]; then + "${ES_HOME}/bin/elasticsearch-keystore" create + fi +} |