Merge packaging scripts from master branch
[lttng-ci.git] / babeltrace / babeltrace-stable-1.2.sh
CommitLineData
a591496f
JR
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
d05d558c
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
36
37BUILD_PATH=$WORKSPACE
38case "$build" in
39 oot)
40 echo "Out of tree build"
41 BUILD_PATH=$WORKSPACE/oot
42 mkdir -p $BUILD_PATH
43 cd $BUILD_PATH
44 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
45 ;;
46 dist)
47 echo "Distribution out of tree build"
48 BUILD_PATH=`mktemp -d`
49
50 # Initial configure and generate tarball
51 ./configure
52 make dist
53
54 mkdir -p $BUILD_PATH
55 cp *.tar.* $BUILD_PATH/
56 cd $BUILD_PATH
57
58 # Ignore level 1 of tar
59 tar xvf *.tar.* --strip 1
60
61 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
62 ;;
63 *)
64 BUILD_PATH=$WORKSPACE
65 echo "Standard tree build"
66 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
67 ;;
68esac
a591496f
JR
69
70make
71make install
72
73rm -rf $WORKSPACE/tap
74mkdir -p $WORKSPACE/tap
75
d05d558c 76cd $BUILD_PATH/tests
a591496f
JR
77
78# Run make check tests
5c316659
JR
79if [ -e $BUILD_PATH/tests/tests ]; then
80 prove --merge --exec '' - < $BUILD_PATH/tests/tests --archive $WORKSPACE/tap/ || true
81else
82 echo "Missing test plan"
83 exit 1
84fi
a591496f
JR
85
86# TAP plugin is having a hard time with .yml files.
87rm -f $WORKSPACE/tap/meta.yml
88
89# And also with files without extension, so rename all result to *.tap
90find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \;
91
92make clean
93
94# Cleanup rpath and libtool .la files
95find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
96find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
97find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
d05d558c
JR
98
99if [ $build = "dist" ]; then
100 rm -rf $BUILD_PATH
101fi
This page took 0.027177 seconds and 4 git commands to generate.