12253566c4ed7f4c95b61d9a662f1c41cb47acb5
[releng/builder.git] / jjb / opflex / include-raw-opflex-build.sh
1 #!/bin/bash
2 # Build script for opflex
3
4 set -e
5 set -x
6
7 ROOT=/tmp/opflex-prefix
8
9 function cleanup {
10     if [ -d "$ROOT" ]; then rm -rf "$ROOT"; fi
11 }
12
13 # create dependency root prefix
14 cleanup
15 mkdir -p "$ROOT"
16 trap cleanup EXIT
17
18 tar -xz -C "$ROOT" --strip-components=2 -f libuv.tgz
19 tar -xz -C "$ROOT" --strip-components=2 -f rapidjson.tgz
20 tar -xz -C "$ROOT" --strip-components=2 -f openvswitch.tgz
21
22 export PATH="$ROOT/bin:$PATH"
23 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ROOT/lib"
24 export PKG_CONFIG_PATH="$ROOT/lib/pkgconfig"
25
26 # build libopflex
27 pushd libopflex
28 ./autogen.sh
29 ./configure --prefix="$ROOT" \
30     --with-buildversion=$BUILD_NUMBER \
31     CPPFLAGS="-isystem $ROOT/include"
32     CXXFLAGS="-Wall"
33 make -j8
34 if ! make check; then find . -name test-suite.log -exec cat {} \; && false; fi
35 make install
36 make dist
37 popd
38
39 # build libmodelgbp
40 pushd genie
41 CLASSPATH=target/classes java org.opendaylight.opflex.genie.Genie
42 pushd target/libmodelgbp
43 bash autogen.sh
44 ./configure --prefix="$ROOT"
45 make -j2
46 make install
47 make dist
48 popd
49 popd
50
51 # build agent-ovs
52 pushd agent-ovs
53 ./autogen.sh
54 ./configure --prefix="$ROOT" \
55     --with-buildversion=$BUILD_NUMBER \
56     CPPFLAGS="-isystem $ROOT/include" \
57     CXXFLAGS="-Wall"
58 make -j8
59 if ! make check; then find . -name test-suite.log -exec cat {} \; && false; fi
60 make dist
61 popd