<NME> build.sh
<BEF> #!/bin/bash

basedir=$(dirname $0)/../
workdir=.

# Get version details
[ ! -f "$basedir/.VERSION.mk" ] && make -C $basedir .VERSION.mk
. $basedir/.VERSION.mk

if [ "$#" -ne 2 ] ; then
  echo "Usage: $0 os release"
  echo
  echo "Example: $0 ubuntu 12.10"
fi

silent() {
  "$@" > /dev/null 2>&1
}
log() {
  echo "$@" >&2
}
mkdir -p $destdir/$prefix

# install logstash.jar
cp $(dirname $0)/../build/logstash-$VERSION-monolithic.jar $destdir/$prefix

case $os@$release in
  centos@*)
}

case $os in
  centos|fedora|redhat|sl)
        _fpm -s dir -t rpm -n "logstash-kafka" -a all -v 1.2.1 --prefix /opt/logstash lib/ vendor/
    ;;
  ubuntu|debian)
    if ! echo $RELEASE | grep -q '\.(dev\|rc.*)'; then
      # This is a dev or RC version... So change the upstream version
      # example: 1.2.2.dev => 1.2.2~dev
      # This ensures a clean upgrade path.
      RELEASE="$(echo $RELEASE | sed 's/\.\(dev\|rc.*\)/~\1/')"
    fi

    _fpm -t deb --deb-user root --deb-group root \
      --iteration "1-$REVISION" --deb-ignore-iteration-in-dependencies \
      -d "logstash = $RELEASE" -v "$RELEASE" \
      -f -C $workdir/tarball --prefix /opt/logstash $(cat $workdir/files)
    ;;
esac

<MSG> build build build build

<DFF> @@ -22,7 +22,12 @@ fi
 mkdir -p $destdir/$prefix
 
 # install logstash.jar
-cp $(dirname $0)/../build/logstash-$VERSION-monolithic.jar $destdir/$prefix
+if [ ! -f "$(dirname $0)/../build/logstash-$VERSION-flatjar.jar" ] ; then
+  echo "Unable to find logstash-$VERSION-flatjar.jar"
+  exit 1
+fi
+
+cp $(dirname $0)/../build/logstash-$VERSION-flatjar $destdir/$prefix
 
 case $os@$release in
   centos@*)

build build build build