5 # Copyright (C) 2019 AT&T Intellectual Property and Nokia
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 # Installs NNG from source and RMR from PackageCloud on CentOS7
20 # Reads RMR version number from repo file rmr-version.yaml
22 echo "---> install-rpm-nng-rmr.sh"
26 echo "Install packages"
31 echo "INFO: cd to tox-dir $TOX_DIR"
32 cd "$WORKSPACE/$TOX_DIR"
34 version_file=rmr-version.yaml
35 if [[ -f $version_file ]]; then
36 # pipeline is less elegant than yq but that requires venv and pip install
37 ver=$(grep "^version:" "$version_file" | cut -d: -f2 | xargs )
39 echo "File $version_file not found."
42 if [[ -z $ver ]]; then
43 echo "Failed to get RMR version string from file $version_file"
46 echo "RMR version string is ${ver}"
49 # NNG repo is not frequently tagged so it's pinned to a commit hash.
50 # This commit provides fix to the proxy-reconnect
51 # bug that we identified: https://github.com/nanomsg/nng/issues/970
52 echo "Clone and build NNG"
53 git clone https://github.com/nanomsg/nng.git
55 && git checkout e618abf8f3db2a94269a79c8901a51148d48fcc2 \
58 && cmake3 -DBUILD_SHARED_LIBS=1 -G Ninja .. \
60 && sudo ninja-build install)
62 # RPM packager adds suffix "-1" to version
63 rpm="rmr-${ver}-1.x86_64.rpm"
64 echo "Download RMR library ${ver} as file ${rpm}"
65 wget -nv --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/el/5/${rpm}/download.rpm
66 echo "Install RMR library file ${rpm}"
69 echo "---> install-rpm-nng-rmr.sh ends"