summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomáš Mózes <hydrapolic@gmail.com>2021-03-25 14:53:18 +0000
committerJoonas Niilola <juippis@gentoo.org>2021-03-30 10:25:19 +0300
commit85494c7240b9621bbda8a7baa97fb1fd9b7d8522 (patch)
tree3536ed36af0d7531c13c4d9a1462da708fd5141f /app-misc
parentlicenses/Elastic-2.0: add license for app-misc/elasticsearch (diff)
downloadgentoo-85494c7240b9621bbda8a7baa97fb1fd9b7d8522.tar.gz
gentoo-85494c7240b9621bbda8a7baa97fb1fd9b7d8522.tar.bz2
gentoo-85494c7240b9621bbda8a7baa97fb1fd9b7d8522.zip
app-misc/elasticsearch: bump to 7.12.0
Bug: https://bugs.gentoo.org/775059 Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/elasticsearch/Manifest1
-rw-r--r--app-misc/elasticsearch/elasticsearch-7.12.0.ebuild81
-rw-r--r--app-misc/elasticsearch/files/elasticsearch.conf.462
-rw-r--r--app-misc/elasticsearch/files/elasticsearch.init.870
4 files changed, 214 insertions, 0 deletions
diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
index 81f9d442334b..427f9d663453 100644
--- a/app-misc/elasticsearch/Manifest
+++ b/app-misc/elasticsearch/Manifest
@@ -1,5 +1,6 @@
DIST elasticsearch-6.8.14.tar.gz 149098495 BLAKE2B f1ccfcd9647a3584594a9db78f92488bc6bd5fe403c9b2cdff9001b87168136817084ce28eb8f14c6e54dd75b88118cf0eb6993e5502e74ecf826938f4c2ff57 SHA512 d7ca05707b9e3d8de19aaebc7811891a82897b2407f3de27ac95b2aad0d6669217c741e14bf768c3ea963977e3fa2ecc2f6d297aeafe985db52f6eb6780912b7
DIST elasticsearch-7.10.2-no-jdk-linux-x86_64.tar.gz 164380146 BLAKE2B 16797ed48c4cb6f91ed891014f275ad86a4852579232df1827413389fc9e505327412729f70783750252190a34b0e0d552ec0b5f25f3d0a811724191eccc6568 SHA512 bd3def00af04670ad04556c911ef8c68b639e1c3b621f36a8973d9700f95873d10bc706a4e3a98f892ac59c1b761d56035a236068d6958af772874e428940dc4
+DIST elasticsearch-7.12.0-no-jdk-linux-x86_64.tar.gz 173069694 BLAKE2B 5de74b1e6de743246cf48e32254f9646fa25c2820d0be9df886fdefe131a302ddb8906546147f0d284e2fc0faf8cc0238bf854fe1611d28bf1e7cb1518bd4e31 SHA512 205aa2a2fa2ab7eb7b54087420e0123aa97e5456e2e1f31cad9ea7b84be3f9823a2a7c47d4cf1697833e5f795359477d3a3b0ea4955a8f92583cf2228071827e
DIST elasticsearch-7.9.3-no-jdk-linux-x86_64.tar.gz 162808745 BLAKE2B e6a12ec3cc3bec0bdf8dd10680dd86214bf619b1abfdfeb8524b0b0f50a0f1faaf03b13f06ab62055f80c7987dd04b0dd9f2beba16dd59a5d346fc6cceb51acd SHA512 fea21591edc790b9d5c48151619921085d1b0e5dad1f8c43efbd44a58babeb8bfad52f4329f1f34c71d47618e24d7320c0e591f8eb65d15c2b9c3e1492d91680
DIST elasticsearch-oss-6.8.14.tar.gz 68236681 BLAKE2B 09c6c23517b880ee1afb1c3472d4518172927c226386c7d0f2f5b9312e7de236bd6fa7d527b949e3cace759af6a1fdfe7d72f1ccf8e2c6e15919c4c8c989ee9e SHA512 c0372969ec9e5f7aff551bc0aa13684fdaccd5a553e8ee896979488ab2f13181642222ab4eca4dc799181bce1405200b5aea4866c830483ce1e484fa6a714998
DIST elasticsearch-oss-7.10.2-no-jdk-linux-x86_64.tar.gz 76383466 BLAKE2B e99c04b0d10ef5755986515c7127ebde00b58e0eba69b6a05e12bd0bffee70266bbb023680584bfe0f321d5a3cf79af89cce3a5191923ad721a9f6039ab82743 SHA512 7b63237996569ccdc7c9d9e7cc097fcb23865396eddac30e5f02543484220d2fc70a7285b430877e5e76a5d8716d9682de9fc40d5e57a08f331e82011fc59756
diff --git a/app-misc/elasticsearch/elasticsearch-7.12.0.ebuild b/app-misc/elasticsearch/elasticsearch-7.12.0.ebuild
new file mode 100644
index 000000000000..1eba30da241b
--- /dev/null
+++ b/app-misc/elasticsearch/elasticsearch-7.12.0.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit systemd tmpfiles
+
+DESCRIPTION="Free and Open, Distributed, RESTful Search Engine"
+HOMEPAGE="https://www.elastic.co/elasticsearch/"
+SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}-no-jdk-linux-x86_64.tar.gz"
+LICENSE="Apache-2.0 BSD-2 Elastic-2.0 LGPL-3 MIT public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="acct-group/elasticsearch
+ acct-user/elasticsearch
+ virtual/jre"
+
+QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
+
+src_prepare() {
+ default
+
+ rm LICENSE.txt NOTICE.txt || die
+ rmdir logs || die
+}
+
+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"
+
+ fperms -R +x /usr/share/${PN}/bin
+ fperms -R +x /usr/share/${PN}/modules/x-pack-ml/platform/linux-x86_64/bin
+
+ 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.4" ${PN}
+ newinitd "${FILESDIR}/${PN}.init.8" ${PN}
+
+ systemd_install_serviced "${FILESDIR}/${PN}.service.conf"
+ systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service
+
+ newtmpfiles "${FILESDIR}"/${PN}.tmpfiles.d ${PN}.conf
+}
+
+pkg_postinst() {
+ tmpfiles_process /usr/lib/tmpfiles.d/${PN}.conf
+
+ 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.conf.4 b/app-misc/elasticsearch/files/elasticsearch.conf.4
new file mode 100644
index 000000000000..a76bc5b7be38
--- /dev/null
+++ b/app-misc/elasticsearch/files/elasticsearch.conf.4
@@ -0,0 +1,62 @@
+################################
+# Elasticsearch
+################################
+
+# Elasticsearch home directory
+#ES_HOME=/usr/share/elasticsearch
+
+# Elasticsearch Java path
+#ES_JAVA_HOME=
+
+# Elasticsearch configuration directory
+#CONF_DIR=/etc/elasticsearch
+
+# Elasticsearch data directory
+#DATA_DIR=/var/lib/elasticsearch
+
+# Elasticsearch logs directory
+#LOG_DIR=/var/log/elasticsearch
+
+# Additional Java OPTS
+#ES_JAVA_OPTS=
+
+################################
+# Elasticsearch service
+################################
+
+# When executing the init script, this user will be used to run the elasticsearch service.
+# The default value is 'elasticsearch' and is declared in the init.d file.
+# Note that this setting is only used by the init script. If changed, make sure that
+# the configured user can read and write into the data, work, plugins and log directories.
+# For systemd service, the user is usually configured in file /usr/lib/systemd/system/elasticsearch.service
+#ES_USER=elasticsearch
+#ES_GROUP=elasticsearch
+
+# The number of seconds to wait before checking if Elasticsearch started successfully as a daemon process
+#ES_STARTUP_SLEEP_TIME=5
+
+################################
+# System properties
+################################
+
+# Specifies the maximum file descriptor number that can be opened by this process
+# When using Systemd, this setting is ignored and the LimitNOFILE defined in
+# /usr/lib/systemd/system/elasticsearch.service takes precedence
+MAX_OPEN_FILES=65536
+
+# The maximum number of bytes of memory that may be locked into RAM
+# Set to "unlimited" if you use the 'bootstrap.memory_lock: true' option
+# in elasticsearch.yml.
+# When using Systemd, the LimitMEMLOCK property must be set
+# in /usr/lib/systemd/system/elasticsearch.service
+MAX_LOCKED_MEMORY=unlimited
+
+# Maximum number of VMA (Virtual Memory Areas) a process can own
+# When using Systemd, this setting is ignored and the 'vm.max_map_count'
+# property is set at boot time in /usr/lib/sysctl.d/elasticsearch.conf
+#MAX_MAP_COUNT=262144
+
+# https://www.elastic.co/guide/en/elasticsearch/reference/master/max-number-of-threads.html
+MAX_THREADS=4096
+
+rc_ulimit="-l $MAX_LOCKED_MEMORY -n $MAX_OPEN_FILES -u $MAX_THREADS"
diff --git a/app-misc/elasticsearch/files/elasticsearch.init.8 b/app-misc/elasticsearch/files/elasticsearch.init.8
new file mode 100644
index 000000000000..e45ece0829b1
--- /dev/null
+++ b/app-misc/elasticsearch/files/elasticsearch.init.8
@@ -0,0 +1,70 @@
+#!/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}
+ES_JAVA_HOME=${ES_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 ES_JAVA_HOME
+export ES_JAVA_OPTS
+export ES_JVM_OPTIONS
+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
+ else
+ "${ES_HOME}/bin/elasticsearch-keystore" upgrade
+ fi
+}