Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 1 | #!/bin/sh |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 2 | set -x -e |
| 3 | |
| 4 | base="$PWD" |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 5 | prefix="$base/inst-osmo-bts-trx" |
| 6 | |
| 7 | rm -f "$base/osmo-bts-trx*.tgz" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 8 | |
| 9 | deps=" |
| 10 | libosmocore |
| 11 | libosmo-abis |
| 12 | osmo-trx |
| 13 | osmo-bts |
| 14 | " |
| 15 | |
| 16 | have_repo() { |
| 17 | repo="$1" |
| 18 | cd "$base" |
Neels Hofmeyr | 0765098 | 2017-05-12 16:24:16 +0200 | [diff] [blame] | 19 | if [ ! -d "$repo" ]; then |
| 20 | git clone "git://git.osmocom.org/$repo" "$repo" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 21 | fi |
| 22 | cd "$repo" |
| 23 | git clean -dxf |
Neels Hofmeyr | 0765098 | 2017-05-12 16:24:16 +0200 | [diff] [blame] | 24 | git fetch origin |
| 25 | git reset --hard origin/master |
| 26 | git rev-parse HEAD |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 27 | cd "$base" |
| 28 | } |
| 29 | |
| 30 | # for gsm_data_shared.* |
| 31 | have_repo openbsc |
| 32 | |
| 33 | |
| 34 | rm -rf "$prefix" |
| 35 | mkdir -p "$prefix" |
| 36 | |
| 37 | export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" |
| 38 | export LD_LIBRARY_PATH="$prefix/lib" |
| 39 | |
| 40 | for dep in $deps; do |
| 41 | have_repo "$dep" |
| 42 | cd "$dep" |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 43 | rm -rf * |
| 44 | git checkout . |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 45 | |
| 46 | echo "$(git rev-parse HEAD) $dep" >> "$prefix/osmo-bts-trx_osmo-trx_git_hashes.txt" |
| 47 | |
| 48 | autoreconf -fi |
| 49 | |
| 50 | config_opts="" |
| 51 | |
| 52 | case "$repo" in |
| 53 | 'osmo-bts') config_opts="--enable-trx --with-openbsc=$base/openbsc/openbsc/include" ;; |
| 54 | 'osmo-trx') config_opts="--without-sse" ;; |
| 55 | esac |
| 56 | |
| 57 | ./configure --prefix="$prefix" $config_opts |
| 58 | make -j8 |
| 59 | make install |
| 60 | done |
| 61 | |
Neels Hofmeyr | 62a5600 | 2017-05-22 19:32:06 +0200 | [diff] [blame] | 62 | # don't package documentation -- the libosmocore docs can be up to 16 Mb large, |
| 63 | # a significant amount compared to the binaries |
| 64 | rm -rf "$prefix/share/doc/libosmocore" |
| 65 | |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 66 | # build the archive that is going to be copied to the tester |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 67 | rm "$base"/*.tgz "$base"/*.md5 || true |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 68 | cd "$prefix" |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 69 | this="osmo-bts-trx.build-${BUILD_NUMBER}" |
| 70 | tar="${this}.tgz" |
| 71 | tar czf "$base/$tar" * |
| 72 | cd "$base" |
| 73 | md5sum "$tar" > "${this}.md5" |