Merge packaging scripts from master branch
[lttng-ci.git] / babeltrace / babeltrace-master.sh
CommitLineData
275b59d2
JRJ
1# Create build directory
2rm -rf $WORKSPACE/build
3mkdir -p $WORKSPACE/build
4
5PREFIX="$WORKSPACE/build"
6
7./bootstrap
8
9CONF_OPTS=""
10
11case "$conf" in
12static)
13 echo "Static build"
14 CONF_OPTS="--enable-static --disable-shared"
15 ;;
16python_bindings)
17 echo "Build with python bindings"
18 # We only support bindings built with Python 3
19 export PYTHON="python3"
20 export PYTHON_CONFIG="/usr/bin/python3-config"
21 CONF_OPTS="--enable-python-bindings"
22 ;;
23*)
24 echo "Standard build"
25 CONF_OPTS=""
26 ;;
27esac
28
aad6ac90
JR
29# Build type
30# oot : out-of-tree build
31# dist: build via make dist
32# * : normal tree build
33#
34# Make sure to move to the build_path and configure
35# before continuing
275b59d2 36
aad6ac90 37BUILD_PATH=$WORKSPACE
28c11f27
JR
38TEST_PLAN_PATH=$WORKSPACE
39
aad6ac90
JR
40case "$build" in
41 oot)
42 echo "Out of tree build"
43 BUILD_PATH=$WORKSPACE/oot
44 mkdir -p $BUILD_PATH
45 cd $BUILD_PATH
46 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
47 ;;
48 dist)
49 echo "Distribution out of tree build"
50 BUILD_PATH=`mktemp -d`
51
52 # Initial configure and generate tarball
53 ./configure
54 make dist
55
56 mkdir -p $BUILD_PATH
57 cp *.tar.* $BUILD_PATH/
58 cd $BUILD_PATH
59
60 # Ignore level 1 of tar
61 tar xvf *.tar.* --strip 1
62
63 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
28c11f27
JR
64
65 # Set test plan to dist tar
66 TEST_PLAN_PATH=$BUILD_PATH
aad6ac90
JR
67 ;;
68 *)
aad6ac90
JR
69 echo "Standard tree build"
70 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
71 ;;
72esac
73
d05d558c 74make
275b59d2
JRJ
75make install
76
77rm -rf $WORKSPACE/tap
78mkdir -p $WORKSPACE/tap
79
aad6ac90 80cd $BUILD_PATH/tests
275b59d2
JRJ
81
82# Run make check tests
28c11f27
JR
83if [ -e $TEST_PLAN_PATH/tests/tests ]; then
84 prove --merge --exec '' - < $TEST_PLAN_PATH/tests/tests --archive $WORKSPACE/tap/ || true
dfce032b
JR
85else
86 echo "Missing test plan"
87 exit 1
88fi
275b59d2
JRJ
89
90# TAP plugin is having a hard time with .yml files.
91rm -f $WORKSPACE/tap/meta.yml
92
93# And also with files without extension, so rename all result to *.tap
94find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \;
95
96make clean
97
98# Cleanup rpath and libtool .la files
99find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
100find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
101find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
aad6ac90
JR
102
103if [ $build = "dist" ]; then
104 rm -rf $BUILD_PATH
105fi
This page took 0.027188 seconds and 4 git commands to generate.