forked from deric/mesos-deb-packaging
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c4a4863
Showing
7 changed files
with
209 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tmp | ||
mesos*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|