Repository: bigtop
Updated Branches:
  refs/heads/master 7e5a9225f -> 1f11c766d


BIGTOP-1126. Add Hama to Bigtop

Signed-off-by: YoungWoo Kim <yw...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/1f11c766
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/1f11c766
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/1f11c766

Branch: refs/heads/master
Commit: 1f11c766df34d1b878350fe86c569262dfefcc58
Parents: 7e5a922
Author: Minho Kim <minwise....@samsung.com>
Authored: Wed Aug 12 09:55:09 2015 +0900
Committer: YoungWoo Kim <yw...@apache.org>
Committed: Wed Aug 19 09:05:17 2015 +0900

----------------------------------------------------------------------
 MAINTAINERS.txt                                 |   1 +
 .../src/common/hama/conf.pseudo/hama-site.xml   |  58 ++++
 .../src/common/hama/do-component-build          |  21 ++
 .../src/common/hama/hama-bspmaster.init         | 158 +++++++++++
 bigtop-packages/src/common/hama/hama-groom.init | 159 +++++++++++
 bigtop-packages/src/common/hama/hama.default    |  17 ++
 bigtop-packages/src/common/hama/install_hama.sh | 171 ++++++++++++
 bigtop-packages/src/deb/hama/changelog          |   1 +
 bigtop-packages/src/deb/hama/compat             |   1 +
 bigtop-packages/src/deb/hama/control            |  67 +++++
 bigtop-packages/src/deb/hama/copyright          |  16 ++
 .../src/deb/hama/hama-bspmaster.postinst        |  25 ++
 .../src/deb/hama/hama-conf-pseudo.dirs          |   1 +
 .../src/deb/hama/hama-conf-pseudo.install       |   1 +
 .../src/deb/hama/hama-conf-pseudo.postinst      |  61 ++++
 .../src/deb/hama/hama-conf-pseudo.prerm         |  57 ++++
 bigtop-packages/src/deb/hama/hama-doc.dirs      |   1 +
 bigtop-packages/src/deb/hama/hama-doc.install   |   1 +
 .../src/deb/hama/hama-groom.postinst            |  25 ++
 bigtop-packages/src/deb/hama/hama.dirs          |   4 +
 bigtop-packages/src/deb/hama/hama.install       |   4 +
 bigtop-packages/src/deb/hama/hama.postinst      |  36 +++
 bigtop-packages/src/deb/hama/hama.preinst       |  62 +++++
 bigtop-packages/src/deb/hama/hama.prerm         |  57 ++++
 bigtop-packages/src/deb/hama/rules              | 103 +++++++
 bigtop-packages/src/rpm/hama/BUILD/.gitignore   |   0
 bigtop-packages/src/rpm/hama/RPMS/.gitignore    |   0
 bigtop-packages/src/rpm/hama/SOURCES/.gitignore |   0
 bigtop-packages/src/rpm/hama/SPECS/hama.spec    | 276 +++++++++++++++++++
 bigtop-packages/src/rpm/hama/SRPMS/.gitignore   |   0
 bigtop.mk                                       |  14 +
 31 files changed, 1398 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/MAINTAINERS.txt
----------------------------------------------------------------------
diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt
index fb22c4b..4b0cbf3 100644
--- a/MAINTAINERS.txt
+++ b/MAINTAINERS.txt
@@ -3,6 +3,7 @@ flume: bmahe
 gradle / build system: cos, rvs
 ignite-hadoop: cos, Sergey Vladykin <sergi.vlady...@gmail.com>
 hadoop: mark grover, cos, rvs
+hama: minho kim <mi...@apache.org>, edward j. yoon
 hbase: andrew purtell, rvs
 hive: mark grover, youngwoo kim
 hue: oflebbe

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/common/hama/conf.pseudo/hama-site.xml
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hama/conf.pseudo/hama-site.xml 
b/bigtop-packages/src/common/hama/conf.pseudo/hama-site.xml
new file mode 100644
index 0000000..759cf9e
--- /dev/null
+++ b/bigtop-packages/src/common/hama/conf.pseudo/hama-site.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ * Copyright 2007 The Apache Software Foundation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+-->
+<configuration>
+       <property>
+               <name>bsp.master.address</name>
+               <value>localhost:40000</value>
+               <description>The address of the bsp master server. Either the
+                       literal string "local" or a host:port for distributed 
mode
+               </description>
+       </property>
+
+       <property>
+               <name>fs.default.name</name>
+               <value>local</value>
+               <description>
+                       The name of the default file system. Either the literal 
string
+                       "local" or a host:port for HDFS.
+               </description>
+       </property>
+
+       <property>
+               <name>hama.zookeeper.quorum</name>
+               <value>localhost</value>
+               <description>Comma separated list of servers in the ZooKeeper 
Quorum.
+                       For example, 
"host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
+                       By default this is set to localhost for local and 
pseudo-distributed modes
+                       of operation. For a fully-distributed setup, this 
should be set to a full
+                       list of ZooKeeper quorum servers. If HAMA_MANAGES_ZK is 
set in hama-env.sh
+                       this is the list of servers which we will start/stop 
zookeeper on.
+               </description>
+       </property>
+
+       <property>
+               <name>hama.zookeeper.property.clientPort</name>
+               <value>2181</value>
+       </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/common/hama/do-component-build
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hama/do-component-build 
b/bigtop-packages/src/common/hama/do-component-build
new file mode 100644
index 0000000..2e1ddc8
--- /dev/null
+++ b/bigtop-packages/src/common/hama/do-component-build
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+set -ex
+
+. `dirname $0`/bigtop.bom
+
+mvn -Phadoop2 -Dhadoop.version=$HADOOP_VERSION 
-Dzookeeper.version=$ZOOKEEPER_VERSION clean install -DskipTests "$@"

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/common/hama/hama-bspmaster.init
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hama/hama-bspmaster.init 
b/bigtop-packages/src/common/hama/hama-bspmaster.init
new file mode 100644
index 0000000..b16051d
--- /dev/null
+++ b/bigtop-packages/src/common/hama/hama-bspmaster.init
@@ -0,0 +1,158 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+# Starts an Apache Hama BSP Master
+#
+# chkconfig: 2345 90 10
+# description: Apache Hama BSP Master
+#
+### BEGIN INIT INFO
+# Provides:          hama-bspmaster
+# Required-Start:    $remote_fs
+# Should-Start:
+# Required-Stop:     $remote_fs
+# Should-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Apache Hama BSP Master
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+if [ -f /etc/default/hama ] ; then
+  . /etc/default/hama
+fi
+
+# Autodetect JAVA_HOME if not defined
+if [ -e /usr/libexec/bigtop-detect-javahome ]; then
+  . /usr/libexec/bigtop-detect-javahome
+elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
+  . /usr/lib/bigtop-utils/bigtop-detect-javahome
+fi
+
+STATUS_RUNNING=0
+STATUS_DEAD=1
+STATUS_DEAD_AND_LOCK=2
+STATUS_NOT_RUNNING=3
+
+ERROR_PROGRAM_NOT_INSTALLED=5
+
+HAMA_RUN_DIR=/var/run/hama
+HAMA_LOCK_DIR="/var/lock/subsys/"
+LOCKFILE="${HAMA_LOCK_DIR}/hama-bspmaster"
+desc="Apache Hama BSP Master"
+
+HAMA_USER=hama
+EXEC_PATH=/usr/bin/hama
+HAMA_PID_FILE="${HAMA_RUN_DIR}/hama-bspmaster.pid"
+HAMA_LOG_FILE="${HAMA_LOG_DIR}/hama-bspmaster.log"
+
+# These directories may be tmpfs and may or may not exist
+# depending on the OS (ex: /var/lock/subsys does not exist on debian/ubuntu)
+for dir in "$HAMA_RUN_DIR" "$HAMA_LOCK_DIR"; do
+  [ -d "${dir}" ] || install -d -m 0755 -o $HAMA_USER -g $HAMA_USER ${dir}
+done
+
+start() {
+  [ -x $exec ] || exit $ERROR_PROGRAM_NOT_INSTALLED
+
+  checkstatus &> /dev/null
+  status=$?
+  if [ "$status" -eq "$STATUS_RUNNING" ]; then
+    exit 0
+  fi
+
+  log_success_msg "Starting $desc: "
+  /bin/su -s /bin/bash -c "/bin/bash -c 'echo \$\$ > ${HAMA_PID_FILE} && exec 
${EXEC_PATH} bspmaster >>${HAMA_LOG_FILE} 2>&1' &" $USER
+  RETVAL=$?
+  [ $RETVAL -eq 0 ] && touch $LOCKFILE
+  return $RETVAL
+}
+
+stop() {
+  if [ ! -e $HAMA_PID_FILE ]; then
+    log_failure_msg "Apache Hama BSP Master is not running"
+    exit 0
+  fi
+
+  log_success_msg "Stopping $desc: "
+
+  HAMA_PID=`cat $HAMA_PID_FILE`
+  if [ -n $HAMA_PID ]; then
+    kill -TERM ${HAMA_PID} &>/dev/null
+    sleep 5
+    kill -KILL ${HAMA_PID} &>/dev/null
+  fi
+  rm -f $LOCKFILE $HAMA_PID_FILE
+  return 0
+}
+
+restart() {
+  stop
+  start
+}
+
+checkstatus(){
+  pidofproc -p $HAMA_PID_FILE java > /dev/null
+  status=$?
+
+  case "$status" in
+    $STATUS_RUNNING)
+      log_success_msg "$desc is running"
+      ;;
+    $STATUS_DEAD)
+      log_failure_msg "$desc is dead and pid file exists"
+      ;;
+    $STATUS_DEAD_AND_LOCK)
+      log_failure_msg "$desc is dead and lock file exists"
+      ;;
+    $STATUS_NOT_RUNNING)
+      log_failure_msg "$desc is not running"
+      ;;
+    *)
+      log_failure_msg "$desc status is unknown"
+      ;;
+  esac
+  return $status
+}
+
+condrestart(){
+  [ -e ${LOCKFILE} ] && restart || :
+}
+
+case "$1" in
+  start)
+    start
+    ;;
+  stop)
+    stop
+    ;;
+  status)
+    checkstatus
+    ;;
+  restart)
+    restart
+    ;;
+  condrestart|try-restart)
+    condrestart
+    ;;
+  *)
+    echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
+    exit 1
+esac
+
+exit $RETVAL

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/common/hama/hama-groom.init
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hama/hama-groom.init 
b/bigtop-packages/src/common/hama/hama-groom.init
new file mode 100644
index 0000000..4fac6e9
--- /dev/null
+++ b/bigtop-packages/src/common/hama/hama-groom.init
@@ -0,0 +1,159 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+# Starts an Apache Hama Groom node
+#
+# chkconfig: 2345 90 10
+# description: Apache Hama Groom node
+#
+### BEGIN INIT INFO
+# Provides:          hama-groom
+# Required-Start:    $remote_fs
+# Should-Start:
+# Required-Stop:     $remote_fs
+# Should-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Apache Hama Groom node
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+if [ -f /etc/default/hama ] ; then
+  . /etc/default/hama
+fi
+
+# Autodetect JAVA_HOME if not defined
+if [ -e /usr/libexec/bigtop-detect-javahome ]; then
+  . /usr/libexec/bigtop-detect-javahome
+elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
+  . /usr/lib/bigtop-utils/bigtop-detect-javahome
+fi
+
+STATUS_RUNNING=0
+STATUS_DEAD=1
+STATUS_DEAD_AND_LOCK=2
+STATUS_NOT_RUNNING=3
+
+ERROR_PROGRAM_NOT_INSTALLED=5
+
+HAMA_RUN_DIR=/var/run/hama
+HAMA_LOCK_DIR="/var/lock/subsys/"
+LOCKFILE="${HAMA_LOCK_DIR}/hama-groom"
+desc="Apache Hama Groom node"
+
+HAMA_USER=hama
+EXEC_PATH=/usr/bin/hama
+HAMA_PID_FILE="${HAMA_RUN_DIR}/hama-groom.pid"
+HAMA_LOG_FILE="${HAMA_LOG_DIR}/hama-groom.log"
+
+# These directories may be tmpfs and may or may not exist
+# depending on the OS (ex: /var/lock/subsys does not exist on debian/ubuntu)
+for dir in "$HAMA_RUN_DIR" "$HAMA_LOCK_DIR"; do
+  [ -d "${dir}" ] || install -d -m 0755 -o $HAMA_USER -g $HAMA_USER ${dir}
+done
+
+
+start() {
+  [ -x $exec ] || exit $ERROR_PROGRAM_NOT_INSTALLED
+
+  checkstatus
+  status=$?
+  if [ "$status" -eq "$STATUS_RUNNING" ]; then
+    exit 0
+  fi
+
+  log_success_msg "Starting $desc: "
+  /bin/su -s /bin/bash -c "/bin/bash -c 'echo \$\$ > ${HAMA_PID_FILE} && exec 
${EXEC_PATH} groom >>${HAMA_LOG_FILE} 2>&1' &" $HAMA_USER
+  RETVAL=$?
+  [ $RETVAL -eq 0 ] && touch $LOCKFILE
+  return $RETVAL
+}
+
+stop() {
+  if [ ! -e $HAMA_PID_FILE ]; then
+    log_failure_msg "Apache Hama Groom node is not running"
+    exit 0
+  fi
+
+  log_success_msg "Stopping $desc: "
+
+  HAMA_PID=`cat $HAMA_PID_FILE`
+  if [ -n $HAMA_PID ]; then
+    kill -TERM ${HAMA_PID} &>/dev/null
+    sleep 5
+    kill -KILL ${HAMA_PID} &>/dev/null
+  fi
+  rm -f $LOCKFILE $HAMA_PID_FILE
+  return 0
+}
+
+restart() {
+  stop
+  start
+}
+
+checkstatus(){
+  pidofproc -p $HAMA_PID_FILE java > /dev/null
+  status=$?
+
+  case "$status" in
+    $STATUS_RUNNING)
+      log_success_msg "$desc is running"
+      ;;
+    $STATUS_DEAD)
+      log_failure_msg "$desc is dead and pid file exists"
+      ;;
+    $STATUS_DEAD_AND_LOCK)
+      log_failure_msg "$desc is dead and lock file exists"
+      ;;
+    $STATUS_NOT_RUNNING)
+      log_failure_msg "$desc is not running"
+      ;;
+    *)
+      log_failure_msg "$desc status is unknown"
+      ;;
+  esac
+  return $status
+}
+
+condrestart(){
+  [ -e ${LOCKFILE} ] && restart || :
+}
+
+case "$1" in
+  start)
+    start
+    ;;
+  stop)
+    stop
+    ;;
+  status)
+    checkstatus
+    ;;
+  restart)
+    restart
+    ;;
+  condrestart|try-restart)
+    condrestart
+    ;;
+  *)
+    echo $"Usage: $0 {start|stop|status|restart|try-restart|condrestart}"
+    exit 1
+esac
+
+exit $RETVAL

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/common/hama/hama.default
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hama/hama.default 
b/bigtop-packages/src/common/hama/hama.default
new file mode 100644
index 0000000..b6f56c6
--- /dev/null
+++ b/bigtop-packages/src/common/hama/hama.default
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+export HAMA_HOME=/usr/lib/hama
+export HAMA_CONF_DIR=/etc/hama/conf
+export HAMA_LOG_DIR=/var/log/hama

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/common/hama/install_hama.sh
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/common/hama/install_hama.sh 
b/bigtop-packages/src/common/hama/install_hama.sh
new file mode 100644
index 0000000..1878e79
--- /dev/null
+++ b/bigtop-packages/src/common/hama/install_hama.sh
@@ -0,0 +1,171 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+set -e
+
+usage() {
+  echo "
+usage: $0 <options>
+  Required not-so-options:
+     --build-dir=DIR             path to Hama dist.dir
+     --prefix=PREFIX             path to install into
+
+  Optional options:
+     --distro-dir=DIR            path to distro specific files (debian/RPM)
+     --doc-dir=DIR               path to install docs into 
[/usr/share/doc/hama]
+     --lib-dir=DIR               path to install hama home [/usr/lib/hama]
+     --installed-lib-dir=DIR     path where lib-dir will end up on target 
system
+     --bin-dir=DIR               path to install bins [/usr/bin]
+     --examples-dir=DIR          path to install examples [doc-dir/examples]
+     ... [ see source for more similar options ]
+  "
+  exit 1
+}
+
+OPTS=$(getopt \
+  -n $0 \
+  -o '' \
+  -l 'prefix:' \
+  -l 'doc-dir:' \
+  -l 'lib-dir:' \
+  -l 'etc-dir:' \
+  -l 'distro-dir:' \
+  -l 'installed-lib-dir:' \
+  -l 'bin-dir:' \
+  -l 'examples-dir:' \
+  -l 'build-dir:' -- "$@")
+
+if [ $? != 0 ] ; then
+    usage
+fi
+
+eval set -- "$OPTS"
+while true ; do
+    case "$1" in
+        --prefix)
+        PREFIX=$2 ; shift 2
+        ;;
+        --build-dir)
+        BUILD_DIR=$2 ; shift 2
+        ;;
+        --doc-dir)
+        DOC_DIR=$2 ; shift 2
+        ;;
+        --distro-dir)
+        DISTRO_DIR=$2 ; shift 2
+        ;;
+        --lib-dir)
+        LIB_DIR=$2 ; shift 2
+        ;;
+        --etc-dir)
+        ETC_DIR=$2 ; shift 2
+        ;;
+        --installed-lib-dir)
+        INSTALLED_LIB_DIR=$2 ; shift 2
+        ;;
+        --bin-dir)
+        BIN_DIR=$2 ; shift 2
+        ;;
+        --examples-dir)
+        EXAMPLES_DIR=$2 ; shift 2
+        ;;
+        --)
+        shift ; break
+        ;;
+        *)
+        echo "Unknown option: $1"
+        usage
+        exit 1
+        ;;
+    esac
+done
+
+for var in PREFIX BUILD_DIR DISTRO_DIR; do
+  if [ -z "$(eval "echo \$$var")" ]; then
+    echo Missing param: $var
+    usage
+  fi
+done
+
+MAN_DIR=${MAN_DIR:-/usr/share/man/man1}
+DOC_DIR=${DOC_DIR:-/usr/share/doc/hama}
+LIB_DIR=${LIB_DIR:-/usr/lib/hama}
+INSTALLED_LIB_DIR=${INSTALLED_LIB_DIR:-/usr/lib/hama}
+EXAMPLES_DIR=${EXAMPLES_DIR:-$DOC_DIR/examples}
+BIN_DIR=${BIN_DIR:-/usr/bin}
+
+CONF_DIR=/etc/hama/
+CONF_DIST_DIR=${CONF_DIR}/conf.dist/
+ETC_DIR=${ETC_DIR:-${CONF_DIST_DIR}}
+
+install -d -m 0755 $PREFIX/$LIB_DIR
+install -d -m 0755 $PREFIX/$LIB_DIR/bin
+install -d -m 0755 $PREFIX/$LIB_DIR/lib
+install -d -m 0755 $PREFIX/$LIB_DIR/conf
+install -d -m 0755 $PREFIX/$DOC_DIR
+install -d -m 0755 $PREFIX/$ETC_DIR
+install -d -m 0777 $PREFIX/$LIB_DIR/logs
+
+cp -ra ${BUILD_DIR}/lib/* $PREFIX/${LIB_DIR}/lib/
+cp ${BUILD_DIR}/hama*.jar $PREFIX/$LIB_DIR
+cp -a ${BUILD_DIR}/*.txt $PREFIX/$DOC_DIR
+cp -a ${BUILD_DIR}/docs/* $PREFIX/$DOC_DIR
+cp -a ${BUILD_DIR}/bin/* $PREFIX/${LIB_DIR}/bin
+cp -a ${BUILD_DIR}/conf/* $PREFIX/${ETC_DIR}
+
+# Remove unnecessary files
+for f in hama-daemon.sh hama-daemons.sh start-bspd.sh stop-bspd.sh 
zookeepers.sh; do
+  rm -fv $PREFIX/${LIB_DIR}/bin/$f
+done
+
+# Copy in the /usr/bin/hama wrapper
+install -d -m 0755 $PREFIX/$BIN_DIR
+cat > $PREFIX/$BIN_DIR/hama <<EOF
+
+#!/bin/sh
+
+# Autodetect JAVA_HOME if not defined
+if [ -e /usr/libexec/bigtop-detect-javahome ]; then
+  . /usr/libexec/bigtop-detect-javahome
+elif [ -e /usr/lib/bigtop-utils/bigtop-detect-javahome ]; then
+  . /usr/lib/bigtop-utils/bigtop-detect-javahome
+fi
+
+. /etc/default/hadoop
+. /etc/default/hama
+
+#FIXME: the following line is a workaround for BIGTOP-259
+export HADOOP_CLASSPATH="`echo 
/usr/lib/hama/hama-examples-*-job.jar`":\$HADOOP_CLASSPATH
+exec $INSTALLED_LIB_DIR/bin/hama "\$@"
+EOF
+chmod 755 $PREFIX/$BIN_DIR/hama
+
+
+# Make the pseudo-distributed config
+for conf in conf.pseudo ; do
+  install -d -m 0755 $PREFIX/$CONF_DIR/$conf
+  # Install the default configurations
+  (cd ${BUILD_DIR}/conf && tar -cf - .) | (cd $PREFIX/$CONF_DIR/$conf && tar 
-xf -)
+  # Overlay the -site files
+  (cd $DISTRO_DIR/$conf && tar -cf - .) | (cd $PREFIX/$CONF_DIR/$conf && tar 
-xf -)
+  # When building straight out of svn we have to account for pesky .svn subdirs
+  rm -rf `find $PREFIX/$CONF_DIR/$conf -name .svn -type d`
+done
+
+
+
+

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/changelog
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/changelog 
b/bigtop-packages/src/deb/hama/changelog
new file mode 100644
index 0000000..d4858cd
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/changelog
@@ -0,0 +1 @@
+--- This is auto-generated

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/compat
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/compat 
b/bigtop-packages/src/deb/hama/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/compat
@@ -0,0 +1 @@
+9

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/control
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/control 
b/bigtop-packages/src/deb/hama/control
new file mode 100644
index 0000000..288624a
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/control
@@ -0,0 +1,67 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+Source: hama
+Section: misc
+Priority: extra
+Maintainer: BigTop
+Build-Depends: debhelper (>= 9)
+Standards-Version: 3.9.4
+Homepage: http://hama.apache.org
+
+Package:  hama
+Architecture: all
+Depends: hadoop, bigtop-utils, zookeeper
+Description: Hama is a pure BSP(Bulk Synchronous Parallel) computing
+ framework on
+ top of HDFS (Hadoop Distributed File System) for massive scientific
+ computations such as matrix, graph and network algorithms.
+
+Package:  hama-bspmaster
+Architecture: all
+Depends: hama (= ${source:Version})
+Description: Maintain the global state of Apache Hama services
+ BSPMaster is responsible for the following:
+ - Maintaining groom server status.
+ - Maintaining supersteps and other counters in a cluster.
+ - Maintaining job progress information.
+ - Scheduling Jobs and assigning tasks to groom servers
+ - Distributing execution classes and configuration across groom servers.
+ - Providing users with the cluster control interface (web and console based).
+
+Package:  hama-groom
+Architecture: all
+Depends: hama (= ${source:Version})
+Description: A Groom Server (shortly referred to as groom) is a process that 
launches bsp tasks assigned by BSPMaster
+ A Groom Server (shortly referred to as groom) is a process that launches bsp 
tasks
+ assigned by BSPMaster. Each groom contacts the BSPMaster, and it takes 
assigned
+ tasks and reports its status by means of periodical piggybacks with BSPMaster.
+ Each groom is designed to run with HDFS or other distributed storages. 
Basically,
+ a groom server and a data node should be run on one physical node to get the 
best performance. (Data-locality)
+
+Package:  hama-conf-pseudo
+Architecture: all
+Depends: hama (= ${source:Version})
+Description: Apache Hama installation in pseudo-distributed mode
+ Installation of this RPM will setup your machine to run in pseudo-distributed 
mode
+ where each Apache Hama daemon runs in a separate Java process.
+
+Package:  hama-doc
+Architecture: all
+Depends: hama (= ${source:Version})
+Description: Apache Hama Documentation
+ Documentation for Apache Hama
+
+

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/copyright
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/copyright 
b/bigtop-packages/src/deb/hama/copyright
new file mode 100644
index 0000000..fb67d3f
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/copyright
@@ -0,0 +1,16 @@
+Format: http://dep.debian.net/deps/dep5
+Source: http://hama.apache.org/
+Upstream-Name: Apache Hama
+
+Files: *
+Copyright: 2010-2012, The Apache Software Foundation
+License: Apache-2.0
+
+Files debian/*
+Copyright: 2012, The Apache Software Foundation
+License: Apache-2.0
+
+License: Apache-2.0
+ On Debian systems, the complete text of the Apache 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
+

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-bspmaster.postinst
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-bspmaster.postinst 
b/bigtop-packages/src/deb/hama/hama-bspmaster.postinst
new file mode 100644
index 0000000..317c302
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-bspmaster.postinst
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+set -e
+if [ -x "/etc/init.d/hama-bspmaster" ]; then
+       update-rc.d hama-bspmaster defaults >/dev/null
+       if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+               invoke-rc.d hama-bspmaster start || :
+       else
+               /etc/init.d/hama-bspmaster start || :
+       fi
+fi

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-conf-pseudo.dirs
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-conf-pseudo.dirs 
b/bigtop-packages/src/deb/hama/hama-conf-pseudo.dirs
new file mode 100644
index 0000000..502361a
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-conf-pseudo.dirs
@@ -0,0 +1 @@
+/etc/hama/conf.pseudo

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-conf-pseudo.install
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-conf-pseudo.install 
b/bigtop-packages/src/deb/hama/hama-conf-pseudo.install
new file mode 100644
index 0000000..502361a
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-conf-pseudo.install
@@ -0,0 +1 @@
+/etc/hama/conf.pseudo

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-conf-pseudo.postinst
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-conf-pseudo.postinst 
b/bigtop-packages/src/deb/hama/hama-conf-pseudo.postinst
new file mode 100644
index 0000000..a20d0c8
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-conf-pseudo.postinst
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+# postinst script for hama
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure)
+        update-alternatives --install /etc/hama/conf hama-conf 
/etc/hama/conf.pseudo 40
+        if [ ! -e /etc/hama/conf ]; then 
+          ln -s /etc/hama/conf.pseudo /etc/hama/conf 
+        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
+
+

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-conf-pseudo.prerm
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-conf-pseudo.prerm 
b/bigtop-packages/src/deb/hama/hama-conf-pseudo.prerm
new file mode 100644
index 0000000..fe6d6af
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-conf-pseudo.prerm
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# prerm script for hama
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+        update-alternatives --remove hama-conf /etc/hama/conf.pseudo > 
/dev/null || :
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm 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
+
+

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-doc.dirs
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-doc.dirs 
b/bigtop-packages/src/deb/hama/hama-doc.dirs
new file mode 100644
index 0000000..f83f642
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-doc.dirs
@@ -0,0 +1 @@
+usr/share/doc/hama-doc

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-doc.install
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-doc.install 
b/bigtop-packages/src/deb/hama/hama-doc.install
new file mode 100644
index 0000000..f83f642
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-doc.install
@@ -0,0 +1 @@
+usr/share/doc/hama-doc

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama-groom.postinst
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama-groom.postinst 
b/bigtop-packages/src/deb/hama/hama-groom.postinst
new file mode 100644
index 0000000..b81b860
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama-groom.postinst
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+set -e
+if [ -x "/etc/init.d/hama-groom" ]; then
+       update-rc.d hama-groom defaults >/dev/null
+       if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+               invoke-rc.d hama-groom start || :
+       else
+               /etc/init.d/hama-groom start || :
+       fi
+fi

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama.dirs
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama.dirs 
b/bigtop-packages/src/deb/hama/hama.dirs
new file mode 100644
index 0000000..d8f22dd
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama.dirs
@@ -0,0 +1,4 @@
+etc/default
+etc/hama/conf.dist
+usr/bin
+usr/lib/hama

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama.install
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama.install 
b/bigtop-packages/src/deb/hama/hama.install
new file mode 100644
index 0000000..256ea14
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama.install
@@ -0,0 +1,4 @@
+etc/default/hama
+etc/hama/conf.dist
+usr/bin/hama
+usr/lib/hama

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama.postinst
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama.postinst 
b/bigtop-packages/src/deb/hama/hama.postinst
new file mode 100644
index 0000000..7eb7e21
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama.postinst
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+set -e
+
+chmod 0777 /usr/lib/hama/logs
+
+case "$1" in
+    configure)
+        # Install config alternatives
+        update-alternatives  --install /etc/hama/conf hama-conf 
/etc/hama/conf.dist 30
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama.preinst
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama.preinst 
b/bigtop-packages/src/deb/hama/hama.preinst
new file mode 100644
index 0000000..421ee90
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama.preinst
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# preinst script for hama
+#
+# 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
+    install|upgrade)
+        if ! getent passwd hama >/dev/null; then
+                # Adding system user: hama.
+                adduser \
+                  --system \
+                  --group \
+                  --home /var/lib/hama \
+                  --gecos "Apache Hama User" \
+                  --shell /bin/bash \
+                  hama >/dev/null
+        fi
+       install -d -m 0755 -o hama -g hama /var/log/hama
+    ;;
+
+    abort-upgrade)
+    ;;
+
+    *)
+        echo "preinst 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

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/hama.prerm
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/hama.prerm 
b/bigtop-packages/src/deb/hama/hama.prerm
new file mode 100644
index 0000000..0f2a59a
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/hama.prerm
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+# prerm script for hama
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+      update-alternatives --remove hama-conf /etc/hama/conf.dist || :
+    ;;
+
+    failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm 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
+
+

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/deb/hama/rules
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/deb/hama/rules 
b/bigtop-packages/src/deb/hama/rules
new file mode 100644
index 0000000..e3f9eb7
--- /dev/null
+++ b/bigtop-packages/src/deb/hama/rules
@@ -0,0 +1,103 @@
+#!/usr/bin/make -f
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+#
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
+
+patch: patch-stamp
+patch-stamp:
+               touch $@
+
+clean:
+               dh_testdir
+               dh_testroot
+               rm -f *-stamp
+               dh_clean
+               rm -Rf debian/tmp
+               find debian -name .\*swp -exec rm -f {} \;
+
+build-indep: build-indep-stamp
+build-indep-stamp: patch-stamp
+        # we'll just use the build from the tarball.
+               rm -rf bigtop-empty
+               mkdir -p bigtop-empty
+               sh debian/do-component-build -Drat.basedir=${PWD}/bigtop-empty 
-Dmaven.repo.local=${HOME}/.m2/repository
+               mkdir -p debian/tmp
+               (cd 
dist/target/hama-${HAMA_BASE_VERSION}/hama-${HAMA_BASE_VERSION} && tar cf - 
--exclude=debian/\* .) | (cd debian/tmp && tar xf -)
+               touch $@
+
+install: install-indep
+install-indep:
+               dh_testdir
+               dh_testroot
+               dh_installdirs
+               sh -x debian/install_hama.sh \
+                       --distro-dir=debian \
+                       --build-dir=debian/tmp \
+                       --doc-dir=/usr/share/doc/hama-doc \
+                       --prefix=debian/tmp/hama
+               rm debian/tmp/hama/usr/lib/hama/lib/hadoop-*.jar
+               ln -s /usr/lib/hadoop/hadoop-core.jar 
debian/tmp/hama/usr/lib/hama/lib/hadoop-core.jar
+               rm debian/tmp/hama/usr/lib/hama/lib/zookeeper-*.jar
+               ln -s /usr/lib/zookeeper/zookeeper.jar 
debian/tmp/hama/usr/lib/hama/lib/zookeeper.jar
+               mkdir -p debian/tmp/hama/etc/default
+               cp debian/hama.default debian/tmp/hama/etc/default/hama
+               dh_install --sourcedir=debian/tmp/hama
+               (dh_lintian) || /bin/true
+
+binary-common:
+               dh_testdir
+               dh_testroot
+               dh_installchangelogs
+               dh_installdocs
+#       dh_installexamples
+#       dh_installmenu
+#       dh_installdebconf
+#       dh_installlogrotate
+#       dh_installemacsen
+#       dh_installpam
+#       dh_installmime
+#       dh_python
+               dh_installinit
+#       dh_installcron
+#       dh_installinfo
+               dh_installman
+               dh_link
+               dh_strip
+               dh_compress
+               dh_fixperms
+#       dh_perl
+               dh_makeshlibs
+               dh_installdeb
+               dh_shlibdeps
+               dh_gencontrol
+               dh_md5sums
+               dh_builddeb
+
+binary-indep: build-indep install-indep
+               $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
+
+binary-arch:
+
+
+binary: binary-indep
+.PHONY: build clean binary-indep binary install-indep binary-arch

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/rpm/hama/BUILD/.gitignore
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/hama/BUILD/.gitignore 
b/bigtop-packages/src/rpm/hama/BUILD/.gitignore
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/rpm/hama/RPMS/.gitignore
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/hama/RPMS/.gitignore 
b/bigtop-packages/src/rpm/hama/RPMS/.gitignore
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/rpm/hama/SOURCES/.gitignore
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/hama/SOURCES/.gitignore 
b/bigtop-packages/src/rpm/hama/SOURCES/.gitignore
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/rpm/hama/SPECS/hama.spec
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/hama/SPECS/hama.spec 
b/bigtop-packages/src/rpm/hama/SPECS/hama.spec
new file mode 100644
index 0000000..fc24d90
--- /dev/null
+++ b/bigtop-packages/src/rpm/hama/SPECS/hama.spec
@@ -0,0 +1,276 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+%define hama_name hama
+%define lib_hama /usr/lib/%{hama_name}
+%define etc_hama /etc/%{hama_name}
+%define config_hama %{etc_hama}/conf
+%define log_hama /var/log/%{hama_name}
+%define bin_hama /usr/bin
+%define man_dir /usr/share/man
+
+%if  %{?suse_version:1}0
+%define doc_hama %{_docdir}/hama
+%define alternatives_cmd update-alternatives
+%global initd_dir %{_sysconfdir}/rc.d
+%else
+%define doc_hama %{_docdir}/hama-%{hama_version}
+%define alternatives_cmd alternatives
+%global initd_dir %{_sysconfdir}/rc.d/init.d
+%endif
+
+# disable repacking jars
+%define __os_install_post %{nil}
+
+Name: hama
+Version: %{hama_version}
+Release: %{hama_release}
+Summary: A set of Java libraries for scalable machine learning.
+URL: http://hama.apache.org
+Group: Development/Libraries
+BuildArch: noarch
+Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+License: ASL 2.0 
+Source0: %{name}-dist-%{hama_base_version}.tar.gz
+Source1: do-component-build 
+Source2: install_%{name}.sh
+Source3: %{name}-bspmaster.init
+Source4: %{name}-groom.init
+Source5: %{name}.default
+Source6: bigtop.bom
+Requires: hadoop, bigtop-utils, zookeeper
+
+# Disable automatic Requires generation
+AutoReq: no
+
+%description 
+Apache Hama is a pure BSP(Bulk Synchronous Parallel) computing framework on 
top of HDFS (Hadoop Distributed File System) for massive scientific 
computations such as matrix, graph and network algorithms. Currently, it has 
the following features:
+
+Job submission and management interface.
+Multiple tasks per node.
+Input/Output Formatter.
+Checkpoint recovery.
+Support to run with Apache Mesos.
+Support to run with Hadoop YARN.
+
+%package bspmaster
+Summary: Maintain the global state of Apache Hama services
+Group: Development/Libraries
+BuildArch: noarch
+Requires: %{name} = %{version}-%{release}
+Requires: /sbin/service
+Requires(pre): %{name} = %{version}-%{release}
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/chkconfig
+
+%if  %{?suse_version:1}0
+# Required for init scripts
+Requires: insserv
+%endif
+
+%if  0%{?mgaversion}
+# Required for init scripts
+Requires: initscripts
+%endif
+
+# CentOS 5 does not have any dist macro
+# So I will suppose anything that is not Mageia or a SUSE will be a 
RHEL/CentOS/Fedora
+%if %{!?suse_version:1}0 && %{!?mgaversion:1}0
+# Required for init scripts
+Requires: redhat-lsb
+%endif
+
+%description bspmaster
+BSPMaster is responsible for the following:
+- Maintaining groom server status.
+- Maintaining supersteps and other counters in a cluster.
+- Maintaining job progress information.
+- Scheduling Jobs and assigning tasks to groom servers
+- Distributing execution classes and configuration across groom servers.
+- Providing users with the cluster control interface (web and console based). 
+
+%package groom
+Summary: A Groom Server (shortly referred to as groom) is a process that 
launches bsp tasks assigned by BSPMaster
+Group: Development/Libraries
+BuildArch: noarch
+Requires: %{name} = %{version}-%{release}
+Requires: /sbin/service
+Requires(pre): %{name} = %{version}-%{release}
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/chkconfig
+
+%if  %{?suse_version:1}0
+# Required for init scripts
+Requires: insserv
+%endif
+
+%if  0%{?mgaversion}
+# Required for init scripts
+Requires: initscripts
+%endif
+
+# CentOS 5 does not have any dist macro
+# So I will suppose anything that is not Mageia or a SUSE will be a 
RHEL/CentOS/Fedora
+%if %{!?suse_version:1}0 && %{!?mgaversion:1}0
+# Required for init scripts
+Requires: redhat-lsb
+%endif
+
+%description groom
+A Groom Server (shortly referred to as groom) is a process that launches bsp 
tasks
+assigned by BSPMaster. Each groom contacts the BSPMaster, and it takes assigned
+tasks and reports its status by means of periodical piggybacks with BSPMaster.
+Each groom is designed to run with HDFS or other distributed storages. 
Basically,
+a groom server and a data node should be run on one physical node to get the 
best performance. (Data-locality) 
+
+
+%package conf-pseudo
+Summary: Apache Hama installation in pseudo-distributed mode
+Group: System/Daemons
+Requires: %{name} = %{version}-%{release}
+Requires: %{name}-groom = %{version}-%{release}
+Requires: %{name}-bspmaster = %{version}-%{release}
+Requires: zookeeper-server
+
+%description conf-pseudo
+Installation of this RPM will setup your machine to run in pseudo-distributed 
mode
+where each Apache Hama daemon runs in a separate Java process.
+
+
+%package doc
+Summary: Apache Hama Documentation
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+
+%description doc
+Documentation for Apache Hama
+
+  
+%prep
+%setup -n %{name}-%{hama_base_version}
+
+%build
+bash $RPM_SOURCE_DIR/do-component-build
+
+%install
+%__rm -rf $RPM_BUILD_ROOT
+sh -x $RPM_SOURCE_DIR/install_hama.sh \
+          --distro-dir=$RPM_SOURCE_DIR \
+          
--build-dir=dist/target/hama-%{hama_base_version}/hama-%{hama_base_version} \
+          --prefix=$RPM_BUILD_ROOT \
+          --doc-dir=%{doc_hama} 
+
+# Reuse Apache Hadoop jar
+rm -f $RPM_BUILD_ROOT/usr/lib/hama/lib/hadoop*.jar
+ln -s /usr/lib/hadoop/hadoop-core.jar 
$RPM_BUILD_ROOT/usr/lib/hama/lib/hadoop-core.jar
+
+# Reuse Apache Zookeeper jar
+rm -f $RPM_BUILD_ROOT/usr/lib/hama/lib/zookeeper*.jar
+ln -s /usr/lib/zookeeper/zookeeper.jar 
$RPM_BUILD_ROOT/usr/lib/hama/lib/zookeeper.jar
+
+
+# Install init script
+%__install -d -m 0755 $RPM_BUILD_ROOT/%{initd_dir}/
+
+init_file_bspmaster=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-bspmaster
+%__cp %{SOURCE3} $init_file_bspmaster
+chmod 755 $init_file_bspmaster
+
+init_file_groom=$RPM_BUILD_ROOT/%{initd_dir}/%{name}-groom
+%__cp %{SOURCE4} $init_file_groom
+chmod 755 $init_file_groom
+
+
+# Install default file
+%__install -d -m 0755 $RPM_BUILD_ROOT/etc/default
+%__cp %{SOURCE5} $RPM_BUILD_ROOT/etc/default/%{name}
+
+%pre
+getent group hama >/dev/null || groupadd -r hama
+getent passwd hama >/dev/null || useradd -c "Apache Hama" -s /sbin/nologin -g 
hama -r -d /var/run/hama hama 2> /dev/null || :
+%__install -d -o hama -g hama -m 0755 /var/log/hama
+
+
+%post
+%{alternatives_cmd} --install %{config_hama} %{hama_name}-conf 
%{config_hama}.dist 30
+
+%preun
+if [ "$1" = 0 ]; then
+        %{alternatives_cmd} --remove %{hama_name}-conf %{config_hama}.dist || :
+fi
+
+# bspmaster service
+%post bspmaster
+chkconfig --add %{name}-bspmaster
+
+%preun bspmaster
+if [ $1 = 0 ] ; then
+        service %{name}-bspmaster stop > /dev/null 2>&1
+        chkconfig --del %{name}-bspmaster
+fi
+%postun bspmaster
+if [ $1 -ge 1 ]; then
+        service %{name}-bspmaster condrestart >/dev/null 2>&1
+fi
+
+# Groom service
+%post groom
+chkconfig --add %{name}-groom
+
+%preun groom
+if [ $1 = 0 ] ; then
+        service %{name}-groom stop > /dev/null 2>&1
+        chkconfig --del %{name}-groom
+fi
+%postun groom
+if [ $1 -ge 1 ]; then
+        service %{name}-groom condrestart >/dev/null 2>&1
+fi
+
+# Pseudo-distributed Hadoop installation
+%post conf-pseudo
+%{alternatives_cmd} --install %{config_hama} %{name}-conf 
%{etc_hama}/conf.pseudo 40
+
+%preun conf-pseudo
+if [ "$1" = 0 ]; then
+        %{alternatives_cmd} --remove %{name}-conf %{etc_hama}/conf.pseudo
+fi
+
+
+
+#######################
+#### FILES SECTION ####
+#######################
+%files 
+%defattr(-,root,root,755)
+%config(noreplace) %{config_hama}.dist
+%doc *.txt
+%{lib_hama}
+%{bin_hama}/hama
+%config(noreplace) /etc/default/%{name}
+
+%files bspmaster
+%attr(0755,root,root)/%{initd_dir}/%{name}-bspmaster
+
+%files groom
+%attr(0755,root,root)/%{initd_dir}/%{name}-groom
+
+%files conf-pseudo
+%defattr(-,root,root,755)
+%config(noreplace) %attr(755,root,root) %{etc_hama}/conf.pseudo
+
+%files doc
+%defattr(-,root,root,755)
+%doc %{doc_hama}

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop-packages/src/rpm/hama/SRPMS/.gitignore
----------------------------------------------------------------------
diff --git a/bigtop-packages/src/rpm/hama/SRPMS/.gitignore 
b/bigtop-packages/src/rpm/hama/SRPMS/.gitignore
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/bigtop/blob/1f11c766/bigtop.mk
----------------------------------------------------------------------
diff --git a/bigtop.mk b/bigtop.mk
index e653e4a..1ef7510 100644
--- a/bigtop.mk
+++ b/bigtop.mk
@@ -388,3 +388,17 @@ KITE_TARBALL_DST=kite-$(KITE_BASE_VERSION).tar.gz
 KITE_SITE=https://github.com/kite-sdk/kite/archive
 KITE_ARCHIVE=$(KITE_SITE)
 $(eval $(call PACKAGE,kite,KITE))
+
+# Hama
+HAMA_NAME=hama
+HAMA_RELNOTES_NAME=Apache Hama
+HAMA_PKG_NAME=hama
+HAMA_BASE_VERSION=0.7.0
+HAMA_PKG_VERSION=$(HAMA_BASE_VERSION)
+HAMA_RELEASE_VERSION=1
+HAMA_TARBALL_DST=hama-dist-$(HAMA_BASE_VERSION).tar.gz
+HAMA_TARBALL_SRC=hama-dist-$(HAMA_BASE_VERSION)-src.tar.gz
+HAMA_DOWNLOAD_PATH=/hama/hama-$(HAMA_BASE_VERSION)
+HAMA_SITE=$(APACHE_MIRROR)$(HAMA_DOWNLOAD_PATH)
+HAMA_ARCHIVE=$(APACHE_ARCHIVE)$(HAMA_DOWNLOAD_PATH)
+$(eval $(call PACKAGE,hama,HAMA))

Reply via email to