summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2015-08-12 01:03:28 +0100
committerBertrand Jacquin <bertrand@jacquin.bzh>2015-08-15 11:55:17 +0100
commit1b85262b33d2791586546f9c67af3f0926a530d0 (patch)
tree3e6f27e36b759e56dbe5e7554e0cc0512c1ceebb
parentdev-libs/wayland: Version bump (diff)
downloadportage-1b85262b33d2791586546f9c67af3f0926a530d0.tar.xz
dev-db/apache-solr: Popular, blazing fast open source enterprise search platform from the Apache Lucene project
Package-Manager: portage-2.2.20
-rw-r--r--dev-db/apache-solr/ChangeLog6
-rw-r--r--dev-db/apache-solr/Manifest6
-rw-r--r--dev-db/apache-solr/apache-solr-5.2.1.ebuild45
-rw-r--r--dev-db/apache-solr/files/apache-solr.confd21
-rw-r--r--dev-db/apache-solr/files/apache-solr.initd107
-rw-r--r--dev-db/apache-solr/metadata.xml8
-rw-r--r--eclass/java-war.eclass62
-rw-r--r--metadata/md5-cache/dev-db/apache-solr-5.2.113
8 files changed, 268 insertions, 0 deletions
diff --git a/dev-db/apache-solr/ChangeLog b/dev-db/apache-solr/ChangeLog
new file mode 100644
index 00000000..893a269b
--- /dev/null
+++ b/dev-db/apache-solr/ChangeLog
@@ -0,0 +1,6 @@
+*apache-solr-5.2.1 (12 Aug 2015)
+
+ 12 Aug 2015; Bertrand Jacquin <bertrand@jacquin.bzh>
+ +apache-solr-5.2.1.ebuild, +metadata.xml:
+ dev-db/apache-solr: Popular, blazing fast open source enterprise search
+ platform from the Apache Lucene project
diff --git a/dev-db/apache-solr/Manifest b/dev-db/apache-solr/Manifest
new file mode 100644
index 00000000..306a8c95
--- /dev/null
+++ b/dev-db/apache-solr/Manifest
@@ -0,0 +1,6 @@
+AUX apache-solr.confd 413 SHA256 ee3e1004a1815abbb8204415aedadbc6c1419dd44fac5cdec577bfdbf55f8a46 WHIRLPOOL 4683d11c081620686450488039642fa83a1d937c7a7bc9899ec61571056d20121c5c9b41d483278ee86009c952b71e46c0d6c22df6c9c53dd3940b7b7202b169
+AUX apache-solr.initd 3164 SHA256 3d0970c60e3429e4a278c4accfc5d71d97690b92a838d4cefdc2a896f0c5140c WHIRLPOOL 746e58b4863ac53506c9fd743091094b95442e33b272f2314e1a479c28db35579da803998bafcd008a2bc64c32858601371576dd1ecdaec675acace157a49082
+DIST solr-5.2.1.tgz 148849766 SHA256 3f54cec862da1376857f96f4a6f2044a5addcebc4df159b8797fd71f7ba8df86 WHIRLPOOL d95ccefd8af6f2afc7aee9407a67faaae9382d8cf5005d3c21b0b95d5406fc89e955bedee649024d4ebd7a797655f0497fcc8276f2d06e3723424a5d2dc379fa
+EBUILD apache-solr-5.2.1.ebuild 951 SHA256 e783ba233122ccc9c5be2de6066b8e0c5d5dc5465b3a2a1afa76423625dfdd6c WHIRLPOOL 13e8d63e7109449299f6f2875e0a24c03e8f89548efed214e87316736c07f548e3f674caf98bae4dcbc2abc5591dd541fa349565473e07eb4bf169083aebb0a8
+MISC ChangeLog 249 SHA256 ceb50b8e3da21529fa5642909817aa127e886b9710e2d4ed34a373b87c1e0554 WHIRLPOOL 2d416a780040ad33786c953b673c6d5651831a82334304a488890d55044484c04d397dfdf5065a534c17aa1cd07ba57e80258c1c9b7b2de776c31dcf09e6d9a9
+MISC metadata.xml 256 SHA256 6ca43960767ca28661abf97c85263db77fe7643902be2ce777c61aa688d8ea2d WHIRLPOOL cef8582829111be09e651eb819e6d1ea59c9c4386b842169ccd46a14c8e3ccb090486fecd61c5fd4aa47998cacc69cdc1fb5ca6bb6325a4da1ebfd0b6eebda7b
diff --git a/dev-db/apache-solr/apache-solr-5.2.1.ebuild b/dev-db/apache-solr/apache-solr-5.2.1.ebuild
new file mode 100644
index 00000000..2f96e24e
--- /dev/null
+++ b/dev-db/apache-solr/apache-solr-5.2.1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+WEBAPP_NO_AUTO_INSTALL=yes
+WEBAPP_MANUAL_SLOT=yes
+inherit java-war webapp
+
+MY_PN="${PN/apache-}"
+
+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/${MY_PN}/${PV}/${MY_PN}-${PV}.tgz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="examples doc"
+
+RDEPEND="virtual/jre:1.7"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+pkg_setup() {
+ webapp_pkg_setup
+}
+
+src_install() {
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+
+ insinto "/usr/share/${PN}"
+ use examples && doins -r example
+ use doc && doins -r docs
+
+ dodoc CHANGES.txt NOTICE.txt README.txt
+
+ webapp_src_preinst
+
+ insinto "${MY_HOSTROOTDIR}/${PN}"
+ doins -r server
+
+ webapp_src_install
+}
diff --git a/dev-db/apache-solr/files/apache-solr.confd b/dev-db/apache-solr/files/apache-solr.confd
new file mode 100644
index 00000000..b47b3fa6
--- /dev/null
+++ b/dev-db/apache-solr/files/apache-solr.confd
@@ -0,0 +1,21 @@
+# User/Group of this instance
+SOLR_USER=apache
+SOLR_GROUP=apache
+
+# Apache SOLR root directory
+SOLR_HOME=/usr/share/apache-solr
+
+# Apache SOLR server directory
+SOLR_SERVER_DIR=${SOLR_HOME}/server
+
+# Port to listen on
+SOLR_PORT=8983
+
+# Timezone to work with, default is the content of /etc/timezone
+# SOLR_TIMEZONE=UTC
+
+# Options to give to jetty
+JETTY_OPTS="--module=http"
+
+# Java heap memory size
+JAVA_HEAP=512m
diff --git a/dev-db/apache-solr/files/apache-solr.initd b/dev-db/apache-solr/files/apache-solr.initd
new file mode 100644
index 00000000..41b6b79e
--- /dev/null
+++ b/dev-db/apache-solr/files/apache-solr.initd
@@ -0,0 +1,107 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+PIDFILE="/run/${RC_SVCNAME}.pid"
+
+export JAVA_HOME="$(java-config --jre-home)"
+export JAVA="${JAVA_HOME}/bin/java"
+
+: ${SOLR_HOME:=/usr/share/apache-solr}
+: ${SOLR_SERVER_DIR:=${SOLR_HOME}/server}
+: ${SOLR_PORT:=8983}
+: ${SOLR_TIMEZONE:=$(< /etc/timezone)}
+: ${SOLR_LOGDIR:=/var/log/${RC_SVCNAME}}
+
+: ${SOLR_USER:=apache}
+: ${SOLR_GROUP:=apache}
+
+: ${JETTY_HOME:=${SOLR_SERVER_DIR}}
+: ${JETTY_OPTS:="--module=http"}
+
+: ${JAVA_HEAP:=512m}
+
+depend() {
+ use dns logger net
+}
+
+start() {
+ ebegin "Starting ${RC_SVCNAME}"
+
+ if [[ -z "${JAVA_HEAP}" ]] ; then
+ eerror "JAVA_HEAP must be defined."
+ eerror "Please see /etc/conf.d/${RC_SVCNAME} for more information."
+ eend 1
+ fi
+
+ if [[ -z "${SOLR_PORT}" ]] ; then
+ eerror "SOLR_PORT must be defined."
+ eerror "Please see /etc/conf.d/${RC_SVCNAME} for more information."
+ eend 1
+ fi
+
+ JAVA_OPTS="${JAVA_OPTS} -Xms${JAVA_HEAP} -Xmx${JAVA_HEAP}"
+
+ # From bin/solr.in.sh
+ JAVA_OPTS="${JAVA_OPTS} -XX:NewRatio=3"
+ JAVA_OPTS="${JAVA_OPTS} -XX:SurvivorRatio=4"
+ JAVA_OPTS="${JAVA_OPTS} -XX:TargetSurvivorRatio=90"
+ JAVA_OPTS="${JAVA_OPTS} -XX:MaxTenuringThreshold=8"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+UseConcMarkSweepGC"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+UseParNewGC"
+ JAVA_OPTS="${JAVA_OPTS} -XX:ConcGCThreads=4"
+ JAVA_OPTS="${JAVA_OPTS} -XX:ParallelGCThreads=4"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+CMSScavengeBeforeRemark"
+ JAVA_OPTS="${JAVA_OPTS} -XX:PretenureSizeThreshold=64m"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+UseCMSInitiatingOccupancyOnly"
+ JAVA_OPTS="${JAVA_OPTS} -XX:CMSInitiatingOccupancyFraction=50"
+ JAVA_OPTS="${JAVA_OPTS} -XX:CMSMaxAbortablePrecleanTime=6000"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+CMSParallelRemarkEnabled"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+ParallelRefProcEnabled"
+
+ # Specific to java 1.7
+ JAVA_OPTS="${JAVA_OPTS} -XX:CMSFullGCsBeforeCompaction=1"
+ JAVA_OPTS="${JAVA_OPTS} -XX:CMSTriggerPermRatio=80"
+
+
+ JAVA_OPTS="${JAVA_OPTS} -verbose:gc"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+PrintHeapAtGC"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+PrintGCDetails"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+PrintGCDateStamps"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+PrintGCTimeStamps"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+PrintTenuringDistribution"
+ JAVA_OPTS="${JAVA_OPTS} -XX:+PrintGCApplicationStoppedTime"
+ JAVA_OPTS="${JAVA_OPTS} -Xloggc:${SOLR_SERVER_DIR}/logs/solr_gc.log"
+
+ JAVA_OPTS="${JAVA_OPTS} -Djetty.port=${SOLR_PORT}"
+ JAVA_OPTS="${JAVA_OPTS} -Duser.timezone=${SOLR_TIMEZONE}"
+ JAVA_OPTS="${JAVA_OPTS} -Djetty.home=${SOLR_SERVER_DIR}"
+ JAVA_OPTS="${JAVA_OPTS} -Dsolr.solr.home=${SOLR_SERVER_DIR}/solr"
+ JAVA_OPTS="${JAVA_OPTS} -Dsolr.install.dir=/usr/share/apache-solr"
+
+ start-stop-daemon --start \
+ --quiet --background \
+ --chdir "${SOLR_SERVER_DIR}" \
+ --user "${SOLR_USER}:${SOLR_GROUP}" \
+ --make-pidfile --pidfile "${PIDFILE}" \
+ --exec "${JAVA_HOME}/bin/java" \
+ -- \
+ -server \
+ -Xss256k \
+ ${JAVA_OPTS} \
+ -jar "${SOLR_SERVER_DIR}/start.jar" \
+ ${JETTY_OPTS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${RC_SVCNAME}"
+
+ start-stop-daemon --stop \
+ --quiet --retry=60 \
+ --pidfile ${PIDFILE} \
+
+ eend $?
+}
diff --git a/dev-db/apache-solr/metadata.xml b/dev-db/apache-solr/metadata.xml
new file mode 100644
index 00000000..b5e02a8f
--- /dev/null
+++ b/dev-db/apache-solr/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>bertrand@jacquin.bzh</email>
+ <name>Bertrand Jacquin</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/eclass/java-war.eclass b/eclass/java-war.eclass
new file mode 100644
index 00000000..a5d24f7e
--- /dev/null
+++ b/eclass/java-war.eclass
@@ -0,0 +1,62 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+#
+# Original Author: beber
+# Purpose:
+#
+
+DEPEND="${DEPEND}
+ app-arch/unzip"
+
+JAVA_WAR_UNPACK_DIR="${WORKDIR}/${ECLASS}-unpack"
+
+java-war_src_unpack() {
+ [[ ${#} == 0 ]] && die "${FUNCNAME} need at least one argument"
+
+ mkdir "${JAVA_WAR_UNPACK_DIR}" || die "Failed to create ${JAVA_WAR_UNPACK_DIR}"
+
+ local a
+ while (( $# > 0 )) ; do
+ for a in "${1}" "${S}/${1}" ; do
+ if [[ -e "${a}" ]] ; then
+ break
+ fi
+ done
+
+ if [[ -z "${a}" ]] ; then
+ die "WAR file ${1} does not exist"
+ fi
+
+ local _unpack_dir="${JAVA_WAR_UNPACK_DIR}/${a/#${S}\/}"
+
+ echo ">>> Unpacking ${a/#${S}\/} to ${_unpack_dir}"
+ mkdir -p "${_unpack_dir}" \
+ || die "Failed to create ${_unpack_dir}"
+ unzip -qd "${_unpack_dir}" "${a}" \
+ || die "Failed to unpack ${a}"
+
+ shift
+ done
+}
+
+java-war_src_install() {
+ [[ ${#} == 0 ]] && die "${FUNCNAME} need at least one argument"
+
+ local a
+ while (( $# > 0 )) ; do
+ a="${1}"
+
+ local _unpack_dir="${JAVA_WAR_UNPACK_DIR}/${a/#${S}\/}"
+
+ if [[ ! -d "${_unpack_dir}" ]] ; then
+ die "Unable to find unpacked ${a}"
+ fi
+
+ cd "${_unpack_dir}"
+ doins -r .
+
+ shift
+ done
+}
diff --git a/metadata/md5-cache/dev-db/apache-solr-5.2.1 b/metadata/md5-cache/dev-db/apache-solr-5.2.1
new file mode 100644
index 00000000..902bb80b
--- /dev/null
+++ b/metadata/md5-cache/dev-db/apache-solr-5.2.1
@@ -0,0 +1,13 @@
+DEFINED_PHASES=install postinst prerm setup
+DEPEND=app-arch/unzip >=app-admin/webapp-config-1.50.15
+DESCRIPTION=Popular, blazing fast open source enterprise search platform from the Apache Lucene project
+EAPI=5
+HOMEPAGE=http://lucene.apache.org/solr
+IUSE=examples doc
+KEYWORDS=~amd64 ~x86
+LICENSE=Apache-2.0
+RDEPEND=virtual/jre:1.7 >=app-admin/webapp-config-1.50.15
+SLOT=0
+SRC_URI=http://www.apache.org/dist/lucene/solr/5.2.1/solr-5.2.1.tgz
+_eclasses_=java-war da89824bce9ca9451301cc1f7c65a6f5 webapp 094698bf1c7a5b1acd3184e94f484017
+_md5_=94ec3883acd38126523718b43a19ab74