From 632398666e04c622d26c9c34bdb02cc934c269fb Mon Sep 17 00:00:00 2001 From: conni Date: Sat, 9 Dec 2017 10:04:48 +0100 Subject: [PATCH 1/2] Adding exclusions for generated files to .gitignore --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index e0292b19..5f70e199 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,10 @@ *.o *.a +/pCloudCC/CMakeCache.txt +/pCloudCC/CMakeFiles/ +/pCloudCC/Makefile +/pCloudCC/cmake_install.cmake +/pCloudCC/lib/mbedtls/Makefile +/pCloudCC/lib/mbedtls/library/Makefile +/pCloudCC/libpcloudcc_lib.so +/pCloudCC/pcloudcc From c384802a576dcd6d113eabb283b7678730de40e9 Mon Sep 17 00:00:00 2001 From: conni Date: Sat, 9 Dec 2017 10:08:56 +0100 Subject: [PATCH 2/2] Adding docker based build --- README.md | 5 +++++ build-container/Dockerfile | 12 ++++++++++++ build-container/build.sh | 9 +++++++++ build-with-docker.sh | 14 ++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 build-container/Dockerfile create mode 100644 build-container/build.sh create mode 100755 build-with-docker.sh diff --git a/README.md b/README.md index da1e7a2f..dbe8d388 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,11 @@ On Ubuntu you can run the following command: > ldconfig > pcloudcc -u username -p +## Build with docker +> ./build-with-docker.sh + +After that pcloudcc and libpcloudcc_lib.so are located below pCloudCC. + ## Usage Terminal command is pcloudcc and -h option prints short options description. > ./pcloudcc -h diff --git a/build-container/Dockerfile b/build-container/Dockerfile new file mode 100644 index 00000000..a35b1c49 --- /dev/null +++ b/build-container/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:stretch + +RUN apt-get update && \ + apt-get install -y g++ cmake zlib1g-dev libboost-system-dev libboost-program-options-dev libpthread-stubs0-dev libfuse-dev git && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /build /work +COPY build.sh /build +RUN chmod 755 /build/build.sh + +VOLUME /work +WORKDIR /work diff --git a/build-container/build.sh b/build-container/build.sh new file mode 100644 index 00000000..1a2df49d --- /dev/null +++ b/build-container/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash -e + +BUILD_DIR=/work + +cd $BUILD_DIR/pCloudCC/lib/pclsync/ && make clean && make fs + +cd $BUILD_DIR/pCloudCC/lib/mbedtls/ && cmake . && make clean && make + +cd $BUILD_DIR/pCloudCC/ && cmake . && make diff --git a/build-with-docker.sh b/build-with-docker.sh new file mode 100755 index 00000000..74210dc7 --- /dev/null +++ b/build-with-docker.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e + +PROJECT_DIR=$(cd `dirname $0` && pwd) + +cd $PROJECT_DIR/build-container + +docker build --tag pcloudcc-build:local . + +cd $PROJECT_DIR +docker run \ + -u $(id -u):$(id -g) \ + -v $PROJECT_DIR:/work \ + pcloudcc-build:local \ + /build/build.sh