From 2340ffeb0107f7649b2d01a3df475748bbe86371 Mon Sep 17 00:00:00 2001 From: Micha Glave Date: Wed, 6 May 2015 08:39:19 +0200 Subject: [PATCH] first try of a apache lucene solr plugin --- www-apps/solr/Manifest | 4 ++ www-apps/solr/files/solr.conf.d | 3 ++ www-apps/solr/files/solr.init.d | 20 ++++++++ www-apps/solr/solr-5.1.0.ebuild | 83 +++++++++++++++++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 www-apps/solr/Manifest create mode 100644 www-apps/solr/files/solr.conf.d create mode 100755 www-apps/solr/files/solr.init.d create mode 100644 www-apps/solr/solr-5.1.0.ebuild diff --git a/www-apps/solr/Manifest b/www-apps/solr/Manifest new file mode 100644 index 0000000..60f17ba --- /dev/null +++ b/www-apps/solr/Manifest @@ -0,0 +1,4 @@ +AUX solr.conf.d 52 SHA256 d2b0c00c29745d186a6f0249c594daf91b52f7785d872b588461e1b1f0e3286b SHA512 25d12ab805c5cc61ccb8d1bbc252fe14b914067b80711326fdcbc7758227531957c3556acf8ff860c65bcf83b44b70386a35f24a6098a0aad76b3532413cab09 WHIRLPOOL a21365d46b72f56c87193261908b8b8b1c86e1686e904b90fc6ee3cbc9be8063d5eacbfc311a7457a70bc9689233f8ec8fd4b9911cf2930499e5fd10ce109bbd +AUX solr.init.d 359 SHA256 6e97c8c45f15761b589e786f04a74257139ff530211ee5c88b560e399398f1f6 SHA512 0bf93543170602092b7f95f3c265d09963e0e8cf105bdac3b198c0e024405dbb6af5ef157e2009436cc3d4916b2f1c8de77f64856c1f53524da25c350ef35044 WHIRLPOOL 1de81e9f3e7e771f580c63825e425a7ebe1e7a7621e6fab91ed274185a94a9ef362384c978256665808eae3adae55e90a75bb3690c3e215ef4474c5526924395 +DIST solr-5.1.0.tgz 131948849 SHA256 8718cbfb789a170d210b0b4adbe4fd8187ecdc67c5348ed9d551578087d8a628 SHA512 24355fa72dbf897877d9d8a41428131b5a551cb917a6d902ee90dde577b22858e1b6be21eb3fd0f79ae55527ee2e2ff64669ced9cbe4d36b73b788215b56e0c8 WHIRLPOOL 32ca30511622405a5ec8ef9645eda05ab49cffa84c6c78096ae4b5c6b3a263655fd8fd6d104a7544d85d24fac0e98101085f6bb6bf10cc88e7e49f047715f68c +EBUILD solr-5.1.0.ebuild 2195 SHA256 706099b78460993b8a3d1fc1d27473c0d8dc8010b1c30b220bb2924809069e66 SHA512 31f6550aa7adc4909d244059d630619d5200b8414a3e696398c8e06716f38598d45cb8e54d9cceed67aa9a42236380a13c736c753fa098368e702b5525620c38 WHIRLPOOL 389309d427daa3536bc8ed54b9d5360a01f8dbbb7f4b22eec1f6d45c1d397d140fdadcd1d3fbd03c3a8208c8ddc7c1e8ac69f6744dca5ba110ad622284937cd9 diff --git a/www-apps/solr/files/solr.conf.d b/www-apps/solr/files/solr.conf.d new file mode 100644 index 0000000..538b34f --- /dev/null +++ b/www-apps/solr/files/solr.conf.d @@ -0,0 +1,3 @@ +SOLR_INCLUDE=/var/lib/solr/solr.in.sh + +SOLR_OPTS="" diff --git a/www-apps/solr/files/solr.init.d b/www-apps/solr/files/solr.init.d new file mode 100755 index 0000000..8dcd197 --- /dev/null +++ b/www-apps/solr/files/solr.init.d @@ -0,0 +1,20 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +start_stop_daemon_args="-u solr:solr" + +command="/bin/solr" +command_args="start ${SOLR_OPTS}" + +depend() { + need net + use logger +} + +start_pre() { + rm -rf /var/tmp/solr + mkdir /var/tmp/solr + chown solr:solr /var/tmp/solr +} diff --git a/www-apps/solr/solr-5.1.0.ebuild b/www-apps/solr/solr-5.1.0.ebuild new file mode 100644 index 0000000..e7347df --- /dev/null +++ b/www-apps/solr/solr-5.1.0.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +DESCRIPTION="Solr is a standalone enterprise search server with a REST-like API." +HOMEPAGE="http://lucene.apache.org/solr/" +SRC_URI="mirror://apache/lucene/${PN}/${PV}/${P}.tgz" + +LICENSE="apache2" +SLOT="0" +KEYWORDS="~amd64" +IUSE="examples doc" + +DEPEND=" +|| ( virtual/jre:1.7 virtual/jre:1.8 ) +" +RDEPEND="${DEPEND}" + +INSTALL_DIR=/usr/share/${P} +VAR_DIR=/var/lib/${PN} +LOG_DIR=/var/log/${PN} +USR=${PN} +GRP=${PN} + +pkg_preinst() { + enewgroup ${GRP} + enewuser ${USR} -1 /bin/false /dev/null ${GRP} +} + +src_prepare() { + sed_expr="s#solr.log=.*#solr.log=${LOG_DIR}#" + sed -i -e "$sed_expr" server/resources/log4j.properties + echo "SOLR_PID_DIR=$VAR_DIR +SOLR_HOME=$VAR_DIR/data +LOG4J_PROPS=$VAR_DIR/log4j.properties +SOLR_LOGS_DIR=$LOG_DIR +" >> bin/solr.in.sh + + sed_vard="s!/var/solr!${VAR_DIR}!" + sed_usrd="s!/usr/share/solr!${INSTALL_DIR}!" + sed_pidd="s!SOLR_PID_DIR=\"$SOLR_TIP/bin\"!SOLR_PID_DIR=\"/run/${PN}\"!" + sed -i -e "$sed_vard" -e "$sed_usrd" -e "$sed_pidd" bin/solr bin/post + + # Temp-Dir to /var/tmp/solr + # /solr-webapp + sed_tmpd="s!\(\).*\(\)!\1/var/tmp/solr\2!" + sed -i -e "$sed_tmpd" server/contexts/solr-jetty-context.xml +} + +src_install() { + insinto ${INSTALL_DIR}/ + INSTALL_DIR=/usr/share/${P} + doins -r contrib dist server licenses + use examples && doins -r example + use doc && dohtml -r docs/* + + exeinto ${INSTALL_DIR}/bin/ + doexe bin/solr bin/post + dosym ..${INSTALL_DIR}/bin/solr /bin/solr + dosym ..${INSTALL_DIR}/bin/post /bin/solr_post + + newinitd ${FILESDIR}/solr.init.d ${PN} + newconfd ${FILESDIR}/solr.conf.d ${PN} + + insopts -o ${USR} -g ${GRP} -m644 + diropts -o ${USR} -g ${GRP} + keepdir ${LOG_DIR}/ + keepdir /run/solr/ + + insinto ${VAR_DIR} + fowners ${USR}:${GRP} ${VAR_DIR} + doins bin/solr.in.sh + doins server/resources/log4j.properties + + insinto ${VAR_DIR}/data/ + fowners ${USR}:${GRP} ${VAR_DIR}/data + doins server/solr/solr.xml + +} + +