summaryrefslogtreecommitdiff
blob: 8642162682fba1efe1fd03b035efdd9a10f36029 (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
44
45
46
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="4"

DESCRIPTION="Popular, blazing fast open source enterprise search platform from the Apache Lucene project"
HOMEPAGE="http://lucene.apache.org/solr/"
SRC_URI="http://www.apache.org/dist/lucene/${PN}/${PV}/apache-${P}.tgz"

LICENSE="Apache"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="app-arch/unzip"
RDEPEND="${DEPEND}
	www-servers/jetty-bin"

S="${WORKDIR}/apache-${P}"

SOLR_HOME="/usr/share/solr"

src_install() {
	dodir "${SOLR_HOME}"
	dodir /etc/solr

	unzip dist/apache-"${P}.war" -d "${D}/${SOLR_HOME}" || die
	sed -i -e 's@\.\./\.\./@\./@g' example/solr/conf/solrconfig.xml || die
	rm -rf "${D}/${SOLR_HOME}"/META-INF  || die

	insinto "${SOLR_HOME}"
	doins -r dist
	doins -r contrib
	doins -r example/solr/conf
	doins "${FILESDIR}"/solr.xml

	dosym "${SOLR_HOME}"/conf /etc/solr/conf
	dosym "${SOLR_HOME}"/WEB-INF/web.xml /etc/solr/web.xml

	# jetty env
	insinto /opt/jetty/etc
	doins "${FILESDIR}"/jetty-solr.xml
	dosym "${SOLR_HOME}" /opt/jetty/webapps/solr
	dosym "${SOLR_HOME}"/solr.xml /opt/jetty/etc/solr.xml
}