-su $SUDO_USER -c "git -C ${BASEFOLDER} clone ${GIT_OSMIM_URL} IM"
-LATEST_STABLE_TAG=`git -C "${BASEFOLDER}/IM" tag -l v[0-9].* | tail -n1`
-# TODO remove comment when a stable version of IM were tagged
-# [[ -z $DEVELOP ]] && su $SUDO_USER -c "git -C ${BASEFOLDER}/IM checkout tags/${LATEST_STABLE_TAG}"
-
-# Install debian dependencies before setup.py
-if [[ -z "$NO_PACKAGES" ]]
-then
- [ "$_DISTRO" == "Ubuntu" ] && install_packages "tox debhelper python-bitarray"
- # TODO check packages for CentOS and RedHat
- [ "$_DISTRO" == "CentOS" -o "$_DISTRO" == "Red" ] && install_packages "tox debhelper python-bitarray"
- pip install stdeb pyangbind
-fi
-su $SUDO_USER -c "make -C ${BASEFOLDER}/IM all"
-dpkg -i ${BASEFOLDER}/IM/deb_dist/python-osm-im*.deb ${BASEFOLDER}/IM/pyangbind/deb_dist/*.deb \
- ${BASEFOLDER}/IM/pyang/deb_dist/*.deb
-rm -rf "${BASEFOLDER}/IM"
-OSM_IM_PATH=`python -c 'import osm_im; print osm_im.__path__[0]'` ||
- ! echo "ERROR installing python-osm-im library!!!" >&2 || exit 1
-
+ ${BASEFOLDER}/scripts/install-osm-im.sh
+ OSM_IM_PATH=`python -c 'import osm_im; print osm_im.__path__[0]'` ||
+ ! echo "ERROR installing python-osm-im library!!!" >&2 || exit 1