annotate Resources/debian-stable-internal.sh @ 15:11368fbbce2a

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