Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

All the cool stuff you need to build a kafka RPM.

  • Loading branch information...
commit e578cb8afdde4fedea111273598139e8f44878df 1 parent 88c11f7
@edwardcapriolo authored
View
14 LICENSE
@@ -0,0 +1,14 @@
+ Copyright 2012 Edward Capriolo
+
+ 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.
+
View
BIN  SOURCES/kafka-0.7.2.tar.gz
Binary file not shown
View
64 SOURCES/kafka-zookeeper.init
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# chkconfig: 345 99 01
+# description: kafka-zookeeper
+#
+# File : kafka-zookeeper
+#
+# Description: Starts and stops the kafka-zookeeper server
+#
+
+source /etc/rc.d/init.d/functions
+
+if [ -f /etc/sysconfig/kafka-zookeeper ]; then
+ source /etc/sysconfig/kafka-zookeeper
+fi
+
+KAFKA_HOME=${KAFKA_HOME=/opt/kafka}
+KAFKA_ZK_USER=${KAFKA_ZK_USER=zookeeper}
+# See how we were called.
+case "$1" in
+
+ start)
+ echo -n "Starting kafka-zookeeper:"
+ /sbin/runuser $KAFKA_ZK_USER -c "nohup $KAFKA_HOME/bin/zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties >> /var/log/zookeeper/server.out 2> /var/log/zookeeper/server.err &"
+ echo " done."
+ exit 0
+ ;;
+
+ stop)
+ echo -n "Stopping kafka-zookeeper: "
+ /sbin/runuser $KAFKA_ZK_USER -c "ps -ef | grep org.apache.zookeeper.server.quorum.QuorumPeerMain | grep -v grep | awk '{print \$2}' | xargs kill"
+ echo " done."
+ exit 0
+ ;;
+ hardstop)
+ echo -n "Stopping (hard) kafka-zookeeper: "
+ /sbin/runuser $KAFKA_ZK_USER -c "ps -ef | grep org.apache.zookeeper.server.quorum.QuorumPeerMain | grep -v grep | awk '{print \$2}' | xargs kill -9"
+ echo " done."
+ exit 0
+ ;;
+
+ status)
+ c_pid=`ps -ef | grep org.apache.zookeeper.server.quorum.QuorumPeerMain | grep -v grep | awk '{print $2}'`
+ if [ "$c_pid" = "" ] ; then
+ echo "Stopped"
+ exit 3
+ else
+ echo "Running $c_pid"
+ exit 0
+ fi
+ ;;
+
+ restart)
+ stop
+ start
+ ;;
+
+ *)
+ echo "Usage: kafka-zookeeper {start|stop|hardstop|status|restart}"
+ exit 1
+ ;;
+
+esac
+
View
60 SOURCES/kafka.init
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# chkconfig: 345 99 01
+# description: Kafka
+#
+# File : Kafka
+#
+# Description: Starts and stops the Kafka server
+#
+
+source /etc/rc.d/init.d/functions
+
+KAFKA_HOME=/opt/kafka
+KAFKA_USER=kafka
+# See how we were called.
+case "$1" in
+
+ start)
+ echo -n "Starting Kafka:"
+ /sbin/runuser $KAFKA_USER -c "nohup $KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties > /var/log/kafka/server.out 2> /var/log/kafka/server.err &"
+ echo " done."
+ exit 0
+ ;;
+
+ stop)
+ echo -n "Stopping Kafka: "
+ /sbin/runuser $KAFKA_USER -c "ps -ef | grep kafka.Kafka | grep -v grep | awk '{print \$2}' | xargs kill"
+ echo " done."
+ exit 0
+ ;;
+ hardstop)
+ echo -n "Stopping (hard) Kafka: "
+ /sbin/runuser $KAFKA_USER -c "ps -ef | grep kafka.Kafka | grep -v grep | awk '{print \$2}' | xargs kill -9"
+ echo " done."
+ exit 0
+ ;;
+
+ status)
+ c_pid=`ps -ef | grep kafka.Kafka | grep -v grep | awk '{print $2}'`
+ if [ "$c_pid" = "" ] ; then
+ echo "Stopped"
+ exit 3
+ else
+ echo "Running $c_pid"
+ exit 0
+ fi
+ ;;
+
+ restart)
+ stop
+ start
+ ;;
+
+ *)
+ echo "Usage: cassandra {start|stop|hardstop|status|restart}"
+ exit 1
+ ;;
+
+esac
+
View
18 SOURCES/sample_rpm_macro
@@ -0,0 +1,18 @@
+%packager m6d
+%distribution m6d.com
+%vendor m6d.com
+
+%_signature gpg
+%_gpg_name m6d.com
+
+%_topdir %(echo $HOME)/m6d
+%_tmppath %{_topdir}/tmp
+%_builddir %{_tmppath}
+
+#%_rpmtopdir %{_topdir}/%{name}
+#%_sourcedir %{_rpmtopdir}
+#%_specdir %{_rpmtopdir}
+#%_rpmdir %{_topdir}/RPMS
+#%_srcrpmdir %{_topdir}/RPMS
+#%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
+
View
73 SPECS/kafka.spec
@@ -0,0 +1,73 @@
+%define __jar_repack 0
+Summary: Kafka and distributed topic based producer consumer queue
+Name: kafka
+Version: 0.7.2
+Release: 1
+License: Apache (v2)
+Group: Applications
+Source0: ftp://ftp.nowhere.com/kafka-%{version}.tar.gz
+Source1: ftp://ftp.nowhere.com/kafka.init
+Source2: ftp://ftp.nowhere.com/kafka-zookeeper.init
+URL: http://kafka.apache.org
+#BuildRoot: tmp/kafka-0.7.1
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Distribution: m6d
+Vendor: m6d
+Packager: edlinuxguru@gmail.com
+
+Prereq: jdk >= 1.6
+
+%description
+Follow this example and you can do no wrong
+
+%prep
+
+%setup
+
+%build
+
+%install
+pwd
+mkdir -p $RPM_BUILD_ROOT/opt/kafka
+mkdir -p $RPM_BUILD_ROOT/opt/kafka/config
+
+cp -r bin $RPM_BUILD_ROOT/opt/kafka
+cp -r clients $RPM_BUILD_ROOT/opt/kafka/clients
+cp -r config $RPM_BUILD_ROOT/opt/kafka/config-sample
+
+cp -r contrib $RPM_BUILD_ROOT/opt/kafka/contrib
+cp -r core $RPM_BUILD_ROOT/opt/kafka/core
+cp -r examples $RPM_BUILD_ROOT/opt/kafka/examples
+cp -r lib $RPM_BUILD_ROOT/opt/kafka/lib
+cp -r lib_managed $RPM_BUILD_ROOT/opt/kafka/lib_managed
+cp -r perf $RPM_BUILD_ROOT/opt/kafka/perf
+cp -r project $RPM_BUILD_ROOT/opt/kafka/project
+cp sbt $RPM_BUILD_ROOT/opt/kafka/
+#cp -r system_test $RPM_BUILD_ROOT/opt/kafka/system_test #Do not need this
+
+mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -m 755 %{S:1} $RPM_BUILD_ROOT/etc/rc.d/init.d/kafka
+install -m 755 %{S:2} $RPM_BUILD_ROOT/etc/rc.d/init.d/kafka-zookeeper
+
+%files
+%defattr(-,root,root)
+
+%config %attr(755,root,root) /opt/kafka/config
+
+/opt/kafka
+/etc/rc.d/init.d/kafka
+/etc/rc.d/init.d/kafka-zookeeper
+
+%clean
+#used to cleanup things outside the build area and possibly inside.
+
+%changelog
+* Wed Jul 11 2012 Edward Capriolo <edward@m6d.com>
+- Rebuild against kafka trunk for mirror mode support
+* Mon May 7 2012 Edward Capriolo <edward@m6d.com>
+- Fix init scripts, clear conf dir, skip system test dir
+* Tue May 3 2012 Edward Capriolo <edward@m6d.com>
+- Taking care of business
+* Tue May 2 2012 Edward Capriolo <edward@m6d.com>
+- Oldest at the bottom
+
Please sign in to comment.
Something went wrong with that request. Please try again.