<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
}

os=$1
osver=$2

_fpm() {
  target=$1
  fpm -s dir -n logstash-kafka \
    -a noarch --url "https://github.com/joekiller/logstash-kafka.git" \
    --description "Logstash Kafka" \
    --vendor "na" \
    --license "Apache 2.0" \
    "$@"
}

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
    install -m644 logrotate.conf $destdir/etc/logrotate.d/
    install -m755 logstash.upstart.ubuntu $destdir/etc/init/logstash.conf
    ;;
  debian@*
    mkdir -p $destdir/etc/logrotate.d
    mkdir -p $destdir/etc/init.d
    mkdir -p $destdir/var/lib/logstash
      -f -C $workdir/tarball --prefix /opt/logstash $(cat $workdir/files)
    mkdir -p $destdir/var/log/logstash
    install -m644 logrotate.conf $destdir/etc/logrotate.d/
    install -m755 logstash.sysv.debian $destdir/etc/init.d/logstash
  *) 
    echo "Unknown OS: $os $release"
    exit 1
case $os in
  centos|fedora|redhat) 
    fpm -s dir -t rpm -n logstash -v "$VERSION" \
      -a noarch --iteration 1-$os \
      -d "jre >= 1.6.0" \
      --before-install centos/before-install.sh \
      --before-remove centos/before-remove.sh \

<MSG> - fix build

<DFF> @@ -44,7 +44,7 @@ case $os@$release in
     install -m644 logrotate.conf $destdir/etc/logrotate.d/
     install -m755 logstash.upstart.ubuntu $destdir/etc/init/logstash.conf
     ;;
-  debian@*
+  debian@*)
     mkdir -p $destdir/etc/logrotate.d
     mkdir -p $destdir/etc/init.d
     mkdir -p $destdir/var/lib/logstash
@@ -52,6 +52,7 @@ case $os@$release in
     mkdir -p $destdir/var/log/logstash
     install -m644 logrotate.conf $destdir/etc/logrotate.d/
     install -m755 logstash.sysv.debian $destdir/etc/init.d/logstash
+    ;;
   *) 
     echo "Unknown OS: $os $release"
     exit 1
@@ -62,7 +63,7 @@ description="logstash is a system for managing and processing events and logs"
 case $os in
   centos|fedora|redhat) 
     fpm -s dir -t rpm -n logstash -v "$VERSION" \
-      -a noarch --iteration 1-$os \
+      -a noarch --iteration 1_$os \
       -d "jre >= 1.6.0" \
       --before-install centos/before-install.sh \
       --before-remove centos/before-remove.sh \

- fix build