3 #--------------------------------------------------------------------------------
4 # Copyright (c) 2018-2019 AT&T Intellectual Property.
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #--------------------------------------------------------------------------------
21 # ---------------------------------------------------------------------------
22 # Mnemonic: bld_dev_env.sh
23 # Abstract: This script is meant to be executed by a RUN command in
24 # a docker file. It fetches NNG, builds/installs it, and then
25 # does a wget of the desired RMR version's packages and installs
26 # them. RMR is fetched from package cloud.
28 # Date: 22 August 2019
29 # Author: E. Scott Daniels
30 # ---------------------------------------------------------------------------
38 -n) nng_ver=$2; shift;;
39 -r) rmr_ver=$2; shift;;
45 if [[ $nng_ver != "v"* ]]
50 set -e # from this point on crash on any error
51 mkdir -p /playpen/build/nng
53 git clone https://github.com/nanomsg/nng.git
58 echo "building nng (messages supressed unless there is an error)"
61 if ! cmake .. >/tmp/cmake.nng.log 2>&1
63 cat /tmp/cmake.nng.log
65 echo "### ERROR ### NNG cmake configuration failed"
69 if ! make install >/tmp/build.nng.log 2>&1
71 cat /tmp/build.nng.log
73 echo "### ERROR ### NNG build failed"
78 echo "nng build finished ok"
80 rm -fr /playpen/build/nng
82 echo "installing RMR packages version = $rmr_ver"
83 mkdir -p /playpen/build/pkgs
84 cd /playpen/build/pkgs
86 base_url=https://packagecloud.io/o-ran-sc/master/packages/debian/stretch/
87 base_url=https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/
88 pc_url=${base_url}rmr_${rmr_ver}_amd64.deb/download.deb
89 pc_dev_url=${base_url}rmr-dev_${rmr_ver}_amd64.deb/download.deb
91 wget -q -O rmr.deb $pc_url
92 wget -q -O rmr-dev.deb $pc_dev_url
97 rm -fr /playpen/build/pkgs
98 echo "RMR package install finished"