Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #20 from radekg/fedora-23
Browse files Browse the repository at this point in the history
Fedora 23 support. Closes #5
  • Loading branch information
radekg committed Mar 30, 2016
2 parents 0d61fc5 + c7e4602 commit 6154a2c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This program uses Docker via command line and it works perfectly fine with Docke

- `Centos 7.1`
- `Debian Jessie`
- `Fedora 23`
- `Ubuntu Precise`
- `Ubuntu Trusty`

Expand Down
20 changes: 20 additions & 0 deletions docker/fedora:23/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM fedora:23

RUN dnf install -y which tar wget \
&& mkdir -p /tmp/maven && cd /tmp/maven \
&& wget http://mirror.olnevhost.net/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \
&& tar xvf apache-maven-3.3.9-bin.tar.gz \
&& mv apache-maven-3.3.9 /usr/local/apache-maven \
&& cd / && source /etc/bashrc && rm -rf /tmp/maven \
&& ln -sf /usr/local/apache-maven/bin/mvn /usr/bin/mvn \
&& dnf groupinstall "Development Tools" "Development Libraries" -y \
&& dnf update nss -y \
&& dnf install -y python-boto libtool redhat-rpm-config gcc-c++ \
java-1.8.0-openjdk-devel cyrus-sasl-md5 \
apr-devel subversion-devel ruby-devel \
rpm-build \
&& gem install fpm --no-ri --no-rdoc

ENV M2_HOME /usr/local/apache-maven
ENV M2 /usr/local/apache-maven/bin
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk
12 changes: 12 additions & 0 deletions lib/configs/mesos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ def setup(program):
default=Utils.env_with_default("DOCKER_TEMPLATES_DIR", "{}/docker".format(
os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
)))
Config.add_argument( "--packaging-patches",
dest="packages_patches_dir",
help="mesos-deb-packaging patches directory.",
metavar="PACKAGES_PATCHES_DIR",
default=Utils.env_with_default("PACKAGES_PATCHES_DIR", "{}/patches/mesos-packaging".format(
os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
)))
Config.add_argument( "--source-dir",
dest="source_dir",
help="Directory in which the Mesos sources are stored.",
Expand Down Expand Up @@ -127,6 +134,11 @@ def docker_templates_dir():
from lib.config import Config
return Config.args().docker_templates_dir

@staticmethod
def packages_patches_dir():
from lib.config import Config
return Config.args().packages_patches_dir

@staticmethod
def source_dir():
from lib.config import Config
Expand Down
31 changes: 25 additions & 6 deletions mesos-toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,19 @@ def op_build():

# create temp work dir:
build_dir_mesos = "{}/{}-{}".format( MesosConfig.work_dir(),
MesosConfig.mesos_version(),
MesosConfig.operating_system().replace(":", "-") )
MesosConfig.mesos_version(),
MesosConfig.operating_system().replace(":", "-") )
build_dir_packaging = "{}/{}-{}-packaging".format( MesosConfig.work_dir(),
MesosConfig.mesos_version(),
MesosConfig.operating_system().replace(":", "-") )
MesosConfig.mesos_version(),
MesosConfig.operating_system().replace(":", "-") )
packages_dir = "{}/{}-{}".format( MesosConfig.packages_dir(),
MesosConfig.mesos_version(),
MesosConfig.operating_system().replace(":", "-") )
MesosConfig.mesos_version(),
MesosConfig.operating_system().replace(":", "-") )
patch_file = "{}/{}-{}-{}.patch".format(
MesosConfig.packages_patches_dir(),
MesosConfig.deb_packaging_sha(),
MesosConfig.mesos_version(),
MesosConfig.operating_system().replace(":", "-") )

build_log_file = "{}.{}.log".format(build_dir_mesos, str(int(time.time())))
LOG.info("Recording build process to {}.".format(build_log_file))
Expand All @@ -236,6 +241,20 @@ def op_build():
Utils.cmd("cp -R {} {}".format( MesosConfig.mesos_repository_dir(), build_dir_mesos ))
Utils.cmd("cp -R {} {}".format( MesosConfig.deb_packaging_repository_dir(), build_dir_packaging ))

print patch_file
if os.path.isfile(patch_file):
LOG.info("Found a patch for mesos-deb-packaging {}. Applying...".format( MesosConfig.deb_packaging_sha() ))
result = Utils.cmd("cd {} && git apply {}".format(build_dir_packaging, patch_file))
if result['ExitCode'] != 0:
Utils.print_result_error(LOG, "Patch {} could not be applied to {}.".format(
patch_file,
build_dir_packaging ), result)
exit(105)
else:
LOG.info("Patch applied.")
else:
LOG.info("No patches for mesos-deb-packaging {}.".format( MesosConfig.deb_packaging_sha() ))

# ensure branch / tag
LOG.info("Ensuring Mesos version {}...".format(MesosConfig.mesos_version()))
result = Utils.cmd("sleep 5 && cd {} && git checkout {}".format(build_dir_mesos, MesosConfig.mesos_version()))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/build_mesos b/build_mesos
index 81561bc..526d86e 100755
--- a/build_mesos
+++ b/build_mesos
@@ -239,7 +239,7 @@ function create_lib_symlinks {(
msg "expects libmesos.so to exist in /usr/local/lib)."
mkdir -p usr/local/lib
# ensure symlinks are relative so they work as expected in the final env
- ( cd usr/local/lib && cp -s ../../lib/lib*.so . )
+ ( cd usr/local/lib && cp ../../lib64/lib*.so ../../lib/ && cp -s ../../lib/lib*.so . )
fi
)}

0 comments on commit 6154a2c

Please sign in to comment.