Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/elasticsearch/, app-misc/elasticsearch/files/
Date: Wed, 31 Jul 2019 00:50:42
Message-Id: 1564534161.1e4a23a801b0236689bc4663b8d5712a29422791.gyakovlev@gentoo
1 commit: 1e4a23a801b0236689bc4663b8d5712a29422791
2 Author: Tomas Mozes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Tue Jul 30 22:13:50 2019 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Wed Jul 31 00:49:21 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e4a23a8
7
8 app-misc/elasticsearch: bump to 7.2.1
9
10 Closes: https://bugs.gentoo.org/689394
11 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
12 Closes: https://github.com/gentoo/gentoo/pull/12584
13 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
14
15 app-misc/elasticsearch/Manifest | 2 +
16 app-misc/elasticsearch/elasticsearch-7.2.1.ebuild | 86 +++++++++++++++++++++++
17 app-misc/elasticsearch/files/elasticsearch.init.7 | 71 +++++++++++++++++++
18 3 files changed, 159 insertions(+)
19
20 diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
21 index 974b7bc0b06..7b76142d351 100644
22 --- a/app-misc/elasticsearch/Manifest
23 +++ b/app-misc/elasticsearch/Manifest
24 @@ -4,8 +4,10 @@ DIST elasticsearch-6.7.1.tar.gz 148542786 BLAKE2B 4a9acd16788e6d84acfac09ee24341
25 DIST elasticsearch-6.8.1.tar.gz 148584086 BLAKE2B dacc3fdf142fc46ede2a5891f95f69a1200632c46b57eb03f948437a39ef92538da7d3e64afd52c4acae478e6758b355729f8cbf8ceb91aa3d34353ff434fed4 SHA512 1d484287e9b67b16c28f1a4d2267e7ceb5a4438a18b26b3a46d4a176bb3f2f6fcadcbda617a7a91418293880d38c027266cb81a4e8893a28adee9fa693b2318b
26 DIST elasticsearch-7.0.0-no-jdk-linux-x86_64.tar.gz 149074223 BLAKE2B 3c210b81de8882f99be45adc811c3867acb276978d3c788db5cb00ec0eacd0f096933849dfa066160ca2ec05e3fa2962329b200614db9927e4424602da53508f SHA512 b499aeab6a3f883547974b36221fd808a9da70ae0622856582287dcf729c3a2acfb1faef2727b17be97f64d8bb56ac5cdbae6d63f2a146027153f170ae6d91fc
27 DIST elasticsearch-7.2.0-no-jdk-linux-x86_64.tar.gz 138948007 BLAKE2B 0e03779669f6113eac1561a3a907d8a3286ac7c7229e0ff7ad46ede4f22a2829f8d2ffafb319427f789fb95cca6669c59f8d840ec83625889bcdd6ada91be1d5 SHA512 b49a6d6b7361c499b1d9a9118746229113eaf4b88c1ad755c1ae8fd713428db4bc296cd75f3df58a239b09d6a8281f670f69c320839ef000596c776141cb1ce6
28 +DIST elasticsearch-7.2.1-no-jdk-linux-x86_64.tar.gz 138949755 BLAKE2B 3c77cec89a93c6b5d213afc326ef84df7d77c052914b387dc4ba35276d8f9814689d5305a131e1c647ece31277533e882b1170ad03eb3869f8443471223db066 SHA512 d2827be0b06361ab08f558dc88f76c614fb6a243a6d845749b3d23dff4078ffa58cc1b3407b84197d0f027ea9af5475fad8e3a503fc573ba31756bdd16a589d9
29 DIST elasticsearch-oss-6.6.1.tar.gz 34492424 BLAKE2B 9a63aeb86ec3bebbe685804b262316726cb93b42693f9ba8937cac65c7ec186f0bb470893568234a0b7cc8b58f0c91d2af94eb16c3d016e7533231eba32fdbb0 SHA512 0e536ff760673dd740f790f1b0c01d984bf989a4a9ad3c4fe998de4f824330ce0d5ea18f04421a8648af719aabd25a4393f90182079186e48cef539b5621914c
30 DIST elasticsearch-oss-6.7.1.tar.gz 68421385 BLAKE2B cf14f3babfc5dbe9de4c9e47c15b797ab7c73236936257043c435751a0d86348e34ee73d2a6785a9e1391edc1e00f9a56f922c368ef72a5d349175ee4735d43b SHA512 4865ebd3403593048b3f922769d6d09eb1d53a42cf206cdcba7c30e330b39d9bd57f9f0979a23fcf0ca7636d84ce85de210fdf655447fab7ecebb35bffdd3323
31 DIST elasticsearch-oss-6.8.1.tar.gz 68419519 BLAKE2B cf34c4cf095b4271d067802df8130d66167e5f01fd0231361ce3e7f5e1023b39e6fbc325cc575f2c353a30b011127934b7b7a04f9a48998f88d27ce8a5560bf4 SHA512 cbcc81b8dd3a7a63c6e6574405417821c5dcd1a0b5df813818d39353fa29ea28e443db64b1a1938a1ffb23aa17d706e3edb6a46fdb24992b92f918d8d4f0c08a
32 DIST elasticsearch-oss-7.0.0-no-jdk-linux-x86_64.tar.gz 68788144 BLAKE2B 29206b277dc9997b155b54217f485c314a7efa35777bcb81908ce900e134e62d7ef14629cfeebcd3ebb724b76fe5380085ae6b50df46bdfddf5f657a0d2da3eb SHA512 ec9381d9310145b80fb2b8cdd7b7953ea7b2b45a66bf8435d8a982aed0eeb59f734f3936b4b40ec4530e106878d25c2f63d4ea7a734b12f1c8d86b39f7894963
33 DIST elasticsearch-oss-7.2.0-no-jdk-linux-x86_64.tar.gz 68964879 BLAKE2B 6bebff074d9a22abaf1a7b669d9a47254a658f4954b2e27d4251860a0b8cd29f4bbc3baf217d7fb90c492d5dabce802b1e4d359531202e677ffcfd573b51b343 SHA512 a538c82dc177a66004912ce20b1b50ee1270e45b56879b4f0b7e2d4bfa00d9fe5c113b5e4927cb6f5669f8a1f2f4953c4bb12dc4a10510af4658bbcbcaba3cbc
34 +DIST elasticsearch-oss-7.2.1-no-jdk-linux-x86_64.tar.gz 68973563 BLAKE2B 5248a5e8443794134c55ef14d1b175ff931d599a45b4cbd0f187e864dd3d4b322f10df31672c0900417e84da0e83fd934234bba31dc116c5c3b6b9f14e9c62a6 SHA512 694aca59cc3e23bfcf41142d7bf3d3c75f6fcdb6d0a1b35157157cb2f4ac8152db1e424951e62ba1a2bd4a2d32a77bb9499085558b7e1580680c0de90fbc0902
35
36 diff --git a/app-misc/elasticsearch/elasticsearch-7.2.1.ebuild b/app-misc/elasticsearch/elasticsearch-7.2.1.ebuild
37 new file mode 100644
38 index 00000000000..37f142d8774
39 --- /dev/null
40 +++ b/app-misc/elasticsearch/elasticsearch-7.2.1.ebuild
41 @@ -0,0 +1,86 @@
42 +# Copyright 1999-2019 Gentoo Authors
43 +# Distributed under the terms of the GNU General Public License v2
44 +
45 +EAPI=7
46 +
47 +inherit systemd user
48 +
49 +DESCRIPTION="Open Source, Distributed, RESTful, Search Engine"
50 +HOMEPAGE="https://www.elastic.co/products/elasticsearch"
51 +SRC_URI="x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${P}-no-jdk-linux-x86_64.tar.gz )
52 + !x-pack? ( https://artifacts.elastic.co/downloads/${PN}/${PN}-oss-${PV}-no-jdk-linux-x86_64.tar.gz )"
53 +LICENSE="Apache-2.0 BSD-2 LGPL-3 MIT public-domain x-pack? ( Elastic )"
54 +SLOT="0"
55 +KEYWORDS="~amd64"
56 +IUSE="x-pack"
57 +
58 +RDEPEND="virtual/jre"
59 +
60 +QA_PRESTRIPPED="usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/\(bin\|lib\)/.*"
61 +
62 +pkg_setup() {
63 + enewgroup ${PN}
64 + enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN}
65 +}
66 +
67 +src_prepare() {
68 + default
69 +
70 + rm LICENSE.txt NOTICE.txt || die
71 + rmdir logs || die
72 +}
73 +
74 +src_install() {
75 + keepdir /etc/${PN}
76 + keepdir /etc/${PN}/scripts
77 +
78 + insinto /etc/${PN}
79 + doins -r config/.
80 + rm -r config || die
81 +
82 + fowners root:${PN} /etc/${PN}
83 + fperms 2750 /etc/${PN}
84 +
85 + insinto /usr/share/${PN}
86 + doins -r .
87 +
88 + exeinto /usr/share/${PN}/bin
89 + doexe "${FILESDIR}/elasticsearch-systemd-pre-exec"
90 +
91 + chmod +x "${ED}"/usr/share/${PN}/bin/* || die
92 +
93 + if use x-pack; then
94 + chmod +x "${ED}"/usr/share/${PN}/modules/x-pack-ml/platform/linux-x86_64/bin/* || die
95 + fi
96 +
97 + keepdir /var/{lib,log}/${PN}
98 + fowners ${PN}:${PN} /var/{lib,log}/${PN}
99 + fperms 0750 /var/{lib,log}/${PN}
100 + dodir /usr/share/${PN}/plugins
101 +
102 + insinto /etc/sysctl.d
103 + newins "${FILESDIR}/${PN}.sysctl.d" ${PN}.conf
104 +
105 + newconfd "${FILESDIR}/${PN}.conf.3" ${PN}
106 + newinitd "${FILESDIR}/${PN}.init.7" ${PN}
107 +
108 + systemd_install_serviced "${FILESDIR}/${PN}.service.conf"
109 + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" ${PN}.conf
110 + systemd_newunit "${FILESDIR}"/${PN}.service.3 ${PN}.service
111 +}
112 +
113 +pkg_postinst() {
114 + elog
115 + elog "You may create multiple instances of ${PN} by"
116 + elog "symlinking the init script:"
117 + elog "ln -sf /etc/init.d/${PN} /etc/init.d/${PN}.instance"
118 + elog
119 + elog "Please make sure you put elasticsearch.yml, log4j2.properties and scripts"
120 + elog "from /etc/${PN} into the configuration directory of the instance:"
121 + elog "/etc/${PN}/instance"
122 + elog
123 + ewarn "Please make sure you have proper permissions on /etc/${PN}"
124 + ewarn "prior to keystore generation or you may experience startup fails."
125 + ewarn "chown root:${PN} /etc/${PN} && chmod 2750 /etc/${PN}"
126 + ewarn "chown root:${PN} /etc/${PN}/${PN}.keystore && chmod 0660 /etc/${PN}/${PN}.keystore"
127 +}
128
129 diff --git a/app-misc/elasticsearch/files/elasticsearch.init.7 b/app-misc/elasticsearch/files/elasticsearch.init.7
130 new file mode 100644
131 index 00000000000..cac781c968d
132 --- /dev/null
133 +++ b/app-misc/elasticsearch/files/elasticsearch.init.7
134 @@ -0,0 +1,71 @@
135 +#!/sbin/openrc-run
136 +
137 +name="Elasticsearch"
138 +description="Elasticsearch Server"
139 +
140 +ES_INSTANCE=${RC_SVCNAME#*.}
141 +
142 +if [ -n "${ES_INSTANCE}" ] && [ ${RC_SVCNAME} != "elasticsearch" ]; then
143 + ES_BASE_PATH="/var/lib/elasticsearch/${ES_INSTANCE}"
144 + CONF_DIR="/etc/elasticsearch/${ES_INSTANCE}"
145 + DEFAULT_LOG_DIR="/var/log/elasticsearch/${ES_INSTANCE}"
146 +else
147 + ES_BASE_PATH="/var/lib/elasticsearch/_default"
148 + CONF_DIR="/etc/elasticsearch"
149 + DEFAULT_LOG_DIR="/var/log/elasticsearch/_default"
150 +fi
151 +
152 +ES_HOME=${ES_HOME:="/usr/share/elasticsearch"}
153 +ES_USER=${ES_USER:="elasticsearch"}
154 +ES_GROUP=${ES_GROUP:="elasticsearch"}
155 +ES_STARTUP_SLEEP_TIME=${ES_STARTUP_TIME:=5}
156 +JAVA_HOME=${JAVA_HOME:=$(java-config -g JAVA_HOME)}
157 +MAX_OPEN_FILES=${MAX_OPEN_FILES:=65536}
158 +MAX_MAP_COUNT=${MAX_MAP_COUNT:=262144}
159 +
160 +DATA_DIR=${DATA_DIR:="${ES_BASE_PATH}/data"}
161 +LOG_DIR=${LOG_DIR:="${DEFAULT_LOG_DIR}"}
162 +
163 +if [ -f "${CONF_DIR}/elasticsearch.in.sh" ]; then
164 + ES_INCLUDE="${CONF_DIR}/elasticsearch.in.sh"
165 +fi
166 +
167 +export ES_INCLUDE
168 +export JAVA_HOME
169 +export JAVA_OPTS
170 +export ES_JVM_OPTIONS
171 +export ES_JAVA_OPTS
172 +export ES_STARTUP_SLEEP_TIME
173 +export ES_PATH_CONF="${CONF_DIR}"
174 +
175 +pidfile="/run/elasticsearch/${RC_SVCNAME}.pid"
176 +
177 +command="/usr/share/elasticsearch/bin/elasticsearch"
178 +command_args="-Epath.logs=${LOG_DIR} -Epath.data=${DATA_DIR}"
179 +command_args_background="--daemonize --pidfile=${pidfile}"
180 +command_user="${ES_USER}:${ES_GROUP}"
181 +required_files="${CONF_DIR}/elasticsearch.yml"
182 +retry="TERM/30/KILL/30"
183 +
184 +depend() {
185 + use net
186 +}
187 +
188 +start_pre() {
189 + if [ -n "${MAX_MAP_COUNT}" -a -f /proc/sys/vm/max_map_count ]; then
190 + sysctl -q -w vm.max_map_count=${MAX_MAP_COUNT}
191 + fi
192 +
193 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/lib/elasticsearch"
194 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/log/elasticsearch"
195 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/run/elasticsearch"
196 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${ES_BASE_PATH}"
197 + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${LOG_DIR}"
198 +
199 + # fails to start without keystore
200 + if [ ! -f "${CONF_DIR}/elasticsearch.keystore" ]; then
201 + "${ES_HOME}/bin/elasticsearch-keystore" create
202 + else
203 + "${ES_HOME}/bin/elasticsearch-keystore" upgrade
204 + fi
205 +}