comparison Resources/debian-stable-internal.sh @ 10:340f02ddaabf

build script for Debian stable
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jun 2019 08:13:01 +0200
parents
children eb09eb1251b9
comparison
equal deleted inserted replaced
9:c46ed3cd5ddc 10:340f02ddaabf
1 #!/bin/bash
2
3 set -ex
4
5 BUILD_TYPE=$1
6 USER_ID=$2
7 GROUP_ID=$3
8
9 # Create the same user and group than the one who is running the
10 # "./debian-stable-compile.sh" script on the hosting system (*)
11 groupadd -g ${GROUP_ID} -r orthanc
12 useradd -u ${USER_ID} -r -g orthanc orthanc
13
14 # Static build using the root user
15 apt-get update
16 apt-get install -y cmake build-essential unzip
17
18 mkdir /tmp/build
19 cd /tmp/build
20
21 cp -r /source /tmp/source-writeable
22 cmake /tmp/source-writeable \
23 -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
24 -DSTATIC_BUILD=ON \
25 -DORTHANC_FRAMEWORK_SOURCE=web \
26 -DCMAKE_INSTALL_PREFIX=/target
27
28 make -j`nproc`
29
30 # Copy the installation to the host filesystem, using the
31 # newly-created user "orthanc" (*) that corresponds to the user who is
32 # running "./debian-stable-compile.sh" script. This allows to avoid
33 # files owned by the "root" user on the host filesystem.
34 su -c "cp /tmp/build/libOrthancGoogleCloudPlatform.so /target" orthanc