Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/elasticsearch/
Date: Fri, 26 Aug 2022 07:45:02
Message-Id: 1661499886.14b9197a91502563cb479671392145532adc2ccd.sam@gentoo
1 commit: 14b9197a91502563cb479671392145532adc2ccd
2 Author: Matt Jolly <Matt.Jolly <AT> footclan <DOT> ninja>
3 AuthorDate: Wed Aug 17 10:12:27 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 26 07:44:46 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14b9197a
7
8 app-misc/elasticsearch: add 8.3.3
9
10 Signed-off-by: Matt Jolly <Matt.Jolly <AT> footclan.ninja>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 app-misc/elasticsearch/Manifest | 1 +
14 app-misc/elasticsearch/elasticsearch-8.3.3.ebuild | 95 +++++++++++++++++++++++
15 2 files changed, 96 insertions(+)
16
17 diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
18 index a055ca0c19d4..f5c1c4f77b92 100644
19 --- a/app-misc/elasticsearch/Manifest
20 +++ b/app-misc/elasticsearch/Manifest
21 @@ -1,2 +1,3 @@
22 DIST elasticsearch-7.17.5-no-jdk-linux-x86_64.tar.gz 167410729 BLAKE2B c6e68176705a1ae2c72a945b2a2b7542f2cb6ebc2420fb52cf26cafdc3045c6f82a5f707062d48142875bf1fbc4be65e473ed9515d65ec25d5a460cc2af991e9 SHA512 d8bc819c9ac5a9035d08e45abf8464275cc2cad7c2f091a3e112100ffbd2605759543e111d9e44c3352f92a08230287c2cba6a91f07ab3d92513682e56b97184
23 DIST elasticsearch-8.2.2-linux-x86_64.tar.gz 526116807 BLAKE2B bc30d3532bb62bee88fdfc8e3406d32884add3601363d5bf91f66c110e05241beb6b73cf7a2f8104a843628f4841a313ed5bdf3098030eb5e4567c98b69ac703 SHA512 78d1315a47ae9f082297e049320c5a9787aa9fe44cd2967f3ea37ae954ad34aaa29ca7b3210ac96955be2838d0233b7f86a3e0c66d82dda3724753a0c24c78e8
24 +DIST elasticsearch-8.3.3-linux-x86_64.tar.gz 539315339 BLAKE2B be786e3a05eb8399cdd168d71edb901ffb08bc6f8a564aebbb8b578fbd628a142c36b2ced540801a60b4d962c48f6be426ae27a0fd4dfb5a99bb022d4fa271b5 SHA512 dca98fc78d55e58cfb48a9abe9276f10d7f104b3a60cc8c6850b093fb12342a7f3f379530476324bf97dc69d68511bb1de97e0aa7bb9aa3e27808dc656305b5f
25
26 diff --git a/app-misc/elasticsearch/elasticsearch-8.3.3.ebuild b/app-misc/elasticsearch/elasticsearch-8.3.3.ebuild
27 new file mode 100644
28 index 000000000000..74c42298df8a
29 --- /dev/null
30 +++ b/app-misc/elasticsearch/elasticsearch-8.3.3.ebuild
31 @@ -0,0 +1,95 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +inherit systemd tmpfiles
38 +
39 +DESCRIPTION="Free and Open, Distributed, RESTful Search Engine"
40 +HOMEPAGE="https://www.elastic.co/elasticsearch/"
41 +SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}-linux-x86_64.tar.gz"
42 +
43 +LICENSE="Apache-2.0 BSD-2 Elastic-2.0 LGPL-3 MIT public-domain"
44 +SLOT="0"
45 +KEYWORDS="~amd64"
46 +
47 +DEPEND="acct-group/elasticsearch
48 + acct-user/elasticsearch"
49 +RDEPEND="acct-group/elasticsearch
50 + acct-user/elasticsearch
51 + sys-libs/zlib
52 + virtual/jre:17"
53 +
54 +QA_PREBUILT="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
55 +QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
56 +
57 +PATCHES=(
58 + "${FILESDIR}/${PN}-env.patch"
59 +)
60 +
61 +src_prepare() {
62 + default
63 +
64 + rm -rf jdk || die
65 + sed -i -e "s:logs/:/var/log/${PN}/:g" config/jvm.options || die
66 + rm LICENSE.txt NOTICE.txt || die
67 + rmdir logs || die
68 +}
69 +
70 +src_install() {
71 + keepdir /etc/${PN}
72 + keepdir /etc/${PN}/scripts
73 +
74 + insinto /etc/${PN}
75 + doins -r config/.
76 + rm -r config || die
77 +
78 + fowners -R root:${PN} /etc/${PN}
79 + fperms -R 2750 /etc/${PN}
80 +
81 + insinto /usr/share/${PN}
82 + doins -r .
83 +
84 + keepdir /usr/share/${PN}/plugins
85 +
86 + exeinto /usr/share/${PN}/bin
87 + doexe "${FILESDIR}"/elasticsearch-systemd-pre-exec
88 +
89 + fperms -R +x /usr/share/${PN}/bin
90 + fperms -R +x /usr/share/${PN}/modules/x-pack-ml/platform/linux-x86_64/bin
91 +
92 + keepdir /var/{lib,log}/${PN}
93 + fowners ${PN}:${PN} /var/{lib,log}/${PN}
94 + fperms 0750 /var/{lib,log}/${PN}
95 +
96 + insinto /etc/sysctl.d
97 + newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf
98 +
99 + newconfd "${FILESDIR}/${PN}.conf.4" ${PN}
100 + newinitd "${FILESDIR}/${PN}.init.8" ${PN}
101 +
102 + systemd_install_serviced "${FILESDIR}/${PN}.service.conf"
103 + systemd_newunit "${FILESDIR}"/${PN}.service.4 ${PN}.service
104 +
105 + newtmpfiles "${FILESDIR}"/${PN}.tmpfiles.d ${PN}.conf
106 +}
107 +
108 +pkg_postinst() {
109 + # Elasticsearch will choke on our keep file and dodir will not preserve the empty dir
110 + rm /usr/share/${PN}/plugins/.keep* || die
111 + tmpfiles_process /usr/lib/tmpfiles.d/${PN}.conf
112 + if ! systemd_is_booted ; then
113 + elog "You may create multiple instances of ${PN} by"
114 + elog "symlinking the init script:"
115 + elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance"
116 + elog
117 + elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts"
118 + elog "from /etc/${PN} into the configuration directory of the instance:"
119 + elog "/etc/${PN}/instance"
120 + elog
121 + fi
122 + ewarn "Please make sure you have proper permissions on /etc/${PN}"
123 + ewarn "prior to keystore generation or you may experience startup failures."
124 + ewarn "chown root:${PN} /etc/${PN} && chmod 2750 /etc/${PN}"
125 + ewarn "chown root:${PN} /etc/${PN}/${PN}.keystore && chmod 0660 /etc/${PN}/${PN}.keystore"
126 +}