commit:     5bfe905782c1f33eab23dc3c7537e4ef9ab8406b
Author:     Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Mar  4 13:49:56 2025 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Mar  4 13:50:30 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5bfe9057

app-misc/elasticsearch: add 8.17.3

Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 app-misc/elasticsearch/Manifest                    |   1 +
 app-misc/elasticsearch/elasticsearch-8.17.3.ebuild | 109 +++++++++++++++++++++
 2 files changed, 110 insertions(+)

diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
index 1e5e79d6175b..d0446b76a375 100644
--- a/app-misc/elasticsearch/Manifest
+++ b/app-misc/elasticsearch/Manifest
@@ -1,2 +1,3 @@
 DIST elasticsearch-7.17.25-no-jdk-linux-x86_64.tar.gz 173127285 BLAKE2B 
c68b7fdd84c860c04eff7aad75fadf20ab97a9baef606a1a3c9cfa195f7d39591b9a35884f180a9509bdc4a04a68bc8ceba8d9ead03c1d5b684d85597ad9eb23
 SHA512 
dc0c68f2ee87d6445bd28ed60e3d615eefc106b0d28f648af01cf79a639661769d958fe3da04e20e81437e4a0385e3788fe785b494ce5320fba0f074d2c1ea49
 DIST elasticsearch-8.15.1-linux-x86_64.tar.gz 605974468 BLAKE2B 
8fc2476cd2629cf8bcd9c2183763aba1880f76357809f661da9c3df6538bdf7bc21e897356cb4e35084ef1333120539e494893177fffe0aaa1e7ea4cc3f52fcd
 SHA512 
3eced0f59446f60170b7ab3372f58bbda713e2166bb936ef0f74a027e579565b469d3f8888715638e6dfc3e98f88e1b73f7de8a6fc37be236ade4a099f9cc808
+DIST elasticsearch-8.17.3-linux-x86_64.tar.gz 636275047 BLAKE2B 
61ede1d0e51bdfcde0b9f11c3416034adc62e80d3000be2ecd239be1c1674c2df947d4940b6a4b2f2ea5a2e69a3398541cf10c2a98d40cd8dd56063c57fcf153
 SHA512 
6aef4fc84ebbfc98e6662418c734ea89cae8e53a8d6c1fbd5352807bc427e040e62be568b502abdceb7a2f57534eae60e31712d0583d3752fd39b7b8a3632d3b

diff --git a/app-misc/elasticsearch/elasticsearch-8.17.3.ebuild 
b/app-misc/elasticsearch/elasticsearch-8.17.3.ebuild
new file mode 100644
index 000000000000..cc04359b9e63
--- /dev/null
+++ b/app-misc/elasticsearch/elasticsearch-8.17.3.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2025 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/8"
+KEYWORDS="~amd64"
+
+DEPEND="acct-group/elasticsearch
+       acct-user/elasticsearch"
+RDEPEND="acct-group/elasticsearch
+       acct-user/elasticsearch
+       sys-libs/zlib
+       virtual/jre:17"
+
+QA_FLAGS_IGNORED="usr/share/elasticsearch/lib/platform/linux-x64/*.so"
+QA_PREBUILT="
+       usr/share/elasticsearch/lib/platform/linux-x64/*.so
+       
usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*
+"
+QA_PRESTRIPPED="
+       usr/share/elasticsearch/lib/platform/linux-x64/*.so
+       
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"
+}

Reply via email to