Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/59008
Change subject: Initial debian packaging using git-buildpackage ...................................................................... Initial debian packaging using git-buildpackage Change-Id: I2b317eba6cfdd54bf72855503682d9760e2db057 --- A debian/changelog A debian/compat A debian/control A debian/copyright A debian/dirs A debian/docs A debian/gbp.conf A debian/kafka.upstart A debian/postinst A debian/postrm A debian/rules A debian/source/format 12 files changed, 194 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/debs/kafka refs/changes/08/59008/1 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ac8c842 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +kafka (0.7.2-1) unstable; urgency=low + + * Initial Debian Packaging + + -- Andrew Otto (WMF) <[email protected]> Thu, 28 Feb 2013 20:40:29 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..42c9346 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: kafka +Section: utils +Priority: optional +Maintainer: Andrew Otto <[email protected]> +Build-Depends: debhelper (>= 8.0.0) +Build-Depends-Indep: default-jdk | sun-java6-jdk +Standards-Version: 3.9.3 +Homepage: http://kafka.apache.org/downloads.html + +Package: kafka +Architecture: any +Depends: ${misc:Depends}, adduser +Description: Apache Kafka is a distributed publish-subscribe messaging system. + Kafka provides a publish-subscribe solution that can handle all activity + stream data and processing on a consumer-scale web site. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..95bff51 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: kafka +Source: http://git-wip-us.apache.org/repos/asf/kafka.git + +License: Apache-2.0 + +Files: debian/* +Copyright: 2013 Andrew Otto <[email protected]> +License: Apache-2.0 + +License: Apache-2.0 + 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". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..ea381ba --- /dev/null +++ b/debian/dirs @@ -0,0 +1,3 @@ +usr/share/kafka +etc/kafka +var/log/kafka diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +README.md diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..8e3c14f --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,7 @@ +[DEFAULT] +pristine-tar = True +cleaner = fakeroot debian/rules clean + +[git-buildpackage] +export-dir = ../build-area + diff --git a/debian/kafka.upstart b/debian/kafka.upstart new file mode 100644 index 0000000..12ab726 --- /dev/null +++ b/debian/kafka.upstart @@ -0,0 +1,27 @@ +# Kafka Broker Service + +description "Kafka Broker" + +start on runlevel [2345] +stop on starting rc RUNLEVEL=[016] + +limit nofile 32768 32768 + +respawn +respawn limit 2 5 + +env CONFIG_HOME=/etc/kafka +env KAFKA_HOME=/usr/share/kafka +umask 007 + +kill timeout 300 + +pre-start script + #Sanity checks + [ -r $CONFIG_HOME/server.properties ] +end script + +setuid kafka +setgid kafka + +exec $KAFKA_HOME/bin/kafka-server-start.sh $CONFIG_HOME/server.properties diff --git a/debian/postinst b/debian/postinst new file mode 100644 index 0000000..c70b2ae --- /dev/null +++ b/debian/postinst @@ -0,0 +1,46 @@ +#!/bin/sh + +# preinst script for kafka +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * <new-preinst> `install' +# * <new-preinst> `install' <old-version> +# * <new-preinst> `upgrade' <old-version> +# * <old-preinst> `abort-upgrade' <new-version> +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure|reconfigure) + if ! getent passwd kafka >/dev/null; then + # Adding system user: kafka. + adduser \ + --system \ + --group \ + --home /var/lib/kafka \ + --gecos "Apache Kafka" \ + --shell /bin/false \ + kafka >/dev/null 2>/dev/null || : + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/postrm b/debian/postrm new file mode 100644 index 0000000..196869a --- /dev/null +++ b/debian/postrm @@ -0,0 +1,29 @@ +#!/bin/sh + +# postrm script for kafka +# +# see: dh_installdeb(1) + +set -e + +case "$1" in + remove) + ;; + + purge) + # remove kafka_user if it exists + if getent passwd kafka >/dev/null; then + deluser kafka + fi + ;; + + *) + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..1b1a230 --- /dev/null +++ b/debian/rules @@ -0,0 +1,31 @@ +#!/usr/bin/make -f + +# Get the java home directory for the version of java we are using +JAVA_HOME := $(shell /usr/sbin/update-java-alternatives --list | cut -d ' ' -f 3) + +%: + dh $@ + +override_dh_build: + dh_build + dh_testdir + dh_testroot + dh_prep + + # use ./sbt to build .jars + # See: http://incubator.apache.org/kafka/quickstart.html + $(CURDIR)/sbt update + $(CURDIR)/sbt package + +override_dh_install: + dh_install + dh_installdirs + + # install into usr/share/kafka + cp -rv `ls $(CURDIR) | grep -vP 'debian|config'` $(CURDIR)/debian/kafka/usr/share/kafka/ + + # install config files into /etc/kafka + cp $(CURDIR)/config/* $(CURDIR)/debian/kafka/etc/kafka/ + + # install upstart init file + dh_installinit --no-start --no-restart-on-upgrade --remove-d diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) -- To view, visit https://gerrit.wikimedia.org/r/59008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b317eba6cfdd54bf72855503682d9760e2db057 Gerrit-PatchSet: 1 Gerrit-Project: operations/debs/kafka Gerrit-Branch: master Gerrit-Owner: Ottomata <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
