summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jolly <Matt.Jolly@footclan.ninja>2023-05-14 22:35:34 +1000
committerSam James <sam@gentoo.org>2023-05-17 02:33:41 +0100
commit879b3ee9db2936791e7764634582ea47674c4b2c (patch)
tree79f78379b44f7a94598c7fa15803e689fdcf98ba /app-misc
parentapp-arch/createrepo_c: drop 0.20.1-r1 (diff)
downloadgentoo-879b3ee9db2936791e7764634582ea47674c4b2c.tar.gz
gentoo-879b3ee9db2936791e7764634582ea47674c4b2c.tar.bz2
gentoo-879b3ee9db2936791e7764634582ea47674c4b2c.zip
app-misc/elasticsearch: add 8.7.1
Signed-off-by: Matt Jolly <Matt.Jolly@footclan.ninja> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/elasticsearch/Manifest1
-rw-r--r--app-misc/elasticsearch/elasticsearch-8.7.1.ebuild102
2 files changed, 103 insertions, 0 deletions
diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
index 278ab9d5c2fb..d27ff167f481 100644
--- a/app-misc/elasticsearch/Manifest
+++ b/app-misc/elasticsearch/Manifest
@@ -1,2 +1,3 @@
DIST elasticsearch-7.17.9-no-jdk-linux-x86_64.tar.gz 167832902 BLAKE2B 9d0134fe397a5153da4936b5ac083c677a676d1a208f65a85c2c8db82cf0588d1180aeb039ed28c13161ff8fcf5bc11b0fc099f9f21d6da08e50fe0bb7f83565 SHA512 e2c6094377ed2ada0650864b7c30386467b920770b93e6f19d1448635f7f2024fbaebd619ba683ed4c1b5dc8e67f2396183d81598a5e610ca2879ea3cd8dba32
DIST elasticsearch-8.6.2-linux-x86_64.tar.gz 581745209 BLAKE2B c5d76e8fd2b7b28d50a0b81950c5d824f5000d3239efef9c3312e153829f09d98ba1394dceff2f147c29e2cd24be2ea4aaf0e0dc830e51989b87c8c7b48e3b3c SHA512 4c5ea98af53861d6c7f06f855f3bd4f4f52136d8149347e43f633a23ba56d3237f6ff7346bf849090f4e52b28fc21c98df8d9b0f0f845a330834367705cd366a
+DIST elasticsearch-8.7.1-linux-x86_64.tar.gz 597973777 BLAKE2B 6328c11c33ea1e067c6c19afb09a7f5a39fc1cd44dd9c2b51253cf15d847463a5f0311d29785aeddab64ee00fd949a5a8f91f86794e70e4ff22c1bfb9094f29c SHA512 40216fff8f6f827164bda1ecbdcbdc30f202ef9cb8a936c60e52f16a0b6c1bfbdc884fe11d8bbebd8336507aa8ed2f0202b3b61f876d17f4a97ee9fc21f9e3be
diff --git a/app-misc/elasticsearch/elasticsearch-8.7.1.ebuild b/app-misc/elasticsearch/elasticsearch-8.7.1.ebuild
new file mode 100644
index 000000000000..30abfdf800ac
--- /dev/null
+++ b/app-misc/elasticsearch/elasticsearch-8.7.1.ebuild
@@ -0,0 +1,102 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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}-linux-x86_64.tar.gz"
+
+LICENSE="Apache-2.0 BSD-2 Elastic-2.0 LGPL-3 MIT public-domain"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="acct-group/elasticsearch
+ acct-user/elasticsearch"
+RDEPEND="acct-group/elasticsearch
+ acct-user/elasticsearch
+ sys-libs/zlib
+ virtual/jre:17"
+
+QA_PREBUILT="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
+QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-env.patch"
+)
+
+src_prepare() {
+ default
+
+ rm -rf jdk || die
+ sed -i -e "s:logs/:${EPREFIX}/var/log/${PN}/:g" config/jvm.options || die "Unable to set Elasticsearch log location"
+ # elasticsearch-env sets the envvar for the config location if not specified elsewhere;
+ # certain utilities try and source this. Although we patch ES_JAVA_HOME for Gentoo slightly earlier,
+ # it's easier to respect EPREFIX for the config location using sed.
+ sed -i "s:ES_PATH_CONF=\"\$ES_HOME\"/config:ES_PATH_CONF=\"${EPREFIX}/etc/${PN}\":" bin/elasticsearch-env \
+ || die "Unable to set Elasticsearch config directory"
+ 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 -R root:${PN} /etc/${PN}
+ fperms -R 2750 /etc/${PN}
+
+ insinto /usr/share/${PN}
+ doins -r .
+
+ keepdir /usr/share/${PN}/plugins
+
+ 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}
+
+ 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.4 ${PN}.service
+
+ newtmpfiles "${FILESDIR}"/${PN}.tmpfiles.d ${PN}.conf
+}
+
+pkg_postinst() {
+ # Elasticsearch will choke on our keep file and dodir will not preserve the empty dir
+ local KEEPFILE
+ KEEPFILE=$(find "${EROOT}/usr/share/${PN}/plugins/" -type f -name '.keep*')
+ rm "${KEEPFILE}" || die
+ tmpfiles_process /usr/lib/tmpfiles.d/${PN}.conf
+ if ! systemd_is_booted ; then
+ 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
+ fi
+ ewarn "Please make sure you have proper permissions on /etc/${PN}"
+ ewarn "prior to keystore generation or you may experience startup failures."
+ ewarn "chown root:${PN} /etc/${PN} && chmod 2750 /etc/${PN}"
+ ewarn "chown root:${PN} /etc/${PN}/${PN}.keystore && chmod 0660 /etc/${PN}/${PN}.keystore"
+}