diff --git a/bin/kafka-run-class.sh b/bin/kafka-run-class.sh
index d2fc8c0..9d822fe 100755
--- a/bin/kafka-run-class.sh
+++ b/bin/kafka-run-class.sh
@@ -14,6 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
 if [ $# -lt 1 ];
 then
   echo "USAGE: $0 [-daemon] [-name servicename] [-loggc] classname [opts]"
@@ -22,11 +23,12 @@ fi
 
 base_dir=$(dirname $0)/..
 
-# create logs directory
-if [ "x$LOG_DIR" = "x" ]; then
-    LOG_DIR="$base_dir/logs"
-fi
 
+LIB_DIR=${LIB_DIR:-$base_dir/libs}
+CONFIG_DIR=${CONFIG_DIR:-$base_dir/config}
+LOG_DIR=${LOG_DIR:-$base_dir/logs}
+
+# create logs directory
 if [ ! -d "$LOG_DIR" ]; then
     mkdir -p "$LOG_DIR"
 fi
@@ -67,7 +69,7 @@ do
 done
 
 # classpath addition for release
-for file in $base_dir/libs/*.jar;
+for file in $LIB_DIR/*.jar;
 do
   CLASSPATH=$CLASSPATH:$file
 done
@@ -89,7 +91,7 @@ fi
 
 # Log4j settings
 if [ -z "$KAFKA_LOG4J_OPTS" ]; then
-  KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$base_dir/config/tools-log4j.properties"
+  KAFKA_LOG4J_OPTS="-Dlog4j.configuration=file:$CONFIG_DIR/tools-log4j.properties"
 fi
 
 KAFKA_LOG4J_OPTS="-Dkafka.logs.dir=$LOG_DIR $KAFKA_LOG4J_OPTS"
diff --git a/build.gradle b/build.gradle
index d6fd287..581dd55 100644
--- a/build.gradle
+++ b/build.gradle
@@ -13,6 +13,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+description "Apache Kafka is publish-subscribe messaging rethought as a distributed commit log."
+
 buildscript {
   repositories {
     mavenCentral()
@@ -120,9 +122,10 @@ tasks.create(name: "uploadArchivesAll", dependsOn: ['uploadCoreArchives_2_8_0',
 
 project(':core') {
   println "Building project 'core' with Scala version $scalaVersion"
-
   apply plugin: 'scala'
-  archivesBaseName = "kafka_${baseScalaVersion}"
+
+  archivesBaseName = "${rootProject.name}_${baseScalaVersion}"
+  ext.distributionBaseName = "${archivesBaseName}-${version}"
 
   def (major, minor, trivial) = scalaVersion.tokenize('.')
 
@@ -189,15 +192,56 @@ project(':core') {
     into "$buildDir/dependant-libs-${scalaVersion}"
   }
 
-  tasks.create(name: "releaseTarGz", dependsOn: configurations.archives.artifacts, type: Tar) { 
-    into "kafka_${baseScalaVersion}-${version}"
-    compression = Compression.GZIP 
-    from(project.file("../bin")) { into "bin/" }
+
+
+  task releaseDeb(type:Exec, dependsOn:["distDir"]) {
+
+    commandLine 'fpm',
+        "-t", "deb",
+        "-s", "dir",
+        "-C", "${project.distsDir}/${distributionBaseName}",
+        "--force",
+        "--version", version,
+        "--package", "${project.distsDir}/${distributionBaseName}.deb",
+        "--name", "kafka",
+        "--description" , rootProject.description,
+        "--url", "https://kafka.apache.org",
+        "--license", "apache2",
+        "--maintainer", "Apache Kafka Developers <dev@kafka.apache.org>",
+        "--vendor", "Apache Kafka",
+        "--exclude", "*windows*",
+        "--category", "net",
+        "--post-install", "${rootProject.projectDir}/packaging/debian/control/postinstall",
+        "--pre-uninstall", "${rootProject.projectDir}/packaging/debian/control/preuninstall",
+        "--post-uninstall", "${rootProject.projectDir}/packaging/debian/control/postuninstall",
+        "--deb-init", "${rootProject.projectDir}/packaging/debian/init.d/kafka",
+        "--deb-default", "${rootProject.projectDir}/packaging/debian/default/kafka",
+
+        // files to map
+        "bin=/usr/lib/kafka",
+        "libs=/usr/lib/kafka",
+        "config/producer.properties=/etc/kafka/producer.properties",
+        "config/consumer.properties=/etc/kafka/consumer.properties",
+        "config/log4j.properties=/etc/kafka/log4j.properties",
+        "config/server.properties=/etc/kafka/server.properties",
+        "config/zookeeper.properties=/etc/kafka/zookeeper.properties",
+        "config/tools-log4j.properties=/etc/kafka/tools-log4j.properties"
+  }
+
+  tasks.create(name: "distDir", dependsOn: [configurations.archives.artifacts], type: Copy) {
+    from (project.file("../bin")) {into "bin/"}
     from(project.file("../config")) { into "config/" }
     from '../LICENSE'
     from '../NOTICE'
     from(configurations.runtime) { into("libs/") }
     from(configurations.archives.artifacts.files) { into("libs/") }
+    into "${project.distsDir}/${distributionBaseName}"
+  }
+
+  tasks.create(name: "releaseTarGz", dependsOn: ["distDir"], type: Tar) {
+    into distributionBaseName
+    compression = Compression.GZIP
+    from "${project.distsDir}/${distributionBaseName}"
   }
   
   jar {
diff --git a/packaging/debian/control/postinstall b/packaging/debian/control/postinstall
new file mode 100644
index 0000000..a271950
--- /dev/null
+++ b/packaging/debian/control/postinstall
@@ -0,0 +1,46 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+    configure)
+
+	[ -f /etc/default/kafka ] && . /etc/default/kafka
+	[ -z "$KAFKA_USER" ] && KAFKA_USER="kafka"
+	[ -z "$KAFKA_GROUP" ] && KAFKA_GROUP="kafka"
+	if ! getent group "$KAFKA_GROUP" > /dev/null 2>&1 ; then
+	    addgroup --system "$KAFKA_GROUP" --quiet
+	fi
+	if ! id $KAFKA_USER > /dev/null 2>&1 ; then
+	    adduser --system --home /usr/lib/kafka --no-create-home \
+		--ingroup "$KAFKA_GROUP" --disabled-password --shell /bin/false \
+		"$KAFKA_USER"
+	fi
+
+	# Set user permissions on /var/log/kafka and /usr/lib/kafka
+	mkdir -p /var/log/kafka /usr/lib/kafka
+	chown -R $KAFKA_USER:$KAFKA_GROUP /var/log/kafka /usr/lib/kafka
+	chmod 755 /var/log/kafka /usr/lib/kafka
+
+    # symlink log directory
+    ln -s /var/log/kafka /usr/lib/kafka/logs
+
+    # symlink config directory
+    ln -s /etc/kafka /usr/lib/kafka/config
+
+	# configuration files should not be modifiable by kafka user, as this can be a security issue
+	chown -Rh root:root /etc/kafka/*
+	chmod 755 /etc/kafka
+	chmod 644 /etc/kafka/*
+    ;;
+
+esac
+
+
+if [ -x "/etc/init.d/kafka" ]; then
+	update-rc.d kafka defaults 95 10 >/dev/null
+	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d kafka start || true
+	else
+		/etc/init.d/kafka start || true
+	fi
+fi
\ No newline at end of file
diff --git a/packaging/debian/control/postuninstall b/packaging/debian/control/postuninstall
new file mode 100644
index 0000000..6a2b8bb
--- /dev/null
+++ b/packaging/debian/control/postuninstall
@@ -0,0 +1,30 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+    remove)
+        # Remove logs
+        rm -rf /var/log/kafka
+    ;;
+
+    purge)
+        # Remove service
+        update-rc.d kafka remove >/dev/null || true
+
+        # Remove logs and data
+        rm -rf /var/log/kafka
+
+        # Remove user/group
+        deluser kafka || true
+        delgroup kafka || true
+    ;;
+
+    upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+        # Nothing to do here
+    ;;
+
+    *)
+        echo "$0 called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
\ No newline at end of file
diff --git a/packaging/debian/control/preuninstall b/packaging/debian/control/preuninstall
new file mode 100644
index 0000000..e2c7e03
--- /dev/null
+++ b/packaging/debian/control/preuninstall
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+
+if [ -x "/etc/init.d/kafka" ]; then
+	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+		invoke-rc.d kafka stop || true
+	else
+		/etc/init.d/kafka stop || true
+	fi
+fi
+
+rm -f /usr/lib/kafka/logs /usr/lib/kafka/config
diff --git a/packaging/debian/default/kafka b/packaging/debian/default/kafka
new file mode 100644
index 0000000..b868109
--- /dev/null
+++ b/packaging/debian/default/kafka
@@ -0,0 +1,4 @@
+export LIB_DIR=/usr/lib/kafka/libs
+export CONFIG_DIR=/etc/kafka
+export LOG_DIR=/var/log/kafka
+export DISABLED=true
\ No newline at end of file
diff --git a/packaging/debian/init.d/kafka b/packaging/debian/init.d/kafka
new file mode 100755
index 0000000..a4e49cb
--- /dev/null
+++ b/packaging/debian/init.d/kafka
@@ -0,0 +1,165 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          kafka
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: start kafka broker node
+### END INIT INFO
+
+# Do NOT "set -e"
+
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Kafka broker service"
+NAME=kafka
+DAEMON_ARGS=""
+PIDFILE=/var/run/$NAME.pid
+SCRIPTNAME=/etc/init.d/$NAME
+USER=kafka
+
+# Read configuration variable file if it is present
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+if ( [ -n $DISABLED ] && [ "$DISABLED" = "true" ] ) ; then
+  echo "service is disable in /etc/default/$NAME"
+  exit 0
+fi
+
+CONFIG_DIR=${CONFIG_DIR:-/etc/$NAME}
+LIB_DIR=${LIB_DIR:-/usr/lib/$NAME/libs}
+BIN_DIR=${BIN_DIR:-/usr/lib/$NAME/bin}
+
+# If ulimit nofiles was set in $DEFAULT,
+# then change the limit for this process now.
+# This will not set nofiles higher than
+# system limit.
+if [ -n "$NOFILES_ULIMIT" ]; then
+    ulimit -n "$NOFILES_ULIMIT"
+fi
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
+# and status_of_proc is working.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+
+# Return
+#   0 if daemon has been started
+#   1 if daemon was already running
+#   2 if daemon could not be started
+start-stop-daemon --background --chuid $USER --user $USER --make-pidfile --start --pidfile $PIDFILE --exec $BIN_DIR/kafka-server-start.sh -- $CONFIG_DIR/server.properties \
+$DAEMON_ARGS \
+|| return 2
+# Add code here, if necessary, that waits for the process to be ready
+# to handle requests from services started subsequently which depend
+# on this one.  As a last resort, sleep for some time.
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+# Return
+#   0 if daemon has been stopped
+#   1 if daemon was already stopped
+#   2 if daemon could not be stopped
+#   other if a failure occurred
+start-stop-daemon --user $USER --stop --retry=TERM/30/KILL/5 --pidfile $PIDFILE
+RETVAL="$?"
+[ "$RETVAL" = 2 ] && return 2
+# Wait for children to finish too if this is a daemon that forks
+# and if the daemon is only ever run from this initscript.
+# If the above conditions are not satisfied then add some other code
+# that waits for the process to drop all resources that could be
+# needed by services started subsequently.  A last resort is to
+# sleep for some time.
+start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $BIN_DIR/kafka-server-stop.sh
+[ "$?" = 2 ] && return 2
+# Many daemons don't delete their pidfiles when they exit.
+rm -f $PIDFILE
+return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+#
+# If the daemon can reload its configuration without
+# restarting (for example, when it is sent a SIGHUP),
+# then implement that here.
+#
+start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+return 0
+}
+
+case "$1" in
+  start)
+[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+do_start
+case "$?" in
+0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+esac
+;;
+  stop)
+[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+do_stop
+case "$?" in
+0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
+2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
+esac
+;;
+  status)
+       status_of_proc "$NAME" && exit 0 || exit $?
+       ;;
+  #reload|force-reload)
+#
+# If do_reload() is not implemented then leave this commented out
+# and leave 'force-reload' as an alias for 'restart'.
+#
+#log_daemon_msg "Reloading $DESC" "$NAME"
+#do_reload
+#log_end_msg $?
+#;;
+  restart|force-reload)
+#
+# If the "reload" option is implemented then remove the
+# 'force-reload' alias
+#
+log_daemon_msg "Restarting $DESC" "$NAME"
+do_stop
+case "$?" in
+  0|1)
+do_start
+case "$?" in
+0) log_end_msg 0 ;;
+1) log_end_msg 1 ;; # Old process is still running
+*) log_end_msg 1 ;; # Failed to start
+esac
+;;
+  *)
+  # Failed to stop
+log_end_msg 1
+;;
+esac
+;;
+  *)
+#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
+exit 3
+;;
+esac
+
+:
