Author: cos
Date: Thu Oct 11 23:58:00 2012
New Revision: 1397379

URL: http://svn.apache.org/viewvc?rev=1397379&view=rev
Log:
BIGTOP-715.  Add Spark packaging (MTG dev via cos)


Added:
    bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/
    
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/do-component-build
    
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/install_spark.sh
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/changelog
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/compat
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/control
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/copyright
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/rules
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.postinst
    bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.prerm
    bigtop/branches/branch-0.3.1/bigtop-packages/src/rpm/spark/
    bigtop/branches/branch-0.3.1/bigtop-packages/src/rpm/spark/SPECS/
    bigtop/branches/branch-0.3.1/bigtop-packages/src/rpm/spark/SPECS/spark.spec
Modified:
    bigtop/branches/branch-0.3.1/DEVNOTES
    bigtop/branches/branch-0.3.1/bigtop.mk
    bigtop/branches/branch-0.3.1/package.mk

Modified: bigtop/branches/branch-0.3.1/DEVNOTES
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/DEVNOTES?rev=1397379&r1=1397378&r2=1397379&view=diff
==============================================================================
--- bigtop/branches/branch-0.3.1/DEVNOTES (original)
+++ bigtop/branches/branch-0.3.1/DEVNOTES Thu Oct 11 23:58:00 2012
@@ -16,5 +16,10 @@
 1. Debian
   1.0. apt-get install -y git subversion build-essential dh-make debhelper 
devscripts ant ant-optional autoconf automake subversion liblzo2-dev libzip-dev 
sharutils libfuse-dev reprepro libssl-dev
 
+  FIXME?: You also need to have Scala 2.9.1 or later installed and SCALA_HOME
+  env. var pointed properly. Otherwise, Spark project won't be build as it
+  requires scala. Only older version of the language environment is available
+  on Ubuntu at the moment.
+
 2. RedHat
   2.0 yum install -y git subversion fuse-devel fuse fuse-libs

Added: 
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/do-component-build
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/do-component-build?rev=1397379&view=auto
==============================================================================
--- 
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/do-component-build
 (added)
+++ 
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/do-component-build
 Thu Oct 11 23:58:00 2012
@@ -0,0 +1,29 @@
+#!/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
+
+BUILD_OPTS="-Divy.home=${HOME}/.ivy2 -Dsbt.ivy.home=${HOME}/.ivy2 
-Duser.home=${HOME}     \
+            -Drepo.maven.org=$IVY_MIRROR_PROP 
-Dreactor.repo=file://${HOME}/.m2/repository"
+
+# FIXME: this is a really unfortunate hack
+sed -ie 's#EXTRA_ARGS=""#EXTRA_ARGS="'"$BUILD_OPTS"'"#' sbt/sbt
+
+HADOOP_VERSION=1.0.3
+# FIXME: even more crazy hack
+sed -ie 's#val HADOOP_VERSION =.*#val HADOOP_VERSION = "'$HADOOP_VERSION'"#' 
project/SparkBuild.scala
+
+sbt/sbt $BUILD_OPTS package "$@"

Added: 
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/install_spark.sh
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/install_spark.sh?rev=1397379&view=auto
==============================================================================
--- 
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/install_spark.sh 
(added)
+++ 
bigtop/branches/branch-0.3.1/bigtop-packages/src/common/spark/install_spark.sh 
Thu Oct 11 23:58:00 2012
@@ -0,0 +1,158 @@
+#!/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 dist.dir
+     --prefix=PREFIX             path to install into
+
+  Optional options:
+     --doc-dir=DIR               path to install docs into 
[/usr/share/doc/spark]
+     --lib-dir=DIR               path to install Spark home [/usr/lib/spark]
+     --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 '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
+        ;;
+        --lib-dir)
+        LIB_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 ; do
+  if [ -z "$(eval "echo \$$var")" ]; then
+    echo Missing param: $var
+    usage
+  fi
+done
+
+
+if [ -z "${SCALA_HOME}" ]; then
+    echo Missing env. var SCALA_HOME
+    usage
+fi
+
+MAN_DIR=${MAN_DIR:-/usr/share/man/man1}
+DOC_DIR=${DOC_DIR:-/usr/share/doc/spark}
+LIB_DIR=${LIB_DIR:-/usr/lib/spark}
+INSTALLED_LIB_DIR=${INSTALLED_LIB_DIR:-/usr/lib/spark}
+EXAMPLES_DIR=${EXAMPLES_DIR:-$DOC_DIR/examples}
+BIN_DIR=${BIN_DIR:-/usr/bin}
+CONF_DIR=${CONF_DIR:-/etc/spark/conf.dist}
+SCALA_HOME=${SCALA_HOME:-/usr/share/scala}
+
+install -d -m 0755 $PREFIX/$LIB_DIR
+install -d -m 0755 $PREFIX/$DOC_DIR
+
+# FIXME: at some point we need to create a separate package for Scala
+cp -ra $SCALA_HOME $PREFIX/$LIB_DIR/scala
+
+# FIXME: lib_managed is a terrible name for this
+cp -ra ${BUILD_DIR}/lib_managed $PREFIX/$LIB_DIR
+
+# FIXME: these need to be split into individual packages
+for comp in core repl bagel examples ; do
+  install -d -m 0755 $PREFIX/$LIB_DIR/$comp/lib
+  cp -a ${BUILD_DIR}/$comp/target/scala-*/*.jar $PREFIX/$LIB_DIR/$comp/lib
+  cp -a ${BUILD_DIR}/$comp/lib/* $PREFIX/$LIB_DIR/$comp/lib || :
+done
+
+# FIXME: executor scripts need to reside in bin
+cp -a ${BUILD_DIR}/run $PREFIX/$LIB_DIR
+cp -a ${BUILD_DIR}/spark-executor $PREFIX/$LIB_DIR
+cp -a ${BUILD_DIR}/spark-shell $PREFIX/$LIB_DIR
+
+# Copy in the configuration files
+install -d -m 0755 $PREFIX/$CONF_DIR
+cp -a ${BUILD_DIR}/conf/* $PREFIX/$CONF_DIR
+ln -s /etc/spark/conf $PREFIX/$LIB_DIR/conf
+
+# Copy in the example files
+cp -a ${BUILD_DIR}/examples/ $PREFIX/$DOC_DIR/
+
+# Copy in the wrappers
+install -d -m 0755 $PREFIX/$BIN_DIR
+for wrap in spark-executor spark-shell ; do
+  cat > $PREFIX/$BIN_DIR/$wrap <<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
+
+export SCALA_HOME=\${SCALA_HOME:-$LIB_DIR/scala}
+export PATH=\$PATH:\$SCALA_HOME/bin
+
+exec $INSTALLED_LIB_DIR/$wrap "\$@"
+EOF
+  chmod 755 $PREFIX/$BIN_DIR/$wrap
+done

Added: bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/changelog
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/changelog?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/changelog (added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/changelog Thu 
Oct 11 23:58:00 2012
@@ -0,0 +1 @@
+--- This is auto-generated 

Added: bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/compat
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/compat?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/compat (added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/compat Thu Oct 
11 23:58:00 2012
@@ -0,0 +1 @@
+6

Added: bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/control
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/control?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/control (added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/control Thu Oct 
11 23:58:00 2012
@@ -0,0 +1,33 @@
+# 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: spark
+Section: misc
+Priority: extra
+Maintainer: Bigtop <[email protected]>
+Build-Depends: debhelper (>= 6)
+Standards-Version: 3.8.0
+Homepage: http://www.spark-project.org/
+
+Package: spark 
+Architecture: all
+Depends: bigtop-utils
+Description: Lightning-Fast Cluster Computing
+ Spark is a MapReduce-like cluster computing framework designed to support
+ low-latency iterative jobs and interactive use from an interpreter. It is
+ written in Scala, a high-level language for the JVM, and exposes a clean 
+ language-integrated syntax that makes it easy to write parallel jobs. 
+ Spark runs on top of the Apache Mesos cluster manager.
+

Added: bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/copyright
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/copyright?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/copyright (added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/copyright Thu 
Oct 11 23:58:00 2012
@@ -0,0 +1,15 @@
+Format: http://dep.debian.net/deps/dep5
+Source: http://www.spark-project.org/
+Upstream-Name: Spark Project
+
+Files: *
+Copyright: 2010-2011, The Spark Project
+License: Apache-2.0
+
+Files debian/*
+Copyright: 2011, 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".

Added: bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/rules
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/rules?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/rules (added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/rules Thu Oct 11 
23:58:00 2012
@@ -0,0 +1,91 @@
+#!/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 debian/spark
+       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.
+       bash debian/do-component-build
+       mkdir -p debian/tmp
+       touch $@
+
+install: install-indep
+install-indep: 
+       dh_testdir
+       dh_testroot
+       sh -x debian/install_spark.sh \
+         --build-dir=`pwd` \
+          --doc-dir=/usr/share/doc/spark \
+         --prefix=debian/spark
+       dh_install -i
+       (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

Added: bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.postinst
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.postinst?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.postinst 
(added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.postinst 
Thu Oct 11 23:58:00 2012
@@ -0,0 +1,34 @@
+#!/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
+
+case "$1" in
+    configure)
+        # Install config alternatives
+        update-alternatives  --install /etc/spark/conf spark-conf 
/etc/spark/conf.dist 30
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#

Added: bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.prerm
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.prerm?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.prerm 
(added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/deb/spark/spark.prerm Thu 
Oct 11 23:58:00 2012
@@ -0,0 +1,38 @@
+#!/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
+
+case "$1" in
+    remove|upgrade|deconfigure)
+      update-alternatives --remove spark-conf /etc/spark/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

Added: 
bigtop/branches/branch-0.3.1/bigtop-packages/src/rpm/spark/SPECS/spark.spec
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop-packages/src/rpm/spark/SPECS/spark.spec?rev=1397379&view=auto
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop-packages/src/rpm/spark/SPECS/spark.spec 
(added)
+++ bigtop/branches/branch-0.3.1/bigtop-packages/src/rpm/spark/SPECS/spark.spec 
Thu Oct 11 23:58:00 2012
@@ -0,0 +1,88 @@
+# 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 spark_name spark
+%define lib_spark /usr/lib/%{spark_name}
+%define etc_spark /etc/%{spark_name}
+%define config_spark %{etc_spark}/conf
+%define log_spark /var/log/%{spark_name}
+%define bin_spark /usr/bin
+%define man_dir /usr/share/man
+
+%if  %{?suse_version:1}0
+%define doc_spark %{_docdir}/spark
+%define alternatives_cmd update-alternatives
+%else
+%define doc_spark %{_docdir}/spark-%{spark_version}
+%define alternatives_cmd alternatives
+%endif
+
+# disable repacking jars
+%define __os_install_post %{nil}
+
+Name: spark
+Version: %{spark_version}
+Release: %{spark_release}
+Summary: Lightning-Fast Cluster Computing
+URL: http://www.spark-project.org/
+Group: Development/Libraries
+BuildArch: noarch
+Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+License: ASL 2.0 
+Source0: %{name}-%{spark_base_version}.tar.gz
+Source1: do-component-build 
+Source2: install_%{name}.sh
+Requires: bigtop-utils
+
+
+%description 
+Spark is a MapReduce-like cluster computing framework designed to support
+low-latency iterative jobs and interactive use from an interpreter. It is
+written in Scala, a high-level language for the JVM, and exposes a clean
+language-integrated syntax that makes it easy to write parallel jobs.
+Spark runs on top of the Apache Mesos cluster manager.
+    
+%prep
+#%setup -n %{name}-%{spark_base_version}
+%setup -n mesos-spark-0472cf8
+
+%build
+bash $RPM_SOURCE_DIR/do-component-build
+
+%install
+%__rm -rf $RPM_BUILD_ROOT
+sh $RPM_SOURCE_DIR/install_spark.sh \
+          --build-dir=`pwd`         \
+          --prefix=$RPM_BUILD_ROOT  \
+          --doc-dir=%{doc_spark} 
+
+%post
+%{alternatives_cmd} --install %{config_spark} %{spark_name}-conf 
%{config_spark}.dist 30
+
+%preun
+if [ "$1" = 0 ]; then
+        %{alternatives_cmd} --remove %{spark_name}-conf %{config_spark}.dist 
|| :
+fi
+
+#######################
+#### FILES SECTION ####
+#######################
+%files 
+%defattr(-,root,root,755)
+%config(noreplace) %{config_spark}.dist
+%doc %{doc_spark}
+%{lib_spark}
+%{bin_spark}/spark-shell
+%{bin_spark}/spark-executor

Modified: bigtop/branches/branch-0.3.1/bigtop.mk
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/bigtop.mk?rev=1397379&r1=1397378&r2=1397379&view=diff
==============================================================================
--- bigtop/branches/branch-0.3.1/bigtop.mk (original)
+++ bigtop/branches/branch-0.3.1/bigtop.mk Thu Oct 11 23:58:00 2012
@@ -154,6 +154,22 @@ FLUME_SITE=$(APACHE_MIRROR)$(FLUME_DOWNL
 FLUME_ARCHIVE=$(APACHE_ARCHIVE)$(FLUME_DOWNLOAD_PATH)
 $(eval $(call PACKAGE,flume,FLUME))
 
+# Spark 
+SPARK_NAME=spark
+SPARK_RELNOTES_NAME=Spark
+SPARK_PKG_NAME=spark
+SPARK_BASE_VERSION=0.5.0
+SPARK_PKG_VERSION=0.5.0
+SPARK_RELEASE_VERSION=1
+SPARK_TARBALL_DST=$(SPARK_NAME)-$(SPARK_BASE_VERSION).tar.gz
+SPARK_TARBALL_SRC=v0.5.0
+#SPARK_DOWNLOAD_PATH=/incubator/flume/$(SPARK_PKG_NAME)-$(SPARK_BASE_VERSION)
+#SPARK_SITE=$(APACHE_MIRROR)$(SPARK_DOWNLOAD_PATH)
+#SPARK_ARCHIVE=$(APACHE_ARCHIVE)$(SPARK_DOWNLOAD_PATH)
+SPARC_SITE=https://github.com/mesos/spark/tarball
+SPARK_ARCHIVE=$(SPARC_SITE)
+$(eval $(call PACKAGE,spark,SPARK))
+
 # Bigtop-utils
 BIGTOP_UTILS_NAME=bigtop-utils
 BIGTOP_UTILS__RELNOTES_NAME=Bigtop-utils

Modified: bigtop/branches/branch-0.3.1/package.mk
URL: 
http://svn.apache.org/viewvc/bigtop/branches/branch-0.3.1/package.mk?rev=1397379&r1=1397378&r2=1397379&view=diff
==============================================================================
--- bigtop/branches/branch-0.3.1/package.mk (original)
+++ bigtop/branches/branch-0.3.1/package.mk Thu Oct 11 23:58:00 2012
@@ -106,6 +106,7 @@ $(BUILD_DIR)/%/.deb:
                                --preserve-envvar FORREST_HOME \
                                --preserve-envvar MAVEN3_HOME \
                                --preserve-envvar JAVA_HOME \
+                               --preserve-envvar SCALA_HOME \
                                
--set-envvar=$(PKG)_BASE_VERSION=$($(PKG)_BASE_VERSION) \
                                
--set-envvar=$(PKG)_VERSION=$($(PKG)_PKG_VERSION)$(BIGTOP_BUILD_STAMP) \
                                
--set-envvar=$(PKG)_RELEASE=$($(PKG)_RELEASE_VERSION) \


Reply via email to