blob: e655082422e73db3a6d80d35bd70e73af64bb26b [file] [log] [blame]
Neels Hofmeyrd46ea132017-04-08 15:56:31 +02001set -e -x
2
3base="$PWD"
4prefix="$base/inst-osmo-nitb"
5
6rm -f "$base/osmo-nitb*.tgz"
7
8deps="
9libosmocore
10libosmo-abis
11libosmo-netif
12openggsn
13libsmpp34
14libosmo-sccp
15openbsc
16"
17
18have_repo() {
19 repo="$1"
20 cd "$base"
21 if [ ! -e "$repo" ]; then
22 set +x
23 echo "MISSING REPOSITORY: $repo"
24 echo "should be provided by the jenkins workspace"
25 exit 1
26 fi
27 cd "$repo"
28 git clean -dxf
29 cd "$base"
30}
31
32rm -rf "$prefix"
33mkdir -p "$prefix"
34
35export PKG_CONFIG_PATH="$prefix/lib/pkgconfig"
36export LD_LIBRARY_PATH="$prefix/lib"
37
38for dep in $deps; do
39 have_repo "$dep"
40 cd "$dep"
41 rm -rf *
42 git checkout .
43
44 echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-nitb_git_hashes.txt"
45
46 config_opts=""
47
48 case "$dep" in
49 'openbsc')
50 config_opts="$config_opts --enable-smpp --enable-osmo-bsc --enable-nat"
51 cd openbsc/
52 ;;
53 esac
54
55 autoreconf -fi
56 ./configure --prefix="$prefix" $config_opts
57 make -j8 || make # libsmpp34 can't build in parallel
58 make install
59done
60
61# build the archive that is going to be copied to the tester
62cd "$prefix"
63tar czf "$base/osmo-nitb.build-${BUILD_NUMBER}.tgz" *