summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2014-10-06 14:36:29 +0000
committerTony Vroon <chainsaw@gentoo.org>2014-10-06 14:36:29 +0000
commitcbc9b0ea9ccac043f2b79cf63cf7d1ffbd4cd673 (patch)
tree0e71047e531ae45f5e208599a335f86fec794066 /app-misc/elasticsearch
parentRevision bumps at straight to stable to remove non-distributable icons from w... (diff)
downloadhistorical-cbc9b0ea9ccac043f2b79cf63cf7d1ffbd4cd673.tar.gz
historical-cbc9b0ea9ccac043f2b79cf63cf7d1ffbd4cd673.tar.bz2
historical-cbc9b0ea9ccac043f2b79cf63cf7d1ffbd4cd673.zip
Much improved init script, systemd service file and user configuration respect after a refactoring by Ferenc Erki. His work closes bug #523236 and #523238.
Package-Manager: portage-2.2.14_rc1/cvs/Linux x86_64 Manifest-Sign-Key: 0xB5058F9A
Diffstat (limited to 'app-misc/elasticsearch')
-rw-r--r--app-misc/elasticsearch/ChangeLog10
-rw-r--r--app-misc/elasticsearch/Manifest11
-rw-r--r--app-misc/elasticsearch/elasticsearch-1.3.2-r1.ebuild83
-rw-r--r--app-misc/elasticsearch/files/elasticsearch.init387
-rw-r--r--app-misc/elasticsearch/files/elasticsearch.service211
5 files changed, 197 insertions, 5 deletions
diff --git a/app-misc/elasticsearch/ChangeLog b/app-misc/elasticsearch/ChangeLog
index a593f2812570..6f6abe835008 100644
--- a/app-misc/elasticsearch/ChangeLog
+++ b/app-misc/elasticsearch/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for app-misc/elasticsearch
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/elasticsearch/ChangeLog,v 1.6 2014/09/18 10:36:19 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/elasticsearch/ChangeLog,v 1.7 2014/10/06 14:36:26 chainsaw Exp $
+
+*elasticsearch-1.3.2-r1 (06 Oct 2014)
+
+ 06 Oct 2014; Tony Vroon <chainsaw@gentoo.org> +elasticsearch-1.3.2-r1.ebuild,
+ +files/elasticsearch.init3, +files/elasticsearch.service2:
+ Much improved init script, systemd service file and user configuration
+ respect after a refactoring by Ferenc Erki. His work closes bug #523236 and
+ #523238.
18 Sep 2014; Tony Vroon <chainsaw@gentoo.org> elasticsearch-1.3.2.ebuild:
Version the JRE dependency as only Java 7 is acceptable. As suggested by
diff --git a/app-misc/elasticsearch/Manifest b/app-misc/elasticsearch/Manifest
index 185ddcce99ab..5087bd92f321 100644
--- a/app-misc/elasticsearch/Manifest
+++ b/app-misc/elasticsearch/Manifest
@@ -4,15 +4,18 @@ Hash: SHA256
AUX elasticsearch.conf 428 SHA256 cabfe972ef28b30d152c022e4a0510f6ce940687a452b8dfb21c060a14af7860 SHA512 f61a75394776a9c2cac5b4dcfcaee03531808546a360a04e28d83f9bde5804bb9ffa305d3b49679a3fafdaa8c060ecbf88486ed1cdd4072af10e287e599d834d WHIRLPOOL 5fb0590f1264b3a3c1bba759c426edc72f2e2d1c2198c9d67c81a4c73b90ba123b052e8b8aea21be920a1c795b6222a592d37949ac705e81d3493dad9ce6d5b4
AUX elasticsearch.init 2276 SHA256 bc3941c26bd98f148b757200fad3bdd68776ebf0bdb4844b47a02ef82c2384fa SHA512 5d8cb832420fc2484dcb18f98adbb1359b7129b26485bd557c7ef3260ff38ca6a7064a07f91d4824cc045046b6eedd49f19001bcaf9ff6b409b810d0e723f97c WHIRLPOOL 994c63d4026e0288e42993bb8e7eca62c383c6854e96ca4f2e5f7fa41c8b83f7822f696c9cb2f37c696862fec77cca3ca511c5669a2de9267b168c14401c18bd
AUX elasticsearch.init2 2296 SHA256 a2abd2f6423ebc382a130b6264114d2e4b28d1ec705939f6ccc818bb7a86b491 SHA512 2439482409908774e02726f81bcf8c9d80d0c3e00c468e4ae95dbb7ae9035fd27ae47aa08b1a705ba808a5222b95b37189b1e9ab7ec89797b9f90db572b5f89f WHIRLPOOL 37a1866079dbc0ec6624b2da2da2914752d76d02ebb4764d209a716ac90f1b29014be9930ba6b5999f513b6357c9088d24db3c2b14c763e792dc1c63d2f9fe34
+AUX elasticsearch.init3 2319 SHA256 cb00de8eb5d6f3ddfe48fed1fe20b527900ad79984e24c2c12b61c3aacad2732 SHA512 903b4014541d2793b70c0520c1e901ddc7fca133897b1b3c772859dffe16ec804fa89e254edc0c52800f8d0c929ba32cfadab359575bc76fe197679fe10b9e02 WHIRLPOOL 25465dfb52b2d8cfd3ad502470b43edabc086ac731d78b2e86043bae54c7926e73cc5d0ec54c036090a9f27cc1ac56e5e2942d1821e3063a72daf7e7df35a797
AUX elasticsearch.service 274 SHA256 d8581135cb5f6b73245e571f0cd3cfa85c90d96474304214324958b9ee952f7e SHA512 14c0696ab1244e4afde34c0f6aaececbb5a80a75dc9ad23841adefde815c8c9a604858902bd87609d8191dfca7c4eb24f1ad2d041d50d22a789296bf43366a76 WHIRLPOOL 8df4eb48efac8353c21685bc17bd30ce8835f9f5f91f19acd3f69a42a780c69fc118f74d003429e1da9558ffad1a1e649c57521ba8219fcb262a2ffdb2e24e9c
+AUX elasticsearch.service2 279 SHA256 2a827cfa6331652e5a34bb975da52fec6d12ce0a80eacf810f62e22c5272349b SHA512 17994b7a5b0ef883034765d2b0e5c29daccb1e122b956f598d0c2b24085a0e66450fa143e3c656d75bf149a53ca497bc8c747b62ba47743aad17ae1a446d6d7d WHIRLPOOL 0c97253da7f75586c135568036f149f2465a1d73f5cb6e67b45a36832c2f54b61b0bcfd60db122c7e1ea6e7595e379dfe49a7e7bbad596840da6158a7d56dc46
DIST elasticsearch-1.3.2.tar.gz 27949096 SHA256 7525d0a4db4f7eb791a1f8da97b081a5d8b44a2b232d8324877177bdee992ea4 SHA512 4a67531cf9927db466f70b4c572c472913533352de586f7e2c5f84ec9c7337002a0de0ee2bdb809e99b954bb8bd7d207baf723f1b53b2949702f838c85d6380a WHIRLPOOL 3b3edfefa6e49b2271ed107ecc8d2a84ab3db6834f85eb90c33fc8f9dfff4a815cbd2f3d7af2e6f6a9edfd2186508f6308bdee3846405cebf4ab89e8d13f0ffd
+EBUILD elasticsearch-1.3.2-r1.ebuild 2173 SHA256 83b59820c8feee36243f0e4cee25047c643688d0323a8d138526cd416f0d3fd4 SHA512 1352fb3877e1e9eb229a98f8dd82fb8d1a4970e46b957e0322b3911b180bff667dc0f0419e2fbd92d1f62bda5a68deb4538d360de7e1ead81b363f44020e4d5c WHIRLPOOL c9ba4efb97b721147f0c107745b7b2b4c3c49fd3a3af8f9aa8fa93974147b0b4005b6ec57ff49067f4a9df9fc9d2c233a681bc58dec7de5dc30e01cc56429d0c
EBUILD elasticsearch-1.3.2.ebuild 2235 SHA256 b8956c61c89178db91d61d8c9a166c3058dcf3f3be50250941009bf1babe3b3f SHA512 567fbcbdf2669ef33b42c29b1774265573b855205d383f99acd47fa7926b91d93521d08c73acf21e721128e1ab1fa20a170fed53c3bd33504615c3a71ff181f7 WHIRLPOOL 0c19433233ce1bb45b94b57a6dbba9a4e99970cbfe329931e8ca06f680d2240654c16f1a274c2a00112de70aa1bc2fea31391fafdde2ea6a822b42a91a684728
-MISC ChangeLog 1782 SHA256 9135c5426a9770be04f3720663236e3f49357b19cab29b56e5ff16248e5fe050 SHA512 26474853d741962930802a17d1594dc54bb9c1a74587c3c1a48233906262ee07e84079bb795f21e66e1a37c77d714ed854b21951f771a4cbcd129798d711face WHIRLPOOL e80cab1f7c1179f481017399271bd3172f75cff5751d2dfd39cbe2b8caa6746ba529d25769389e4258123abcba0e5a040800f20e343abeb8ffddd72b54bba72a
+MISC ChangeLog 2125 SHA256 6019125a19c0d37338d4da4c442fbe6cfaa95a05de49f4380c260026272b8e6b SHA512 7baf8a1b2a6052a64d54c6cb91f5df431346d8cfcf90298393acf604b7be5ed10c97878687ce2b5d10d680ae63dcd0dd53acba6066000c742133b95e58467f0a WHIRLPOOL c69e8c0d5b47d6f40b8a6c3381d756ab0a45c16ce3883b649912b5366adc239dcfb7fb3b9e4fd22d61f586cff3455edc7611267ca7d73b97fe27f33d85bd2eab
MISC metadata.xml 237 SHA256 88d9092fd208599a8b524cca9633d9330223e45c34a44e54b2de05edb4738ac7 SHA512 11773ab2b5adaa81f3c8f73413d2f257ea1d1624df689154ee2697412ff14ea8f9851b805c4a474b486abb0a066cfc929f91eb852a208b9536885d467df36af1 WHIRLPOOL 324b778d3103d615af41fd6d1d978beeeeb08f4823a3c81fd453464b4df2ed59b56a481ddd65b4eb740dc75b4dc69133e761199abe6d27333b1fce97d5b5a1be
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-iEYEAREIAAYFAlQatbEACgkQp5vW4rUFj5oq/gCggWZQMfSbKJMFS877ZnLWnzNO
-POIAmQEswn9WrARq6vdq/4XFXgx68BGv
-=/BIK
+iEYEAREIAAYFAlQyqOsACgkQp5vW4rUFj5p9nACfThkZZIgkRYPl8fKyQV9M52Qk
+dJIAnii2d87iG+Pc00eumi5quqkPJd9X
+=/BGO
-----END PGP SIGNATURE-----
diff --git a/app-misc/elasticsearch/elasticsearch-1.3.2-r1.ebuild b/app-misc/elasticsearch/elasticsearch-1.3.2-r1.ebuild
new file mode 100644
index 000000000000..9d6609ec0830
--- /dev/null
+++ b/app-misc/elasticsearch/elasticsearch-1.3.2-r1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/elasticsearch/elasticsearch-1.3.2-r1.ebuild,v 1.1 2014/10/06 14:36:26 chainsaw Exp $
+
+EAPI=5
+
+inherit eutils systemd user
+
+MY_PN="${PN%-bin}"
+DESCRIPTION="Open Source, Distributed, RESTful, Search Engine"
+HOMEPAGE="http://www.elasticsearch.org/"
+SRC_URI="http://download.${MY_PN}.org/${MY_PN}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RESTRICT="strip"
+QA_PREBUILT="usr/share/elasticsearch/lib/sigar/libsigar-*.so"
+
+RDEPEND="virtual/jre:1.7"
+
+pkg_setup() {
+ enewgroup ${MY_PN}
+ enewuser ${MY_PN} -1 /bin/bash /var/lib/${MY_PN} ${MY_PN}
+}
+
+src_prepare() {
+ rm -rf lib/sigar/*{solaris,winnt,freebsd,macosx}*
+ rm lib/sigar/libsigar-ia64-linux.so
+ rm LICENSE.txt
+
+ use amd64 && {
+ rm lib/sigar/libsigar-x86-linux.so
+ }
+
+ use x86 && {
+ rm lib/sigar/libsigar-amd64-linux.so
+ }
+}
+
+src_install() {
+ dodir /etc/${MY_PN}
+
+ insinto /usr/share/doc/${P}/examples
+ doins bin/${MY_PN}.in.sh
+ doins config/*
+ rm bin/${MY_PN}.in.sh
+ rm -rf config
+
+ insinto /usr/share/${MY_PN}
+ doins -r ./*
+ chmod +x "${D}"/usr/share/${MY_PN}/bin/*
+
+ keepdir /var/{lib,log}/${MY_PN}
+
+ local rcscript=elasticsearch.init3
+ local eshome="/usr/share/${MY_PN}"
+ local jarfile="${MY_PN}-${PV}.jar"
+ local esclasspath="${eshome}/lib/${jarfile}:${eshome}/lib/*:${eshome}/lib/sigar/*"
+
+ cp "${FILESDIR}/${rcscript}" "${T}" || die
+ sed -i \
+ -e "s|@ES_CLASS_PATH@|${esclasspath}|" \
+ "${T}/${rcscript}" \
+ || die "failed to filter ${rcscript}"
+
+ newinitd "${T}/${rcscript}" "${MY_PN}"
+ newconfd "${FILESDIR}/${MY_PN}.conf" "${MY_PN}"
+ systemd_newunit "${FILESDIR}"/${PN}.service2 "${PN}.service"
+}
+
+pkg_postinst() {
+ elog
+ elog "You may create multiple instances of ${MY_PN} by"
+ elog "symlinking the init script:"
+ elog "ln -sf /etc/init.d/${MY_PN} /etc/init.d/${MY_PN}.instance"
+ elog
+ elog "Each of the example files in /usr/share/doc/${P}/examples"
+ elog "should be extracted to the proper configuration directory:"
+ elog "/etc/${MY_PN} (for standard init)"
+ elog "/etc/${MY_PN}/instance (for symlinked init)"
+ elog
+}
diff --git a/app-misc/elasticsearch/files/elasticsearch.init3 b/app-misc/elasticsearch/files/elasticsearch.init3
new file mode 100644
index 000000000000..cb3806e2b0a5
--- /dev/null
+++ b/app-misc/elasticsearch/files/elasticsearch.init3
@@ -0,0 +1,87 @@
+#!/sbin/runscript
+
+name="Elasticsearch"
+description=""
+
+ES_USER=${ES_USER:="elasticsearch"}
+ES_INSTANCE=${SVCNAME#*.}
+export ES_CLASSPATH="@ES_CLASS_PATH@"
+
+if [ -n "${ES_INSTANCE}" ] && [ ${SVCNAME} != "elasticsearch" ]; then
+ PIDFILE="/run/elasticsearch/elasticsearch.${ES_INSTANCE}.pid"
+ ES_BASE_PATH="/var/lib/elasticsearch/${ES_INSTANCE}"
+ ES_CONF_PATH="/etc/elasticsearch/${ES_INSTANCE}"
+ ES_LOG_PATH="/var/log/elasticsearch/${ES_INSTANCE}"
+else
+ PIDFILE="/run/elasticsearch/elasticsearch.pid"
+ ES_BASE_PATH="/var/lib/elasticsearch/_default"
+ ES_CONF_PATH="/etc/elasticsearch"
+ ES_LOG_PATH="/var/log/elasticsearch/_default"
+fi
+
+ES_DATA_PATH="${ES_BASE_PATH}/data"
+ES_WORK_PATH="${ES_BASE_PATH}/work"
+
+export ES_INCLUDE="${ES_CONF_PATH}/elasticsearch.in.sh"
+export JAVA_OPTS
+export ES_JAVA_OPTS
+export ES_HEAP_SIZE
+export ES_HEAP_NEWSIZE
+export ES_DIRECT_SIZE
+export ES_USE_IPV4
+
+server_command="/usr/share/elasticsearch/bin/elasticsearch"
+server_args=" -p ${PIDFILE} -Des.default.path.conf=\"${ES_CONF_PATH}\" -Des.default.path.data=\"${ES_DATA_PATH}\" -Des.default.path.work=\"${ES_WORK_PATH}\" -Des.default.path.logs=\"${ES_LOG_PATH}\""
+
+depend() {
+ use net
+}
+
+start() {
+ # elasticsearch -Des.config=/path/to/config/file
+ # elasticsearch -Des.network.host=10.0.0.4
+
+ [ ! -f "${ES_INCLUDE}" ] && {
+ eerror "${ES_INCLUDE} must be copied into place"
+ return 1
+ }
+
+ local conf
+ local conf_file
+ for conf in elasticsearch.yml logging.yml; do
+ conf_file="${ES_CONF_PATH}/${conf}"
+ if [ ! -f "${conf_file}" ]; then
+ eerror "${conf_file} must be copied into place"
+ return 1
+ fi
+ done
+
+ ebegin "Starting ${SVCNAME}"
+
+ if [ -n "${ES_MAX_FD}" ]; then
+ ulimit -n ${ES_MAX_FD}
+ einfo "Max open filedescriptors : ${ES_MAX_FD}"
+ fi
+
+
+ checkpath -d -o "${ES_USER}" -m750 "/var/lib/elasticsearch"
+ checkpath -d -o "${ES_USER}" -m750 "/var/log/elasticsearch"
+ checkpath -d -o "${ES_USER}" -m750 "$(dirname "${PIDFILE}")"
+ checkpath -d -o "${ES_USER}" -m750 "${ES_BASE_PATH}"
+ checkpath -d -o "${ES_USER}" -m750 "${ES_LOG_PATH}"
+
+ start-stop-daemon --start \
+ --background \
+ --chdir "${ES_BASE_PATH}" \
+ --user="${ES_USER}" \
+ --pidfile="${PIDFILE}" \
+ --exec ${server_command} -- ${server_args}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop \
+ --pidfile=${PIDFILE}
+ eend $?
+}
diff --git a/app-misc/elasticsearch/files/elasticsearch.service2 b/app-misc/elasticsearch/files/elasticsearch.service2
new file mode 100644
index 000000000000..afdcfdf5d6f4
--- /dev/null
+++ b/app-misc/elasticsearch/files/elasticsearch.service2
@@ -0,0 +1,11 @@
+[Unit]
+Description=Elasticsearch
+After=network.target
+
+[Service]
+User=elasticsearch
+Environment=ES_INCLUDE=/etc/elasticsearch/elasticsearch.in.sh
+ExecStart=/usr/share/elasticsearch/bin/elasticsearch -Des.default.path.conf=/etc/elasticsearch
+
+[Install]
+WantedBy=multi-user.target