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 -e -x |
| 3 | |
| 4 | deps=" |
| 5 | libosmocore |
| 6 | libosmo-abis |
| 7 | osmo-bts |
| 8 | " |
| 9 | |
| 10 | base="$PWD" |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 11 | rm -f "$base/osmo-bts-sysmo.*.tgz" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 12 | |
| 13 | have_repo() { |
| 14 | repo="$1" |
| 15 | cd "$base" |
Neels Hofmeyr | 0765098 | 2017-05-12 16:24:16 +0200 | [diff] [blame] | 16 | if [ ! -d "$repo" ]; then |
| 17 | git clone "git://git.osmocom.org/$repo" "$repo" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 18 | fi |
| 19 | cd "$repo" |
| 20 | git clean -dxf |
Neels Hofmeyr | 0765098 | 2017-05-12 16:24:16 +0200 | [diff] [blame] | 21 | git fetch origin |
| 22 | git reset --hard origin/master |
| 23 | git rev-parse HEAD |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 24 | cd "$base" |
| 25 | } |
| 26 | |
| 27 | for dep in $deps; do |
| 28 | have_repo "$dep" |
| 29 | done |
| 30 | |
| 31 | # for gsm_data_shared.h |
| 32 | have_repo openbsc |
| 33 | |
| 34 | . /opt/poky/1.5.4/environment-setup-armv5te-poky-linux-gnueabi |
| 35 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 36 | # Cross-compilation: all installations need to be put in the sysmo SDK sysroot |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 37 | export DESTDIR=/opt/poky/1.5.4/sysroots/armv5te-poky-linux-gnueabi |
| 38 | |
| 39 | prefix_base="/usr/local/jenkins-build" |
| 40 | prefix_base_real="$DESTDIR$prefix_base" |
| 41 | rm -rf "$prefix_base_real" |
| 42 | |
| 43 | prefix="$prefix_base/inst-osmo-bts-sysmo" |
| 44 | prefix_real="$DESTDIR$prefix" |
| 45 | mkdir -p "$prefix_real" |
| 46 | |
Neels Hofmeyr | 1eb5cbc | 2017-05-24 18:10:52 +0200 | [diff] [blame] | 47 | # Installation in non-system dir, but keep the PKG_CONFIG_PATH from the SDK: |
| 48 | export PKG_CONFIG_PATH="$prefix_real/lib/pkgconfig:$PKG_CONFIG_PATH" |
| 49 | |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 50 | for dep in $deps; do |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 51 | cd "$base/$dep" |
| 52 | rm -rf * |
| 53 | git checkout . |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 54 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 55 | echo "$(git rev-parse HEAD) $dep" >> "$prefix_real/osmo-bts-sysmo_git_hashes.txt" |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 56 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 57 | autoreconf -fi |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 58 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 59 | config_opts="" |
| 60 | case "$dep" in |
| 61 | 'libosmocore') config_opts="--disable-pcsc" ;; |
| 62 | 'osmo-bts') config_opts="--enable-sysmocom-bts --with-openbsc=$base/openbsc/openbsc/include" ;; |
| 63 | esac |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 64 | |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 65 | ./configure --prefix="$prefix" $CONFIGURE_FLAGS $config_opts |
| 66 | make -j8 |
| 67 | make install |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 68 | done |
| 69 | |
Neels Hofmeyr | 62a5600 | 2017-05-22 19:32:06 +0200 | [diff] [blame] | 70 | # don't package documentation -- the libosmocore docs can be up to 16 Mb large, |
| 71 | # a significant amount compared to the binaries |
| 72 | rm -rf "$prefix_real/share/doc/libosmocore" |
| 73 | |
Neels Hofmeyr | dae3d3c | 2017-03-28 12:16:58 +0200 | [diff] [blame] | 74 | # build the archive that is going to be copied to the tester and then to the BTS |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 75 | rm "$base"/*.tgz "$base"/*.md5 || true |
Neels Hofmeyr | d46ea13 | 2017-04-08 15:56:31 +0200 | [diff] [blame] | 76 | cd "$prefix_real" |
Neels Hofmeyr | c59e079 | 2017-05-14 01:57:25 +0200 | [diff] [blame] | 77 | this="osmo-bts-sysmo.build-${BUILD_NUMBER}" |
| 78 | tar="${this}.tgz" |
| 79 | tar czf "$base/$tar" * |
| 80 | cd "$base" |
| 81 | md5sum "$tar" > "${this}.md5" |