# date: 2017/04/20

set -ex

osmo_src=$HOME/osmo/src
mkdir -p $osmo_src

cd $osmo_src
git clone git://git.osmocom.org/libosmocore
cd libosmocore
autoreconf -fi
./configure
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/libosmo-abis
cd libosmo-abis
autoreconf -fi
./configure
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/libosmo-netif
cd libosmo-netif
autoreconf -fi
./configure
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/libosmo-sccp
cd libosmo-sccp
# build specific tag
git tag -l
git checkout tags/old_sua
autoreconf -fi
./configure
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/libsmpp34
cd libsmpp34
autoreconf -fi
./configure
make
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/asn1c
cd asn1c
# build specific branch
git checkout aper-prefix-onto-upstream
autoreconf -fi
./configure
make -j8
make install

cd $osmo_src
git clone git://git.osmocom.org/libasn1c
cd libasn1c
autoreconf -fi
./configure
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/osmo-iuh
cd osmo-iuh
autoreconf -fi
./configure
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/openggsn
cd openggsn
autoreconf -fi
./configure
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/openbsc
cd openbsc/openbsc
# build specific branch
git checkout vlr_3G
autoreconf -fi
./configure --enable-iu
make -j8
make check
make install

cd $osmo_src
git clone git://git.osmocom.org/osmo-hlr
cd osmo-hlr
autoreconf -fi
./configure
make -j8
make check
make install
