forked from rucio/fuse-posix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·69 lines (56 loc) · 2.59 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#Copyright European Organization for Nuclear Research (CERN)
#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
#Authors:
# - Gabriele Gaetano Fronzé, <[email protected]>, 2019-2020
#///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
CMAKE_EXE=cmake
CMAKE_VERSION=$(${CMAKE_EXE} --version | tr -d "cmake version")
CMAKE_VERSION_ARR=($(echo $CMAKE_VERSION | tr '.' "\n"))
CMAKE_MAIN_VERSION=${CMAKE_VERSION_ARR[0]}
if [ ${CMAKE_MAIN_VERSION} -lt 3 ]
then
echo "CMake >= 3 required. Aborting."
else
echo
echo -e "\033[1;33m/////////////////////////////////////////////////////////////////////////////////////////////////////////////////\033[0m"
echo
echo "Building the Rucio posix-fuse interface."
echo -e "\
Please note that this requires
- cmake>=3
- libcurl (yum install libcurl-devel)
- libfuse (yum install fuse-devel)
To install them please run the following command:
yum install -y cmake3 libcurl-devel libfuse-devel
apt-get install cmake3 libfuse-dev libcurl4-gnutls-dev
Or the corresponding package manager invocation.
"
echo
echo -e "\033[1;33m-> Updating git submodules \033[0m"
(cd ${DIR}; git submodule update --init --recursive)
(cd ${DIR}; git submodule update --recursive --remote)
echo
echo -e "\033[1;33m-> Creating build directory: $DIR/cmake-build-debug \033[0m"
mkdir -p ${DIR}/cmake-build-debug
WORKDIR="$DIR/cmake-build-debug"
echo
echo -e "\033[1;33m-> Configuring with CMake \033[0m"
(cd ${WORKDIR}; ${CMAKE_EXE} ..)
echo
echo -e "\033[1;33m-> Building with make \033[0m"
(cd ${WORKDIR}; make)
echo
echo -e "\033[1;33m/////////////////////////////////////////////////////////////////////////////////////////////////////////////////\033[0m"
echo
fi