diff options
author | Mauro Sardara <msardara+fdio@cisco.com> | 2017-04-29 21:14:25 +0200 |
---|---|---|
committer | Mauro Sardara <msardara+fdio@cisco.com> | 2017-04-29 22:11:51 +0200 |
commit | 844daaec88924ba1f374c7bd8fd69692904012ed (patch) | |
tree | 0d8bca1560ee58cc227e9386758f23def4147bd6 /scripts | |
parent | 307d69f67c01dbf05b1da447589645713d6ca27b (diff) |
Adding dev and doc package support.
Change-Id: I89b4aa6598d88226a1eafd6b7240a30be3d795c3
Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/build-package.sh | 59 |
1 files changed, 17 insertions, 42 deletions
diff --git a/scripts/build-package.sh b/scripts/build-package.sh index 9673438a..f4fb67ea 100644 --- a/scripts/build-package.sh +++ b/scripts/build-package.sh @@ -1,5 +1,4 @@ #!/bin/bash -# basic build script example set -euxo pipefail IFS=$'\n\t' @@ -7,43 +6,27 @@ SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P ) APT_PATH=`which apt-get` || true apt_get=${APT_PATH:-"/usr/local/bin/apt-get"} -BUILD_TOOLS_UBUNTU="build-essential cmake" +BUILD_TOOLS_UBUNTU="build-essential doxygen" LIBSSL_LIBEVENT_UBUNTU="libevent-dev libssl-dev" -DEPS_UBUNTU="$LIBSSL_LIBEVENT_UBUNTU longbow libparc libccnx-common libccnx-transport-rta libccnx-portal libboost-system-dev" +DEPS_UBUNTU="$LIBSSL_LIBEVENT_UBUNTU longbow-dev libparc-dev libccnx-common-dev libccnx-transport-rta-dev libccnx-portal-dev libboost-system-dev" BUILD_TOOLS_GROUP_CENTOS="'Development Tools'" -BUILD_TOOLS_SINGLE_CENTOS="cmake" LIBSSL_LIBEVENT_CENTOS="libevent-devel openssl-devel" -DEPS_CENTOS="$LIBSSL_LIBEVENT_CENTOS longbow libparc libccnx-common libccnx-transport-rta libccnx-portal boost-devel" +DEPS_CENTOS="$LIBSSL_LIBEVENT_CENTOS longbow-devel libparc-devel libccnx-common-devel libccnx-transport-rta-devel libccnx-portal-devel boost-devel" -# Parameters: -# $1 = Distribution [Trusty / CentOS] -# update_cmake_repo() { - DISTRIBUTION=$1 + cat /etc/resolv.conf + echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf + cat /etc/resolv.conf - if [ "$DISTRIBUTION" == "trusty" ]; then - sudo ${apt_get} install -y --allow-unauthenticated software-properties-common - sudo add-apt-repository --yes ppa:george-edison55/cmake-3.x - elif [ "$DISTRIBUTION" == "CentOS" ]; then - sudo cat << EOF > cmake.repo -[cmake-repo] -name=Repo for cmake3 -baseurl=http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64/ -enabled=1 -gpgcheck=0 -EOF - sudo cat << EOF > jsoncpp.repo -[jsoncp-repo] -name=Repo for jsoncpp -baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/ -enabled=1 -gpgcheck=0 -EOF - sudo mv cmake.repo /etc/yum.repos.d/cmake.repo - sudo mv jsoncpp.repo /etc/yum.repos.d/jsoncpp.repo - fi + CMAKE_INSTALL_SCRIPT_URL="https://cmake.org/files/v3.8/cmake-3.8.0-Linux-x86_64.sh" + CMAKE_INSTALL_SCRIPT="/tmp/install_cmake.sh" + curl ${CMAKE_INSTALL_SCRIPT_URL} > ${CMAKE_INSTALL_SCRIPT} + + sudo mkdir -p /opt/cmake + sudo bash ${CMAKE_INSTALL_SCRIPT} --skip-license --prefix=/opt/cmake + export PATH=/opt/cmake/bin:$PATH } # Parameters: @@ -127,18 +110,11 @@ setup() { DISTRIB_ID=$1 DISTRIB_CODENAME=$2 - if [ "$DISTRIB_ID" == "Ubuntu" ]; then - if [ "$DISTRIB_CODENAME" == "trusty" ]; then - update_cmake_repo $DISTRIB_CODENAME - fi - - update_fdio_repo $DISTRIB_ID $DISTRIB_CODENAME + update_cmake_repo + update_fdio_repo $DISTRIB_ID $DISTRIB_CODENAME + if [ "$DISTRIB_ID" == "Ubuntu" ]; then sudo ${apt_get} update || true - - elif [ "$DISTRIB_ID" == "CentOS" ]; then - update_cmake_repo $DISTRIB_ID - update_fdio_repo $DISTRIB_ID $DISTRIB_CODENAME fi } @@ -190,7 +166,6 @@ build_package() { echo $BUILD_TOOLS_UBUNTU $DEPS_UBUNTU | xargs sudo ${apt_get} install -y --allow-unauthenticated elif [ $DISTRIB_ID == "CentOS" ]; then echo $BUILD_TOOLS_GROUP_CENTOS | xargs sudo yum groupinstall -y --nogpgcheck - echo $BUILD_TOOLS_SINGLE_CENTOS | xargs sudo yum install -y --nogpgcheck echo $DEPS_CENTOS | xargs sudo yum install -y --nogpgcheck || true fi @@ -218,4 +193,4 @@ build_package() { PACKAGE_NAME="LIBICNET" pushd $SCRIPT_PATH/.. build_package $PACKAGE_NAME -popd
\ No newline at end of file +popd |