<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
    mkdir -p $destdir/var/lib/logstash
    mkdir -p $destdir/var/run/logstash
    mkdir -p $destdir/var/log/logstash
    touch $destdir/etc/sysconfig/logstash
    install -m644 logrotate.conf $destdir/etc/logrotate.d/
    install -m755 logstash.sysv.redhat $destdir/etc/init.d/logstash
    ;;
      --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> - add sample sysconfig

<DFF> @@ -42,7 +42,7 @@ case $os@$release in
     mkdir -p $destdir/var/lib/logstash
     mkdir -p $destdir/var/run/logstash
     mkdir -p $destdir/var/log/logstash
-    touch $destdir/etc/sysconfig/logstash
+    cp $os/sysconfig $destdir/etc/sysconfig/logstash
     install -m644 logrotate.conf $destdir/etc/logrotate.d/
     install -m755 logstash.sysv.redhat $destdir/etc/init.d/logstash
     ;;

- add sample sysconfig