-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_dreambbs.bash
More file actions
40 lines (34 loc) · 1.12 KB
/
build_dreambbs.bash
File metadata and controls
40 lines (34 loc) · 1.12 KB
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
#!/usr/bin/env bash
if [ "${DREAMBBS_SNAP_GIT}" = "" ]; then export DREAMBBS_SNAP_GIT="https://github.com/ccns/dreambbs_snap.git"; fi
if [ "${DREAMBBS_GIT}" = "" ]; then export DREAMBBS_GIT="https://github.com/ccns/dreambbs.git"; fi
if [ "${DREAMBBS_BRANCH}" = "" ]; then export DREAMBBS_BRANCH="master"; fi
if [ "${DREAMBBS_SHA}" = "" ]; then export DREAMBBS_SHA=""; fi
set -e
set -x
source /tmp/env.compile
## clone current repo, build and install it
git clone ${DREAMBBS_SNAP_GIT} ${BBSHOME}
rm -rf ${BBSHOME}/.git*
cp /tmp/env.compile ~/.env.compile
# check environment
env
gcc -v
set -u
git clone -b ${DREAMBBS_BRANCH} --single-branch ${DREAMBBS_GIT} ${BBSHOME}/src
if [ "${DREAMBBS_SHA}" != "" ]; then
(
cd "${BBSHOME}/src" \
&& {
if [ "${DREAMBBS_SHA}" != "$(git rev-parse HEAD)" ]; then
git checkout "${DREAMBBS_SHA}"
fi
}
)
fi
cp -v /tmp/dreambbs.conf ${BBSHOME}/src/dreambbs.conf
echo 'export BBSHOME=${HOME}' > ${HOME}/.bashrc
echo '. ${HOME}/.bashrc' > ${HOME}/.bash_profile
mkdir ${BBSHOME}/src/build
cd ${BBSHOME}/src/build
cmake ..
make install clean