diff options
author | Hilko Bengen <bengen@debian.org> | 2014-06-08 23:01:37 +0200 |
---|---|---|
committer | Hilko Bengen <bengen@debian.org> | 2014-06-09 09:30:22 +0200 |
commit | d981178802215457e9cc737b67342f0ea0ca3b47 (patch) | |
tree | 822f7b9e09658566f0b75b1fedbb7945486fb8fc | |
parent | f4fa8baf9af9f9751169cc265da9b750d4390c28 (diff) | |
download | elasticsearch-d981178802215457e9cc737b67342f0ea0ca3b47.tar.gz |
Initial releasedebian/1.0.3+dfsg-1
27 files changed, 698 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5857e01 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +elasticsearch (1.0.3+dfsg-1) unstable; urgency=low + + * Initial release (Closes: #660826) + + -- Hilko Bengen <bengen@debian.org> Sun, 08 Jun 2014 23:00:09 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..408969c --- /dev/null +++ b/debian/control @@ -0,0 +1,68 @@ +Source: elasticsearch +Maintainer: Hilko Bengen <bengen@debian.org> +Section: web +Build-Depends-Indep: debhelper (>= 9), maven, maven-debian-helper (>= 1.6), default-jdk, + libcarrotsearch-hppc-java, + libcompress-lzf-java, + libguava-java (>= 15), + libhyperic-sigar-java, + libjackson2-annotations-java, + libjackson2-core-java, + libjackson2-databind-java, + libjackson2-dataformat-smile, + libjackson2-dataformat-yaml, + libjna-java, + libjoda-convert-java, + libjoda-time-java, + libjts-java, + liblog4j1.2-java, + liblucene4-java, + libmaven-install-plugin-java, + libmaven-shade-plugin-java, + libmvel-java, + libnetty-3.9-java, + libslf4j-java, + libspatial4j-java, +Priority: optional +Standards-Version: 3.9.5 +Homepage: http://www.elasticsearch.org/ + +Package: elasticsearch +Architecture: all +Depends: ${misc:Depends}, adduser, default-jre, + libhyperic-sigar-java, + libjna-java, + libjts-java, + liblog4j1.2-java, + liblucene4-java, + libspatial4j-java, +Built-Using: ${misc:Built-Using} +Description: Open Source, Distributed, RESTful Search Engine + Elasticsearch is a distributed RESTful search engine built for the cloud. + . + Features include: + . + + Distributed and Highly Available Search Engine. + - Each index is fully sharded with a configurable number of shards. + - Each shard can have one or more replicas. + - Read / Search operations performed on either one of the replica shard. + + Multi Tenant with Multi Types. + - Support for more than one index. + - Support for more than one type per index. + - Index level configuration (number of shards, index storage, ...). + + Various set of APIs + - HTTP RESTful API + - Native Java API. + - All APIs perform automatic node operation rerouting. + + Document oriented + - No need for upfront schema definition. + - Schema can be defined per type for customization of the indexing process. + + Reliable, Asynchronous Write Behind for long term persistency. + + (Near) Real Time Search. + + Built on top of Lucene + - Each shard is a fully functional Lucene index + - All the power of Lucene easily exposed through simple + configuration/plugins. + + Per operation consistency + - Single document level operations are atomic, consistent, isolated and + durable. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..146dd55 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,27 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Elasticsearch +Source: <http://elasticsearch.org/> + +Files: * +Copyright: 2009-2014 Elasticsearch <http://www.elasticsearch.org> +License: Apache-2.0 + +Files: debian/* +Copyright: 2014 Hilko Bengen <bengen@debian.org> +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/debian/elasticsearch.default b/debian/elasticsearch.default new file mode 100644 index 0000000..b28672f --- /dev/null +++ b/debian/elasticsearch.default @@ -0,0 +1,47 @@ +# Start Elasticsearch automatically +#START_DAEMON=true + +# Run Elasticsearch as this user ID and group ID +#ES_USER=elasticsearch +#ES_GROUP=elasticsearch + +# Heap Size (defaults to 256m min, 1g max) +#ES_HEAP_SIZE=2g + +# Heap new generation +#ES_HEAP_NEWSIZE= + +# max direct memory +#ES_DIRECT_SIZE= + +# Maximum number of open files, defaults to 65535. +#MAX_OPEN_FILES=65535 + +# Maximum locked memory size. Set to "unlimited" if you use the +# bootstrap.mlockall option in elasticsearch.yml. You must also set +# ES_HEAP_SIZE. +#MAX_LOCKED_MEMORY=unlimited + +# Maximum number of VMA (Virtual Memory Areas) a process can own +#MAX_MAP_COUNT=262144 + +# Elasticsearch log directory +#LOG_DIR=/var/log/elasticsearch + +# Elasticsearch data directory +#DATA_DIR=/var/lib/elasticsearch + +# Elasticsearch work directory +#WORK_DIR=/tmp/elasticsearch + +# Elasticsearch configuration directory +#CONF_DIR=/etc/elasticsearch + +# Elasticsearch configuration file (elasticsearch.yml) +#CONF_FILE=/etc/elasticsearch/elasticsearch.yml + +# Additional Java OPTS +#ES_JAVA_OPTS= + +# Configure restart on package upgrade (true, every other setting will lead to not restarting) +#RESTART_ON_UPGRADE=true diff --git a/debian/elasticsearch.dirs b/debian/elasticsearch.dirs new file mode 100644 index 0000000..c48b575 --- /dev/null +++ b/debian/elasticsearch.dirs @@ -0,0 +1,2 @@ +/var/log/elasticsearch +/var/lib/elasticsearch diff --git a/debian/elasticsearch.docs b/debian/elasticsearch.docs new file mode 100644 index 0000000..5d86051 --- /dev/null +++ b/debian/elasticsearch.docs @@ -0,0 +1 @@ +README.textile diff --git a/debian/elasticsearch.init b/debian/elasticsearch.init new file mode 100755 index 0000000..9b20f75 --- /dev/null +++ b/debian/elasticsearch.init @@ -0,0 +1,204 @@ +#!/bin/sh +# +# /etc/init.d/elasticsearch -- startup script for Elasticsearch +# +# Written by Miquel van Smoorenburg <miquels@cistron.nl>. +# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>. +# Modified for Tomcat by Stefan Gybas <sgybas@debian.org>. +# Modified for Tomcat6 by Thierry Carrez <thierry.carrez@ubuntu.com>. +# Additional improvements by Jason Brittain <jason.brittain@mulesoft.com>. +# Modified by Nicolas Huray for Elasticsearch <nicolas.huray@gmail.com>. +# +### BEGIN INIT INFO +# Provides: elasticsearch +# Required-Start: $network $remote_fs $named +# Required-Stop: $network $remote_fs $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts elasticsearch +# Description: Starts elasticsearch using start-stop-daemon +### END INIT INFO + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +NAME=elasticsearch +DESC="Elasticsearch Server" +DEFAULT=/etc/default/$NAME + +if [ `id -u` -ne 0 ]; then + echo "You need root privileges to run this script" + exit 1 +fi + + +. /lib/lsb/init-functions + +if [ -r /etc/default/rcS ]; then + . /etc/default/rcS +fi + + +# The following variables can be overwritten in $DEFAULT + +# Run Elasticsearch as this user ID and group ID +ES_USER=elasticsearch +ES_GROUP=elasticsearch + +# The first existing directory is used for JAVA_HOME (if JAVA_HOME is not defined in $DEFAULT) +JDK_DIRS="/usr/lib/jvm/java-7-oracle /usr/lib/jvm/java-7-openjdk /usr/lib/jvm/java-7-openjdk-amd64/ /usr/lib/jvm/java-7-openjdk-armhf /usr/lib/jvm/java-7-openjdk-i386/ /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-openjdk-amd64 /usr/lib/jvm/java-6-openjdk-armhf /usr/lib/jvm/java-6-openjdk-i386 /usr/lib/jvm/default-java" + +# Look for the right JVM to use +for jdir in $JDK_DIRS; do + if [ -r "$jdir/bin/java" -a -z "${JAVA_HOME}" ]; then + JAVA_HOME="$jdir" + fi +done +export JAVA_HOME + +# Directory where the Elasticsearch binary distribution resides +ES_HOME=/usr/share/$NAME + +# Heap Size (defaults to 256m min, 1g max) +#ES_HEAP_SIZE=2g + +# Heap new generation +#ES_HEAP_NEWSIZE= + +# max direct memory +#ES_DIRECT_SIZE= + +# Additional Java OPTS +#ES_JAVA_OPTS= + +# Maximum number of open files +MAX_OPEN_FILES=65535 + +# Maximum amount of locked memory +#MAX_LOCKED_MEMORY= + +# Elasticsearch log directory +LOG_DIR=/var/log/$NAME + +# Elasticsearch data directory +DATA_DIR=/var/lib/$NAME + +# Elasticsearch work directory +WORK_DIR=/tmp/$NAME + +# Elasticsearch configuration directory +CONF_DIR=/etc/$NAME + +# Elasticsearch configuration file (elasticsearch.yml) +CONF_FILE=$CONF_DIR/elasticsearch.yml + +# Maximum number of VMA (Virtual Memory Areas) a process can own +MAX_MAP_COUNT=262144 + +# End of variables that can be overwritten in $DEFAULT + +# overwrite settings from default file +if [ -f "$DEFAULT" ]; then + . "$DEFAULT" +fi + +# Define other required variables +PID_FILE=/var/run/$NAME.pid +DAEMON=$ES_HOME/bin/elasticsearch +DAEMON_OPTS="-d -p $PID_FILE -Des.default.config=$CONF_FILE -Des.default.path.home=$ES_HOME -Des.default.path.logs=$LOG_DIR -Des.default.path.data=$DATA_DIR -Des.default.path.work=$WORK_DIR -Des.default.path.conf=$CONF_DIR" + +export ES_HEAP_SIZE +export ES_HEAP_NEWSIZE +export ES_DIRECT_SIZE +export ES_JAVA_OPTS + +# Check DAEMON exists +test -x $DAEMON || exit 0 +test "$START_DAEMON" = true || exit 0 + +checkJava() { + if [ -x "$JAVA_HOME/bin/java" ]; then + JAVA="$JAVA_HOME/bin/java" + else + JAVA=`which java` + fi + + if [ ! -x "$JAVA" ]; then + echo "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME" + exit 1 + fi +} + +case "$1" in + start) + checkJava + + if [ -n "$MAX_LOCKED_MEMORY" -a -z "$ES_HEAP_SIZE" ]; then + log_failure_msg "MAX_LOCKED_MEMORY is set - ES_HEAP_SIZE must also be set" + exit 1 + fi + + log_daemon_msg "Starting $DESC" + + pid=`pidofproc -p $PID_FILE elasticsearch` + if [ -n "$pid" ] ; then + log_begin_msg "Already running." + log_end_msg 0 + exit 0 + fi + + # Prepare environment + mkdir -p "$LOG_DIR" "$DATA_DIR" "$WORK_DIR" && chown "$ES_USER":"$ES_GROUP" "$LOG_DIR" "$DATA_DIR" "$WORK_DIR" + touch "$PID_FILE" && chown "$ES_USER":"$ES_GROUP" "$PID_FILE" + + if [ -n "$MAX_OPEN_FILES" ]; then + ulimit -n $MAX_OPEN_FILES + fi + + if [ -n "$MAX_LOCKED_MEMORY" ]; then + ulimit -l $MAX_LOCKED_MEMORY + fi + + if [ -n "$MAX_MAP_COUNT" ]; then + sysctl -q -w vm.max_map_count=$MAX_MAP_COUNT + fi + + # Start Daemon + start-stop-daemon --start -b --user "$ES_USER" -c "$ES_USER" --pidfile "$PID_FILE" --exec $DAEMON -- $DAEMON_OPTS + log_end_msg $? + ;; + stop) + log_daemon_msg "Stopping $DESC" + + if [ -f "$PID_FILE" ]; then + start-stop-daemon --stop --pidfile "$PID_FILE" \ + --user "$ES_USER" \ + --retry=TERM/20/KILL/5 >/dev/null + if [ $? -eq 1 ]; then + log_progress_msg "$DESC is not running but pid file exists, cleaning up" + elif [ $? -eq 3 ]; then + PID="`cat $PID_FILE`" + log_failure_msg "Failed to stop $DESC (pid $PID)" + exit 1 + fi + rm -f "$PID_FILE" + else + log_progress_msg "(not running)" + fi + log_end_msg 0 + ;; + status) + status_of_proc -p $PID_FILE elasticsearch elasticsearch && exit 0 || exit $? + ;; + restart|force-reload) + if [ -f "$PID_FILE" ]; then + $0 stop + sleep 1 + fi + $0 start + ;; + *) + log_success_msg "Usage: $0 {start|stop|restart|force-reload|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/debian/elasticsearch.install b/debian/elasticsearch.install new file mode 100644 index 0000000..932609d --- /dev/null +++ b/debian/elasticsearch.install @@ -0,0 +1,5 @@ +config/*.yml /etc/elasticsearch/ + +target/bin/elasticsearch /usr/share/elasticsearch/bin +target/bin/elasticsearch.in.sh /usr/share/elasticsearch/bin +target/bin/plugin /usr/share/elasticsearch/bin diff --git a/debian/elasticsearch.poms b/debian/elasticsearch.poms new file mode 100644 index 0000000..8545d14 --- /dev/null +++ b/debian/elasticsearch.poms @@ -0,0 +1,28 @@ +# List of POM files for the package +# Format of this file is: +# <path to pom file> [option]* +# where option can be: +# --ignore: ignore this POM and its artifact if any +# --ignore-pom: don't install the POM. To use on POM files that are created +# temporarily for certain artifacts such as Javadoc jars. [mh_install, mh_installpoms] +# --no-parent: remove the <parent> tag from the POM +# --package=<package>: an alternative package to use when installing this POM +# and its artifact +# --has-package-version: to indicate that the original version of the POM is the same as the upstream part +# of the version for the package. +# --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM +# during a clean operation with mh_cleanpom or mh_installpom +# --artifact=<path>: path to the build artifact associated with this POM, +# it will be installed when using the command mh_install. [mh_install] +# --java-lib: install the jar into /usr/share/java to comply with Debian +# packaging guidelines +# --usj-name=<name>: name to use when installing the library in /usr/share/java +# --usj-version=<version>: version to use when installing the library in /usr/share/java +# --no-usj-versionless: don't install the versionless link in /usr/share/java +# --dest-jar=<path>: the destination for the real jar. +# It will be installed with mh_install. [mh_install] +# --classifier=<classifier>: Optional, the classifier for the jar. Empty by default. +# --site-xml=<location>: Optional, the location for site.xml if it needs to be installed. +# Empty by default. [mh_install] +# +pom.xml --no-parent diff --git a/debian/elasticsearch.postinst b/debian/elasticsearch.postinst new file mode 100755 index 0000000..0a9e622 --- /dev/null +++ b/debian/elasticsearch.postinst @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + dpkg-statoverride --quiet --update --add \ + elasticsearch elasticsearch 0755 /var/log/elasticsearch || true + dpkg-statoverride --quiet --update --add \ + elasticsearch elasticsearch 0755 /var/lib/elasticsearch || true + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/elasticsearch.postrm b/debian/elasticsearch.postrm new file mode 100755 index 0000000..95c3e7b --- /dev/null +++ b/debian/elasticsearch.postrm @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +case "$1" in + remove) + # remove **only** empty data dir + rmdir -p --ignore-fail-on-non-empty /var/lib/elasticsearch || true + ;; + + purge) + rm -rf /var/log/elasticsearch /var/lib/elasticsearch + + dpkg-statoverride --list \ + | awk '$1 == "elasticsearch" || $2 == "elastcsearch" {print $4 }' \ + | xargs -n1 dpkg-statoverride --remove + + deluser elasticsearch || true + delgroup elasticsearch || true + ;; + + upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "$0 called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/elasticsearch.preinst b/debian/elasticsearch.preinst new file mode 100755 index 0000000..6ae63cb --- /dev/null +++ b/debian/elasticsearch.preinst @@ -0,0 +1,28 @@ +#!/bin/sh + +set -e + +case "$1" in + install|upgrade) + if ! getent group 'elasticsearch' > /dev/null 2>&1 ; then + addgroup --system elasticsearch --quiet + fi + if ! getent user 'elasticsearch' > /dev/null 2>&1 ; then + adduser --system --home /var/lib/elasticsearch --no-create-home \ + --ingroup elasticsearch --disabled-password --shell /bin/false \ + elasticsearch + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 diff --git a/debian/elasticsearch.prerm b/debian/elasticsearch.prerm new file mode 100755 index 0000000..06bb9dd --- /dev/null +++ b/debian/elasticsearch.prerm @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +case "$1" in + remove|upgrade|deconfigure) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# NOT added by dh_installinit +if [ -x "/etc/init.d/elasticsearch" ]; then + invoke-rc.d elasticsearch stop || exit $? +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/maven.cleanIgnoreRules b/debian/maven.cleanIgnoreRules new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/debian/maven.cleanIgnoreRules @@ -0,0 +1 @@ + diff --git a/debian/maven.ignoreRules b/debian/maven.ignoreRules new file mode 100644 index 0000000..51ce4f9 --- /dev/null +++ b/debian/maven.ignoreRules @@ -0,0 +1,17 @@ + +com.carrotsearch.randomizedtesting junit4-maven-plugin * * * * +com.carrotsearch.randomizedtesting randomizedtesting-runner * * * * +com.mycila license-maven-plugin * * * * +de.thetaphi forbiddenapis * * * * +org.apache.httpcomponents httpclient * * * * +org.apache.lucene lucene-test-framework * * * * +org.apache.maven.plugins maven-assembly-plugin * * * * +org.apache.maven.plugins maven-dependency-plugin * * * * +org.apache.maven.plugins maven-eclipse-plugin * * * * +org.apache.maven.plugins maven-source-plugin * * * * +org.apache.maven.plugins maven-surefire-plugin * * * * +org.codehaus.mojo buildnumber-maven-plugin * * * * +org.codehaus.mojo exec-maven-plugin * * * * +org.codehaus.mojo rpm-maven-plugin * * * * +org.hamcrest hamcrest-all * * * * +org.vafer jdeb * * * * diff --git a/debian/maven.properties b/debian/maven.properties new file mode 100644 index 0000000..d2f1b82 --- /dev/null +++ b/debian/maven.properties @@ -0,0 +1 @@ +maven.test.skip=true diff --git a/debian/maven.publishedRules b/debian/maven.publishedRules new file mode 100644 index 0000000..e5f5688 --- /dev/null +++ b/debian/maven.publishedRules @@ -0,0 +1,2 @@ + +org.elasticsearch elasticsearch jar s/.*/1.0/ * * diff --git a/debian/maven.rules b/debian/maven.rules new file mode 100644 index 0000000..859ffb6 --- /dev/null +++ b/debian/maven.rules @@ -0,0 +1,10 @@ + +com.fasterxml.jackson.core jackson-core jar s/.*/2.x/ * * +com.fasterxml.jackson.dataformat jackson-dataformat-smile jar s/.*/2.x/ * * +com.fasterxml.jackson.dataformat jackson-dataformat-yaml jar s/.*/2.x/ * * +com.vividsolutions jts jar s/.*/fake/ * * +log4j log4j jar s/.*/1.2.x/ * * +org.apache.lucene lucene-* jar s/.*/4.x/ * * +org.elasticsearch elasticsearch jar s/.*/debian/ * * +org.fusesource sigar jar s/.*/fake/ * * +org.joda joda-convert jar s/.*/1.x/ * * diff --git a/debian/patches/0001-Assemble-classpath-from-.jar-files-in-usr-share-java.patch b/debian/patches/0001-Assemble-classpath-from-.jar-files-in-usr-share-java.patch new file mode 100644 index 0000000..cccb763 --- /dev/null +++ b/debian/patches/0001-Assemble-classpath-from-.jar-files-in-usr-share-java.patch @@ -0,0 +1,29 @@ +From: Hilko Bengen <bengen@debian.org> +Date: Sat, 7 Jun 2014 12:07:50 +0200 +Subject: Assemble classpath from .jar files in /usr/share/java + +--- + bin/elasticsearch.in.sh | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + mode change 100644 => 100755 bin/elasticsearch.in.sh + +diff --git a/bin/elasticsearch.in.sh b/bin/elasticsearch.in.sh +old mode 100644 +new mode 100755 +index 8713205..aa6a85d +--- a/bin/elasticsearch.in.sh ++++ b/bin/elasticsearch.in.sh +@@ -1,6 +1,12 @@ + #!/bin/sh + +-ES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/${project.build.finalName}.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/* ++JAR_NAMES="${project.build.finalName} sigar* jna-3.* jts-1.* log4j-1.2.* lucene*-4.* spatial4j-*" ++ ++for name in $JAR_NAMES; do ++ ES_CLASSPATH=$ES_CLASSPATH:$(find /usr/share/java/ -name "$name.jar" \ ++ | tr '\n' : \ ++ | sed -e 's,::*,:,g' ) ++done + + if [ "x$ES_MIN_MEM" = "x" ]; then + ES_MIN_MEM=256m diff --git a/debian/patches/0002-Use-lzf.util.ChunkEncoderFactory-so-we-can-build-wit.patch b/debian/patches/0002-Use-lzf.util.ChunkEncoderFactory-so-we-can-build-wit.patch new file mode 100644 index 0000000..4f8d559 --- /dev/null +++ b/debian/patches/0002-Use-lzf.util.ChunkEncoderFactory-so-we-can-build-wit.patch @@ -0,0 +1,30 @@ +From: Hilko Bengen <bengen@debian.org> +Date: Sun, 8 Jun 2014 22:50:08 +0200 +Subject: Use lzf.util.ChunkEncoderFactory so we can build with compress-lzf + 1.0.1 + +--- + .../elasticsearch/common/compress/lzf/LZFCompressedStreamOutput.java | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamOutput.java b/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamOutput.java +index 00899fd..b34a82c 100644 +--- a/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamOutput.java ++++ b/src/main/java/org/elasticsearch/common/compress/lzf/LZFCompressedStreamOutput.java +@@ -20,6 +20,7 @@ + package org.elasticsearch.common.compress.lzf; + + import com.ning.compress.BufferRecycler; ++import com.ning.compress.lzf.util.ChunkEncoderFactory; + import com.ning.compress.lzf.ChunkEncoder; + import com.ning.compress.lzf.LZFChunk; + import org.elasticsearch.common.compress.CompressedStreamOutput; +@@ -39,7 +40,7 @@ public class LZFCompressedStreamOutput extends CompressedStreamOutput<LZFCompres + this.recycler = BufferRecycler.instance(); + this.uncompressed = this.recycler.allocOutputBuffer(LZFChunk.MAX_CHUNK_LEN); + this.uncompressedLength = LZFChunk.MAX_CHUNK_LEN; +- this.encoder = new ChunkEncoder(LZFChunk.MAX_CHUNK_LEN); ++ this.encoder = ChunkEncoderFactory.optimalInstance(LZFChunk.MAX_CHUNK_LEN); + } + + @Override diff --git a/debian/patches/0003-Do-not-set-build-hash.patch b/debian/patches/0003-Do-not-set-build-hash.patch new file mode 100644 index 0000000..c5e26c4 --- /dev/null +++ b/debian/patches/0003-Do-not-set-build-hash.patch @@ -0,0 +1,16 @@ +From: Hilko Bengen <bengen@debian.org> +Date: Mon, 9 Jun 2014 00:11:28 +0200 +Subject: Do not set build hash + +--- + src/main/resources/es-build.properties | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/main/resources/es-build.properties b/src/main/resources/es-build.properties +index 563ecdd..570373a 100644 +--- a/src/main/resources/es-build.properties ++++ b/src/main/resources/es-build.properties +@@ -1,3 +1,2 @@ + version=${project.version} +-hash=${buildNumber} + timestamp=${timestamp} diff --git a/debian/patches/0004-Add-lucene-sandbox-in-pom.xml.patch b/debian/patches/0004-Add-lucene-sandbox-in-pom.xml.patch new file mode 100644 index 0000000..1adaa45 --- /dev/null +++ b/debian/patches/0004-Add-lucene-sandbox-in-pom.xml.patch @@ -0,0 +1,34 @@ +From: Hilko Bengen <bengen@debian.org> +Date: Sat, 7 Jun 2014 12:07:50 +0200 +Subject: Add lucene-sandbox in pom.xml + +--- + pom.xml | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/pom.xml b/pom.xml +index b6be5d0..34991c0 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -143,6 +143,21 @@ + <version>${lucene.version}</version> + <scope>compile</scope> + </dependency> ++ <!-- Adding lucene-sandbox avoids the following failures: ++ [ERROR] ++ /«BUILDDIR»/elasticsearch-1.0.3+dfsg/src/main/java/org/elasticsearch/index/query/FuzzyLikeThisFieldQueryParser.java:[23,40] ++ error: package org.apache.lucene.sandbox.queries does not ++ exist ++ [ERROR] ++ /«BUILDDIR»/elasticsearch-1.0.3+dfsg/src/main/java/org/elasticsearch/index/query/FuzzyLikeThisQueryParser.java:[24,40] ++ error: package org.apache.lucene.sandbox.queries does not ++ exist --> ++ <dependency> ++ <groupId>org.apache.lucene</groupId> ++ <artifactId>lucene-sandbox</artifactId> ++ <version>${lucene.version}</version> ++ <scope>compile</scope> ++ </dependency> + <dependency> + <groupId>com.spatial4j</groupId> + <artifactId>spatial4j</artifactId> diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..a3919bf --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,4 @@ +0001-Assemble-classpath-from-.jar-files-in-usr-share-java.patch +0002-Use-lzf.util.ChunkEncoderFactory-so-we-can-build-wit.patch +0003-Do-not-set-build-hash.patch +0004-Add-lucene-sandbox-in-pom.xml.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..93454e1 --- /dev/null +++ b/debian/rules @@ -0,0 +1,52 @@ +#!/usr/bin/make -f + +JAVA_HOME := /usr/lib/jvm/default-java + +SHADED_JAVA_LIBS = \ + libguava-java \ + libcarrotsearch-hppc-java \ + libjoda-time-java \ + libmvel-java \ + libjackson2-core-java \ + libjackson2-dataformat-smile \ + libjackson2-dataformat-yaml \ + libnetty3.9-java \ + libcompress-lzf-java + +%: + dh $@ --buildsystem=maven + +override_dh_auto_configure: + dh_auto_configure + mvn install:install-file \ + -Dmaven.repo.local=$(CURDIR)/debian/maven-repo \ + -Dfile=/usr/share/java/sigar.jar \ + -DgroupId=org.fusesource \ + -DartifactId=sigar \ + -Dversion=fake \ + -Dpackaging=jar + + mvn install:install-file \ + -Dmaven.repo.local=$(CURDIR)/debian/maven-repo \ + -Dfile=/usr/share/java/jts.jar \ + -DgroupId=com.vividsolutions \ + -DartifactId=jts \ + -Dversion=fake \ + -Dpackaging=jar + +override_dh_auto_install: + mh_installpoms -pelasticsearch + mh_installjar -pelasticsearch -l -s pom.xml target/elasticsearch-*.jar + +override_dh_install: + dh_install --fail-missing + chmod 755 debian/elasticsearch/usr/share/elasticsearch/bin/* + +override_dh_gencontrol: + dh_gencontrol -- \ + -Vmisc:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W $(SHADED_JAVA_LIBS))" + +# Maven's clean target will fail if we don't blow maven-repo away before. +override_dh_auto_clean: + rm -rf debian/maven-repo + dh_auto_clean diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..13c589a --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=dversionmangle=s/\+dfsg// \ + https://github.com/elasticsearch/elasticsearch/releases .*/v(1\.0.*)\.tar\.gz |