--- elasticsearch-0.16.0.orig/debian/postrm +++ elasticsearch-0.16.0/debian/postrm @@ -0,0 +1,25 @@ +#!/bin/sh + +set -e + +do_purge() +{ + for d in data logs; do + rm -rf /opt/elasticsearch/$d + done +} + +case "$1" in + purge) + do_purge + ;; + + remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 +esac + +#DEBHELPER# --- elasticsearch-0.16.0.orig/debian/upstart +++ elasticsearch-0.16.0/debian/upstart @@ -0,0 +1,53 @@ +description "Elastic Search Server" +author "Rui Lopes " + +start on (filesystem and net-device-up IFACE!=lo) + +stop on shutdown + +respawn + +script + ES_USER=elasticsearch + ES_HOME=/opt/elasticsearch + # TODO get these from /etc/default/elasticsearch + ES_MIN_MEM=256m + ES_MAX_MEM=1g + JAVA_HOME=/usr/lib/jvm/java-6-openjdk/jre + + . $ES_HOME/bin/elasticsearch.in.sh + + JAVA_OPTS="$JAVA_OPTS -Djline.enabled=false" + + #JAVA_OPTS="-debug $JAVA_OPTS" + + ES_CLASSPATH="$ES_CLASSPATH:/usr/share/java/commons-daemon.jar" + + # NB jsvc 1.0.2 that ships with Ubuntu Lucid (10.04) does not expand the + # -cp argument... so we have to do it ourselfs. + expand_glob_path_list() + { + result="" + old_IFS="$IFS" + IFS=: + for p in $1; do + result="$result:$p" + done + IFS="$old_IFS" + echo "$result" + } + ES_CLASSPATH=`expand_glob_path_list $ES_CLASSPATH` + + exec /usr/bin/jsvc \ + -home "$JAVA_HOME" \ + -user $ES_USER \ + $JAVA_OPTS \ + -Delasticsearch \ + -Des.path.home="$ES_HOME" \ + -cp "$ES_CLASSPATH" \ + -jvm server \ + -procname $UPSTART_JOB \ + -nodetach \ + -pidfile "/var/run/$UPSTART_JOB.pid" \ + org.elasticsearch.bootstrap.ElasticSearch +end script --- elasticsearch-0.16.0.orig/debian/docs +++ elasticsearch-0.16.0/debian/docs @@ -0,0 +1,3 @@ +LICENSE.txt +NOTICE.txt +README.textile --- elasticsearch-0.16.0.orig/debian/postinst +++ elasticsearch-0.16.0/debian/postinst @@ -0,0 +1,49 @@ +#!/bin/sh + +set -e + +USER="elasticsearch" +ID="/usr/bin/id" +ADDUSER="/usr/sbin/adduser" +CHOWN="/bin/chown" +INSTALL="/usr/bin/install" + +do_configure() +{ + if $ID $USER >/dev/null 2>&1; then + UID=`$ID --user $USER` + else + UID="" + fi + + if [ "x$UID" = "x" ]; then + $ADDUSER \ + --system \ + --disabled-password \ + --disabled-login \ + --home /opt/elasticsearch \ + --no-create-home \ + --group $USER + fi + + for d in data logs; do + $INSTALL -d -o $USER -g $USER /opt/elasticsearch/$d + $CHOWN -R $USER:$USER /opt/elasticsearch/$d + done +} + +case "$1" in + configure) + do_configure + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- elasticsearch-0.16.0.orig/debian/control +++ elasticsearch-0.16.0/debian/control @@ -0,0 +1,13 @@ +Source: elasticsearch +Section: java +Priority: extra +Maintainer: Rui Lopes +Build-Depends: debhelper (>= 7) +Standards-Version: 3.8.3 +Homepage: http://www.elasticsearch.org/ + +Package: elasticsearch +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, jsvc +Description: A Distributed RESTful Search Engine + ElasticSearch is a distributed RESTful search engine built for the cloud. --- elasticsearch-0.16.0.orig/debian/copyright +++ elasticsearch-0.16.0/debian/copyright @@ -0,0 +1,37 @@ +This work was packaged for Debian by: + + Rui Lopes on Sat, 23 Apr 2011 14:03:33 +0100 + +It was downloaded from http://www.elasticsearch.org/ + +Upstream Author(s): + + Elastic Search + Shay Banon + +Copyright: + + Copyright 2009-2011 Elastic Search and Shay Banon + +License: + + 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'. + +The Debian packaging is: + + Copyright (C) 2011 Rui Lopes + +and is licensed under Apache 2.0. --- elasticsearch-0.16.0.orig/debian/rules +++ elasticsearch-0.16.0/debian/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +DESTDIR=${PWD}/debian/elasticsearch/opt/elasticsearch + +ifeq (${DEB_BUILD_ARCH}, amd64) +LIB_SIGAR_ARCH=amd64 +else +LIB_SIGAR_ARCH=x86 +endif + +override_dh_install: + install -d ${DESTDIR} + install -d ${DESTDIR}/bin + install -d ${DESTDIR}/config + install -d ${DESTDIR}/lib + install -d ${DESTDIR}/lib/sigar + cp bin/* ${DESTDIR}/bin/ + cp config/* ${DESTDIR}/config/ + cp lib/*.jar ${DESTDIR}/lib/ + cp lib/sigar/*.jar ${DESTDIR}/lib/sigar/ + cp lib/sigar/libsigar-${LIB_SIGAR_ARCH}-linux.so ${DESTDIR}/lib/sigar/ + +%: + dh $@ --- elasticsearch-0.16.0.orig/debian/compat +++ elasticsearch-0.16.0/debian/compat @@ -0,0 +1 @@ +7 --- elasticsearch-0.16.0.orig/debian/changelog +++ elasticsearch-0.16.0/debian/changelog @@ -0,0 +1,23 @@ +elasticsearch (0.16.0-0ubuntu1) lucid; urgency=low + + * New upstream release. + + -- Rui Lopes Mon, 25 Apr 2011 18:06:52 +0100 + +elasticsearch (0.15.2-0ubuntu3) lucid; urgency=low + + * Create and use the system account "elasticsearch" to run the daemon. + + -- Rui Lopes Mon, 25 Apr 2011 12:15:23 +0100 + +elasticsearch (0.15.2-0ubuntu2) lucid; urgency=low + + * Fix package build... + + -- Rui Lopes Mon, 25 Apr 2011 10:17:35 +0100 + +elasticsearch (0.15.2-0ubuntu1) lucid; urgency=low + + * Initial release. + + -- Rui Lopes Sat, 23 Apr 2011 13:17:09 +0100 --- elasticsearch-0.16.0.orig/debian/conffiles +++ elasticsearch-0.16.0/debian/conffiles @@ -0,0 +1,2 @@ +/opt/elasticsearch/config/elasticsearch.yml +/opt/elasticsearch/config/logging.yml