summaryrefslogtreecommitdiff
blob: 67397a8cf20b644160da9e25793177e76a9f40ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

DESCRIPTION="A distributed, open source search and analytics engine."
HOMEPAGE="https://www.elastic.co/products/elasticsearch"
SRC_URI="https://download.elasticsearch.org/elasticsearch/elasticsearch/${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~ia64 ~x86"
IUSE=""

# We can't use virtual/jdk-1.7.0 because not all java implementations are supported
DEPEND=""
RDEPEND="
	|| (
		=dev-java/icedtea-bin-7*
		=dev-java/icedtea-7*
		=dev-java/oracle-jdk-bin-1.7.0*
	)"

src_install() {
	dodoc README.textile
	rm -f LICENSE.txt  NOTICE.txt README.textile

	# Remove non-linux files
	rm -f bin/*{bat,exe}
	rm -f lib/sigar/*{freebsd,macosx,solaris,sparc,winnt}*
	use amd64 || rm lib/sigar/*amd64*
	use ia64 || rm lib/sigar/*ia64*
	use x86 || rm lib/sigar/*x86*

	mkdir -p "${D}"/opt
	mv "${WORKDIR}/${P}" "${D}"/opt

	dosym /opt/"${P}"/bin/"${PN}" /usr/bin/"${PN}"
	dosym /opt/"${P}"/config /etc/"${PN}"

	newinitd "${FILESDIR}"/"${PN}".initd ${PN}
}