Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Apr 15, 2013
0 parents commit c4a4863
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tmp
mesos*.deb
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Mesos Debian packaging

Build scripts to create a Debian package with FPM

## Requirements

* FPM (https://github.com/jordansissel/fpm)
* python (2.6 or newer)
* python-dev
* git
* autoconf
* make
* g++
* java

in commands:

gem install fpm
apt-get install python-dev autoconf automake git make


90 changes: 90 additions & 0 deletions build_mesos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/bash
set -e
set -u
name=mesos
version=0.13.0
description="Apache Mesos is a cluster manager that provides efficient resource isolation
and sharing across distributed applications, or frameworks. It can run Hadoop,
MPI, Hypertable, Spark (a new framework for low-latency interactive and
iterative jobs), and other applications."
url="http://incubator.apache.org/mesos/"
arch="amd64"
section="misc"
package_version=""
origdir="$(pwd)"
mesos_root_dir=usr/lib/${name}
#use old debian init.d scripts or ubuntu upstart
dist="debian"

# add e.g. to ~/.bash_profile 'export MAINTAINER="your@email.com"'
# if variable not set, use default value
if [[ -z "$MAINTAINER" ]]; then
MAINTAINER="${USER}@localhost"
fi

#_ MAIN _#
rm -rf ${name}*.deb
mkdir -p tmp && pushd tmp
if [ ! -d ${name}/.git ]; then
rm -rf ${name}
git clone git://github.com/apache/mesos.git
cd ${name}
else
cd ${name}
git pull
fi

if [ ! -f "configure" ]; then
autoreconf -f -i -Wall,no-obsolete
fi

#TODO: add param for cleaning build dir
cd build
if [ ! -f "deb/usr/local/lib/libmesos-${version}.so" ]; then
../configure
make
mkdir deb
make install DESTDIR=`pwd`/deb
fi

if [ ! -d "deb" ]; then
echo "expected 'deb' dir in `pwd`"
exit 1
fi

cd deb
echo "entering package root `pwd`"
echo "building deb package ..."

#create directory structure
mkdir -p ${mesos_root_dir}
mkdir -p etc/default
mkdir -p etc/${name}

cp ${origdir}/mesos.default etc/default/mesos
if [ $dist == "debian" ]; then
mkdir -p etc/init.d

else
mkdir -p etc/init
cp ${origdir}/mesos.mesos-master.upstart etc/init/mesos-master
cp ${origdir}/mesos.mesos-slave.upstart etc/init/mesos-slave
fi
mkdir -p var/log/${name}

#_ MAKE DEBIAN _#
fpm -t deb \
-n ${name} \
-v ${version}${package_version} \
--description "${description}" \
--url="${url}" \
-a ${arch} \
--category ${section} \
--vendor "" \
-m "$MAINTAINER" \
--prefix=/ \
-d "default-jre-headless | java6-runtime-headless" \
-s dir \
-- .
mv ${name}*.deb ${origdir}
popd
41 changes: 41 additions & 0 deletions copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: mesos
Source: <https://incubator.apache.org/mesos/>

Files: *
Copyright: 2012 The Apache Foundation <general@apache.org>
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".

Files: third_party/boost*, third_party/libprocess/third_party/boost*
License: Boost

Files: third_party/glog*, third_party/gmock*, third_party/protobuf*
Copyright: 2008 Google Inc.
License: BSD-2-Clause

Files: third_party/leveldb*
Copyright: 2011 The LevelDB Authors.
License: BSD-2-Clause

Files: third_party/libprocess/third_party/libev*
Copyright: 2007-2009 Marc Alexander Lehmann
License: Expat

Files: third_party/libprocess/third_party/ry-http*
Copyright: 2009-2010 Ryan Dahl; Joyent, Inc.; and other Node contributors
License: BSD-2-Clause

5 changes: 5 additions & 0 deletions mesos.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# /etc/default/mesos

RUN_MESOS_SLAVE=no
RUN_MESOS_MASTER=no

25 changes: 25 additions & 0 deletions mesos.mesos-master.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# mesos master upstart

description "Mesos Master"

env DEFAULTFILE=/etc/default/mesos

start on runlevel [2345]
respawn

pre-start script
RUN_MESOS_MASTER=no
if [ -f "$DEFAULTFILE" ]; then
. "$DEFAULTFILE"
fi
if [ "x$RUN_MESOS_MASTER" != xyes ]; then
stop
exit 0
fi
ulimit -n 8192
end script

script
exec /usr/sbin/mesos-master --conf=/etc/mesos/conf
end script

25 changes: 25 additions & 0 deletions mesos.mesos-slave.upstart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# mesos slave upstart
description "Mesos Slave"

env DEFAULTFILE=/etc/default/mesos

start on runlevel [2345]
respawn

pre-start script
RUN_MESOS_SLAVE=no
if [ -f "$DEFAULTFILE" ]; then
. "$DEFAULTFILE"
fi
if [ "x$RUN_MESOS_MASTER" != xyes ]; then
stop
exit 0
fi
ulimit -n 8192
end script

script
exec /usr/sbin/mesos-slave --conf=/etc/mesos/conf
end script


0 comments on commit c4a4863

Please sign in to comment.