Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 253007 - dev-db/apache-solr-bin: Open source enterprise search platform from the Apache Lucene project
Summary: dev-db/apache-solr-bin: Open source enterprise search platform from the Apach...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement with 1 vote (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-29 16:21 UTC by Arsen Shnurkov
Modified: 2022-07-08 19:48 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
another ebuild attempt (solr-3.2.0.ebuild,1.45 KB, text/plain)
2011-06-27 13:08 UTC, Raphaël Droz
Details
ebuild for apache-solr 3.5.0 (apache-solr-3.5.0.ebuild,3.16 KB, text/plain)
2011-12-15 12:33 UTC, Matthias Weiss
Details
example solrconfig.xml file I put into files directory with fixed library paths (solrconfig.xml,58.27 KB, text/plain)
2011-12-15 12:34 UTC, Matthias Weiss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arsen Shnurkov 2008-12-29 16:21:03 UTC
There is a java project (Search server web interface for Lucene)
http://lucene.apache.org/solr/
There is no ebuild for it.

Reproducible: Always

Steps to Reproduce:
emerge dev-java/solr



ebuild should do something like fragment below, but from source

tar zxf apache-solr-1.3.0.tgz 
cp apache-solr-1.3.0/dist/apache-solr-1.3.0.war /var/lib/tomcat/webapps/solr.war 
cp apache-solr-1.3.0/example/solr solr-home 
echo 'export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/home/root/solr/solr-home/"' >> /etc/bash/bashrc 
source /etc/bash/bashrc
Comment 1 Serkan Kaba (RETIRED) gentoo-dev 2008-12-29 17:40:04 UTC
First of all the ebuild should (if not must) build it from source. Apart from that there's infrastructure for Java webapps currently.
Comment 2 Arsen Shnurkov 2009-01-04 07:38:56 UTC
(In reply to comment #1)
> First of all the ebuild should (if not must) build it from source. Apart from
> that there's infrastructure for Java webapps currently.

I compiled sources with the following fragment, and then install .war-file and configuration files by hands (with http://wiki.apache.org/solr/SolrTomcat).

The framework at http://overlays.gentoo.org/svn/dev/nelchael/eclass/java-webapp.eclass is incomplete now.

=== part of solr-1.3.0.ebuild ===
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

JAVA_PKG_IUSE="tomcat"
JAVA_PKG_BSFIX_ALL="no"
JAVA_PKG_BSFIX_NAME=""

inherit java-pkg-2 java-ant-2 # java-webapp

DESCRIPTION="Frontend for Lucene. Backend for LifeRay"
HOMEPAGE="http://lucene.apache.org/solr"
SRC_URI="mirror://apache/lucene/java/apache-${P}.tgz"
LICENSE="Apache-2.0"
SLOT="1.3"
KEYWORDS="~x86"
# ${S} is changed in order to setup build process to the correct folder within archive
S="${WORKDIR}/apache-${P}"
IUSE=""
# dist target creates .war file
EANT_BUILD_TARGET="dist"

CDEPEND=">=dev-java/lucene-2.4.0"

DEPEND="${CDEPEND}
	>=virtual/jdk-1.5
	dev-java/ant-nodeps
	dev-java/javacc
	test? ( dev-java/ant-junit =dev-java/junit-3* )"

RDEPEND="${CDEPEND}
	>=virtual/jre-1.5"
Comment 3 Raphaël Droz 2011-06-27 13:08:56 UTC
Created attachment 278347 [details]
another ebuild attempt

This ebuild is updated in some aspects but use a more "manual" method
as I don't understand the "waf" stuff.
I still have difficulties for files installation, jar launcher and sample configuration handling.
Advises welcome
Comment 4 Matthias Weiss 2011-12-15 12:31:21 UTC
I created and tested a solr ebuild that builds and installs apache-solr
from source.
While it installs fine, there are some remaining issues, partly because this is
my first ebuild and I'm lacking the knowledge:

solr needs to have a dependency on a servlet container, and I think it
should have a dependency on a virtual package like
www-server/servlet-container. Unfortunately it seems that there is no such
virtual package.

According to the solr wiki (http://wiki.apache.org/solr/SolrInstall) I have to
 stop a running tomcat, install apache-solr, and restart tomcat again. How do I
do that in the ebuild?

I put the tomcat context fragment into /etc/tomcat-6/Catalina/localhost which
is bad as this is a hardcoded path. The reason for this is, I don't know how to
query all the installed versions of tomcat in order to install the context
fragments into each installed /etc/tomcat-X

Deinstalling apache-solr doesn't remove the /etc/tomcat-6/Catalina directory
even if nothing is changed.

Currently the sample solrconfig.xml is shipped in the files folder (see
attachment) because the upstream file has some wrong library paths. Maybe a
patch would be better?

The eclass function webapp_serverowned doesn't work as I want it, it
changes the file owner to lighttpd but not to tomcat and I don't know how to
change this; so I inserted a postinst chown command to do the job because
otherwise the example installation doesn't work. Note that the chown command has
to run *after* the webapp_pkg_postinst call which is the opposite of what the
webapp-config documentation tells us.

I'm installing all the jar files created by the build. According the the apache
solr documentation for tomcat
(http://wiki.apache.org/solr/SolrTomcat#Installing_Solr_instances_under_Tomcat) 
this is not necessary but I wasn't able to even start solr without them. Note
that I'm using my own solrconfig.xml file with all the library paths pointing to
the place where I install the jar files.

I have no idea whether the build/docs/api directory which I'm installing with
java-pkg_dojavadoc is the "right" thing to do.

regards
matthias
Comment 5 Matthias Weiss 2011-12-15 12:33:42 UTC
Created attachment 295909 [details]
ebuild for apache-solr 3.5.0
Comment 6 Matthias Weiss 2011-12-15 12:34:24 UTC
Created attachment 295911 [details]
example solrconfig.xml file I put into files directory with fixed library paths
Comment 7 Raphaël Droz 2012-04-06 15:28:47 UTC
Should this software wait for an hypothetical maven/ebuild integration [1]; that is bug #175034 ?
[1] https://overlays.gentoo.org/proj/java/wiki/Maven

Should we wait until all of its deps' are bumped ? or should we bundle them ?
Here they are :

apache-solr-3.5.0/solr/contrib $ tree --prune -P "*.jar"
|-- analysis-extras
|   `-- lib
|       `-- icu4j-4_8_1_1.jar
|-- clustering
|   `-- lib
|       |-- carrot2-core-3.5.0.jar
|       |-- hppc-0.3.4-jdk15.jar
|       |-- jackson-core-asl-1.5.2.jar
|       |-- jackson-mapper-asl-1.5.2.jar
|       |-- mahout-collections-0.3.jar
|       |-- mahout-math-0.3.jar
|       `-- simple-xml-2.4.1.jar
|-- dataimporthandler
|   `-- lib
|       |-- activation-1.1.jar
|       `-- mail-1.4.1.jar
|-- extraction
|   `-- lib
|       |-- apache-mime4j-core-0.7.jar
|       |-- apache-mime4j-dom-0.7.jar
|       |-- asm-3.1.jar
|       |-- bcmail-jdk15-1.45.jar
|       |-- bcprov-jdk15-1.45.jar
|       |-- boilerpipe-1.1.0.jar
|       |-- commons-compress-1.2.jar
|       |-- dom4j-1.6.1.jar
|       |-- fontbox-1.6.0.jar
|       |-- icu4j-4_8_1_1.jar
|       |-- jempbox-1.6.0.jar
|       |-- metadata-extractor-2.4.0-beta-1.jar
|       |-- netcdf-4.2-min.jar
|       |-- pdfbox-1.6.0.jar
|       |-- poi-3.8-beta4.jar
|       |-- poi-ooxml-3.8-beta4.jar
|       |-- poi-ooxml-schemas-3.8-beta4.jar
|       |-- poi-scratchpad-3.8-beta4.jar
|       |-- rome-0.9.jar
|       |-- tagsoup-1.2.1.jar
|       |-- tika-core-0.10.jar
|       |-- tika-parsers-0.10.jar
|       |-- xercesImpl-2.8.1.jar
|       |-- xml-apis-1.0.b2.jar
|       `-- xmlbeans-2.3.0.jar
|-- langid
|   `-- lib
|       |-- jsonic-1.2.0.jar
|       `-- langdetect-r111-java5.jar
|-- uima
|   `-- lib
|       |-- commons-digester-2.0.jar
|       |-- uima-an-alchemy-2.3.1.jar
|       |-- uima-an-calais-2.3.1.jar
|       |-- uima-an-tagger-2.3.1.jar
|       |-- uima-an-wst-2.3.1.jar
|       `-- uimaj-core-2.3.1.jar
`-- velocity
    `-- lib
        |-- commons-beanutils-1.7.0.jar
        |-- commons-collections-3.2.1.jar
        |-- velocity-1.6.4.jar
        `-- velocity-tools-2.0.jar
Comment 8 Raphaël Droz 2012-04-06 17:21:11 UTC
Tried to cleanup/simplify your ebuild a bit:
https://gitorious.org/drzraf/gentoo/commit/5a0af868a01ba9fa06110c067f934c501714fdf0
Comment 9 Miroslav Šulc gentoo-dev 2015-10-21 13:43:43 UTC
for those still interested, here is ebuild for latest (binary) solr package:

https://cgit.gentoo.org/dev/fordfrog.git/tree/dev-db/apache-solr-bin

it is still work in progress. due to the large amount of deps, i decided not to build it from source yet, until all or most of the deps are resolved. then building it from source and providing source ebuild will be much easier.

at this moment it does not contain init script and conf.d file. i hope to work on these after cca 5 hours (leaving now), unless somebody can provide those in the meantime.

one package that can be unbundled but i did not do that is pdfbox. it's because i have issue with compiling gcc-4.9.3 with gcj USE flag and hence install pdfbox and test it with solr.

any comments, bug reports, testing feedback, patches etc are welcome.
Comment 10 Patrice Clement gentoo-dev 2015-10-21 13:50:44 UTC
Thanks a lot Miroslav. Looking forward to a complete ebuild. =]
Comment 11 Patrice Clement gentoo-dev 2015-10-21 13:53:11 UTC
Hi Ultrabug

Apparently, you've also tried to package solr on your own. 

https://cgit.gentoo.org/dev/ultrabug.git/tree/dev-db/apache-solr/apache-solr-3.6.0.ebuild

CCing you in so that you can maybe contribute to this attempt.
Comment 12 Miroslav Šulc gentoo-dev 2015-10-21 21:31:50 UTC
i just added the init script. creating core works fine. there's no revbump, just re-emerge the ebuild.

any feedback welcome.
Comment 13 Marcin Mirosław 2016-06-10 12:55:18 UTC
Does anybody have ebuild for solr 5.x or 6.x?