Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 1 | set -e -x |
| 2 | |
| 3 | base="$PWD" |
| 4 | prefix="$base/inst-osmo-nitb" |
| 5 | |
| 6 | rm -f "$base/osmo-nitb*.tgz" |
| 7 | |
| 8 | deps=" |
| 9 | libosmocore |
| 10 | libosmo-abis |
| 11 | libosmo-netif |
| 12 | openggsn |
| 13 | libsmpp34 |
| 14 | libosmo-sccp |
| 15 | openbsc |
| 16 | " |
| 17 | |
| 18 | have_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 | |
| 32 | rm -rf "$prefix" |
| 33 | mkdir -p "$prefix" |
| 34 | |
| 35 | export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" |
| 36 | export LD_LIBRARY_PATH="$prefix/lib" |
| 37 | |
| 38 | for 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 |
| 59 | done |
| 60 | |
| 61 | # build the archive that is going to be copied to the tester |
| 62 | cd "$prefix" |
| 63 | tar czf "$base/osmo-nitb.build-${BUILD_NUMBER}.tgz" * |