From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 403FC139694 for ; Thu, 16 Mar 2017 14:34:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B40D821C094; Thu, 16 Mar 2017 14:34:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7B09A21C094 for ; Thu, 16 Mar 2017 14:34:14 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 632D1340E75 for ; Thu, 16 Mar 2017 14:34:13 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D3BF36A43 for ; Thu, 16 Mar 2017 14:34:11 +0000 (UTC) From: "Amy Liffey" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Amy Liffey" Message-ID: <1489674825.3a752b9a08b0a3db157c85100a1a23e4c4d895d1.amynka@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-misc/elasticsearch/files/, app-misc/elasticsearch/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-misc/elasticsearch/Manifest app-misc/elasticsearch/elasticsearch-5.2.2.ebuild app-misc/elasticsearch/files/elasticsearch.init8 X-VCS-Directories: app-misc/elasticsearch/ app-misc/elasticsearch/files/ X-VCS-Committer: amynka X-VCS-Committer-Name: Amy Liffey X-VCS-Revision: 3a752b9a08b0a3db157c85100a1a23e4c4d895d1 X-VCS-Branch: master Date: Thu, 16 Mar 2017 14:34:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 486205e5-7586-48ac-8212-67399978fda9 X-Archives-Hash: d8dc76c1354822e6d6921d74a37ae3b0 commit: 3a752b9a08b0a3db157c85100a1a23e4c4d895d1 Author: Tomas Mozes gmail com> AuthorDate: Fri Mar 10 14:10:56 2017 +0000 Commit: Amy Liffey gentoo org> CommitDate: Thu Mar 16 14:33:45 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a752b9a app-misc/elasticsearch: bump to 5.2.2 Closes: #4195 Package-Manager: Portage-2.3.3, Repoman-2.3.1 app-misc/elasticsearch/Manifest | 1 + app-misc/elasticsearch/elasticsearch-5.2.2.ebuild | 70 +++++++++++++++++ app-misc/elasticsearch/files/elasticsearch.init8 | 95 +++++++++++++++++++++++ 3 files changed, 166 insertions(+) diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest index f12537168d8..82a178c779e 100644 --- a/app-misc/elasticsearch/Manifest +++ b/app-misc/elasticsearch/Manifest @@ -1,2 +1,3 @@ DIST elasticsearch-2.4.4.tar.gz 27343272 SHA256 981092e6ca65ba5560b8b97a74e5ed0eb2236e9128efdb85bb652cec340158e2 SHA512 899a4d2fc64548bcd488ece223f5f189dfb191eceb36390c4b9d8d0d90ef9d2cb67ada475223b9b2e0bd0fb521a4ab978bc7f60781195927e36d027925338c14 WHIRLPOOL 1a90bb8c923a9eab6cc4390b3daaa44cd85d5c1a3a1a5ef7d274050eb25b061a11a91b0f57ebe9f3cb27aafee3267af8f63ca87837f79d622ff362fbc5b6ae1a DIST elasticsearch-5.1.2.tar.gz 33299777 SHA256 74d752f9a8b46898d306ad169b72f328e17215c0909149e156a576089ef11c42 SHA512 1867626e8a87f11ed109e1325fd1d16c9e0af06ebe6a30c78ea679ab533ab377f5da8ea55af6871be33af226f02187a2aadd77e5e23c097dd24055be21e9d691 WHIRLPOOL 2e9df71c915343e2cc8ad82c59b877f41f5e093cbeba21f471c32cb51a195eccc6223bc48da48bb4af2e6bea9f2539f2e93b866963148f4ca2940ba4466e614e +DIST elasticsearch-5.2.2.tar.gz 33799732 SHA256 cf88930695794a8949342d386f028548bd10b26ecc8c4b422a94ea674faf8ac9 SHA512 670f8aa81a34191a13cc8c608a9dc7bec60c63bbed8fdb9bc0619585d644867576a7677eb0f14b4e4d064e59def186d4b431930bf79b54bcbf59a29b0b327e85 WHIRLPOOL 4ec1f3b5ed15b9f22d27512ea784ffe9e32e00808fec89418860955d2f4759d045775e18c0a61693da47f39de9f235de954eada231fbd6de5fbfd17f552e8452 diff --git a/app-misc/elasticsearch/elasticsearch-5.2.2.ebuild b/app-misc/elasticsearch/elasticsearch-5.2.2.ebuild new file mode 100644 index 00000000000..ba141a646d4 --- /dev/null +++ b/app-misc/elasticsearch/elasticsearch-5.2.2.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils systemd user + +DESCRIPTION="Open Source, Distributed, RESTful, Search Engine" +HOMEPAGE="https://www.elastic.co/products/elasticsearch" +SRC_URI="https://artifacts.elastic.co/downloads/${PN}/${P}.tar.gz" +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" + +RESTRICT="strip" + +RDEPEND="virtual/jre:1.8" + +pkg_setup() { + enewgroup ${PN} + enewuser ${PN} -1 /bin/bash /usr/share/${PN} ${PN} +} + +src_prepare() { + rm -rf bin/*.{bat,exe} || die + rm LICENSE.txt || die + + default +} + +src_install() { + keepdir /etc/${PN} + keepdir /etc/${PN}/scripts + + insinto /etc/${PN} + doins config/* + rm -rf config || die + + insinto /usr/share/${PN} + doins -r ./* + + exeinto /usr/share/${PN}/bin + doexe "${FILESDIR}/elasticsearch-systemd-pre-exec" + + chmod +x "${D}"/usr/share/${PN}/bin/* || die + + keepdir /var/{lib,log}/${PN} + keepdir /usr/share/${PN}/plugins + + systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d" "${PN}.conf" + + insinto /etc/sysctl.d + newins "${FILESDIR}/${PN}.sysctl.d" "${PN}.conf" + + newinitd "${FILESDIR}/${PN}.init8" "${PN}" + newconfd "${FILESDIR}/${PN}.conf3" "${PN}" + systemd_newunit "${FILESDIR}"/${PN}.service6 "${PN}.service" +} + +pkg_postinst() { + elog + 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/elasticsearch into the configuration directory of the instance:" + elog "/etc/${PN}/instance" + elog +} diff --git a/app-misc/elasticsearch/files/elasticsearch.init8 b/app-misc/elasticsearch/files/elasticsearch.init8 new file mode 100644 index 00000000000..a9200d58ca0 --- /dev/null +++ b/app-misc/elasticsearch/files/elasticsearch.init8 @@ -0,0 +1,95 @@ +#!/sbin/openrc-run + +name="Elasticsearch" +description="Elasticsearch Server" + +ES_INSTANCE=${SVCNAME#*.} +PID_DIR=${PID_DIR:="/run/elasticsearch"} + +if [ -n "${ES_INSTANCE}" ] && [ ${SVCNAME} != "elasticsearch" ]; then + PIDFILE="${PID_DIR}/elasticsearch.${ES_INSTANCE}.pid" + ES_BASE_PATH="/var/lib/elasticsearch/${ES_INSTANCE}" + CONF_DIR="/etc/elasticsearch/${ES_INSTANCE}" + LOG_DIR="/var/log/elasticsearch/${ES_INSTANCE}" +else + PIDFILE="${PID_DIR}/elasticsearch.pid" + ES_BASE_PATH="/var/lib/elasticsearch/_default" + CONF_DIR="/etc/elasticsearch" + LOG_DIR="/var/log/elasticsearch/_default" +fi + +ES_HOME=${ES_HOME:="/usr/share/elasticsearch"} +ES_USER=${ES_USER:="elasticsearch"} +ES_GROUP=${ES_GROUP:="elasticsearch"} +ES_STARTUP_SLEEP_TIME=${ES_STARTUP_TIME:=5} +MAX_OPEN_FILES=${MAX_OPEN_FILES:=65536} +MAX_MAP_COUNT=${MAX_MAP_COUNT:=262144} + +DATA_DIR=${DATA_DIR:="${ES_BASE_PATH}/data"} + +if [ -f "${CONF_DIR}/elasticsearch.in.sh" ]; then + ES_INCLUDE="${CONF_DIR}/elasticsearch.in.sh" +fi + +export ES_INCLUDE +export JAVA_HOME +export JAVA_OPTS +export ES_JVM_OPTIONS +export ES_JAVA_OPTS +export ES_STARTUP_SLEEP_TIME + +server_command="/usr/share/elasticsearch/bin/elasticsearch" +server_args="-d -p ${PIDFILE} -Edefault.path.logs=${LOG_DIR} -Edefault.path.data=${DATA_DIR} -Edefault.path.conf=${CONF_DIR}" + +depend() { + use net +} + +start() { + local conf + local conf_file + for conf in elasticsearch.yml; do + conf_file="${CONF_DIR}/${conf}" + if [ ! -f "${conf_file}" ]; then + eerror "${conf_file} must be copied into place" + return 1 + fi + done + + if [ -n "${MAX_MAP_COUNT}" -a -f /proc/sys/vm/max_map_count ]; then + sysctl -q -w vm.max_map_count=${MAX_MAP_COUNT} + fi + + ebegin "Starting ${SVCNAME}" + + if [ -n "${MAX_LOCKED_MEMORY}" ]; then + ulimit -l "${MAX_LOCKED_MEMORY}" + fi + + if [ -n "${MAX_OPEN_FILES}" ]; then + ulimit -n "${MAX_OPEN_FILES}" + fi + + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/lib/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "/var/log/elasticsearch" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${PID_DIR}" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${ES_BASE_PATH}" + checkpath -d -o "${ES_USER}:${ES_GROUP}" -m750 "${LOG_DIR}" + + start-stop-daemon --start \ + --background \ + --chdir "${ES_HOME}" \ + --user="${ES_USER}" \ + --pidfile="${PIDFILE}" \ + --exec ${server_command} -- ${server_args} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop \ + --pidfile=${PIDFILE} \ + --user="${ES_USER}" \ + --retry=TERM/20 + eend $? +}