commit:     a7916854c100fca4b8142677c0f514882404ff12
Author:     Matt Jolly <Matt.Jolly <AT> footclan <DOT> ninja>
AuthorDate: Fri Feb 10 23:11:48 2023 +0000
Commit:     John Helmert III <ajak <AT> gentoo <DOT> org>
CommitDate: Mon Feb 20 23:52:14 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7916854

app-misc/elasticsearch: add 8.6.2

- add ES_PATH_CONF default in src_prepare
- respect EPREFIX for log location

Signed-off-by: Matt Jolly <Matt.Jolly <AT> footclan.ninja>
Signed-off-by: John Helmert III <ajak <AT> gentoo.org>

 app-misc/elasticsearch/Manifest                   |   1 +
 app-misc/elasticsearch/elasticsearch-8.6.2.ebuild | 102 ++++++++++++++++++++++
 2 files changed, 103 insertions(+)

diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
index b2e201628269..94ba2d768a68 100644
--- a/app-misc/elasticsearch/Manifest
+++ b/app-misc/elasticsearch/Manifest
@@ -1,3 +1,4 @@
 DIST elasticsearch-7.17.7-no-jdk-linux-x86_64.tar.gz 167491953 BLAKE2B 
dec416ed84d47f95e72d415f6200b0573ef4adfe833753b87f8a2e927561344ea949a1fe2f51d0c8bbd97463d68734542388051904bc631b5f690ce37540a83f
 SHA512 
9a9c8ad4b31a3d9b8c560bbb97f03dc4809fb4c993dbcf99835847896e35caa46309a50e17e86bb56ed00312fba2f79ed064ab422b968488bd619e294f845c5b
 DIST elasticsearch-7.17.8-no-jdk-linux-x86_64.tar.gz 167420965 BLAKE2B 
f0a03372bb42a327c720e4b3d875f867cbc64a6df2874a7c6acf67dc8ace6d660dce4a64117f33a47e3e856b6f7aae31c50f42fca5da4f193beb1ae25401f8d4
 SHA512 
904e049ba42335fe979f055b586d616f04e269caa16ffe285e8e30df31971aa9739b334d7471e19afd477103b541e8400a91aeecc4df7825d246c361ccdad29b
 DIST elasticsearch-8.5.2-linux-x86_64.tar.gz 580694330 BLAKE2B 
9d8fab39fc413cea59500bf5d4aec080c4fb49e58852af4a7f552d03b7e1f31402286900c680ecdc62553b4662f652f9e6a961a7102f80a2fb8af3e809317ab5
 SHA512 
c5069264de265b5405d56cc811d7b32278196ca4c1a9326306f449b19af072a9f75f2ceb0b63c2a8dd4803cdf63b484cac5885ef8d9cb1b8d83332128f34a075
+DIST elasticsearch-8.6.2-linux-x86_64.tar.gz 581745209 BLAKE2B 
c5d76e8fd2b7b28d50a0b81950c5d824f5000d3239efef9c3312e153829f09d98ba1394dceff2f147c29e2cd24be2ea4aaf0e0dc830e51989b87c8c7b48e3b3c
 SHA512 
4c5ea98af53861d6c7f06f855f3bd4f4f52136d8149347e43f633a23ba56d3237f6ff7346bf849090f4e52b28fc21c98df8d9b0f0f845a330834367705cd366a

diff --git a/app-misc/elasticsearch/elasticsearch-8.6.2.ebuild 
b/app-misc/elasticsearch/elasticsearch-8.6.2.ebuild
new file mode 100644
index 000000000000..30abfdf800ac
--- /dev/null
+++ b/app-misc/elasticsearch/elasticsearch-8.6.2.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"
+}

Reply via email to